-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersonal.go
41 lines (31 loc) · 922 Bytes
/
personal.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package monobank
import (
"context"
"net/http"
"time"
)
type PersonalAPI interface {
CommonAPI
// ClientInfo - https://api.monobank.ua/docs/#/definitions/UserInfo
ClientInfo(context.Context) (*ClientInfo, error)
// Transactions - gets bank account statements
// https://api.monobank.ua/docs/#/definitions/StatementItems
Transactions(ctx context.Context, accountID string, from, to time.Time) (Transactions, error)
}
type PersonalClient struct {
commonClient
}
func NewPersonalClient(client *http.Client) PersonalClient {
return PersonalClient{
commonClient: newCommonClient(client),
}
}
// WithAuth returns copy of PersonalClient with authorizer
func (c PersonalClient) WithAuth(auth Authorizer) PersonalClient {
c.withAuth(auth)
return c
}
func (c PersonalClient) SetWebHook(ctx context.Context, uri string) error {
const urlPath = "/personal/webhook"
return c.setWebHook(ctx, uri, urlPath)
}