forked from checkout/checkout-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reports.go
59 lines (51 loc) · 1.92 KB
/
reports.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package reports
import (
"time"
"github.com/PaddleHQ/checkout-sdk-go/common"
)
const (
reports = "reports"
files = "files"
)
type (
QueryFilter struct {
CreatedAfter *time.Time `url:"created_after,omitempty" layout:"2006-01-02"`
CreatedBefore *time.Time `url:"created_before,omitempty" layout:"2006-01-02"`
EntityId string `url:"entity_id,omitempty"`
Limit int `url:"limit,omitempty"`
PaginationToken string `url:"pagination_token,omitempty"`
}
)
type (
ReportResponse struct {
HttpMetadata common.HttpMetadata
Id string `json:"id,omitempty"`
CreatedOn string `json:"created_on,omitempty"`
LastModifiedOn string `json:"last_modified_on,omitempty"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Account *Account `json:"account,omitempty"`
Tags []string `json:"tags,omitempty"`
From *time.Time `json:"from,omitempty"`
To *time.Time `json:"to,omitempty"`
Files []File `json:"files,omitempty"`
Links map[string]common.Link `json:"_links"`
}
QueryResponse struct {
HttpMetadata common.HttpMetadata
Count int `json:"count,omitempty"`
Limit uint8 `json:"limit,omitempty"`
Data []ReportResponse `json:"data,omitempty"`
Links map[string]common.Link `json:"_links"`
}
)
type Account struct {
ClientId string `json:"client_id,omitempty"`
EntityId string `json:"entity_id,omitempty"`
}
type File struct {
Id string `json:"id,omitempty"`
Filename string `json:"filename,omitempty"`
Format string `json:"format,omitempty"`
Links map[string]common.Link `json:"_links"`
}