-
Notifications
You must be signed in to change notification settings - Fork 2
/
bundleregistration.go
62 lines (51 loc) · 1.73 KB
/
bundleregistration.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
60
61
62
package files_sdk
import (
"encoding/json"
lib "github.com/Files-com/files-sdk-go/v2/lib"
)
type BundleRegistration struct {
Code string `json:"code,omitempty"`
Name string `json:"name,omitempty"`
Company string `json:"company,omitempty"`
Email string `json:"email,omitempty"`
Ip string `json:"ip,omitempty"`
InboxCode string `json:"inbox_code,omitempty"`
ClickwrapBody string `json:"clickwrap_body,omitempty"`
FormFieldSetId int64 `json:"form_field_set_id,omitempty"`
FormFieldData string `json:"form_field_data,omitempty"`
BundleId int64 `json:"bundle_id,omitempty"`
BundleRecipientId int64 `json:"bundle_recipient_id,omitempty"`
}
type BundleRegistrationCollection []BundleRegistration
type BundleRegistrationListParams struct {
UserId int64 `url:"user_id,omitempty" required:"false"`
Cursor string `url:"cursor,omitempty" required:"false"`
PerPage int64 `url:"per_page,omitempty" required:"false"`
BundleId int64 `url:"bundle_id,omitempty" required:"false"`
lib.ListParams
}
func (b *BundleRegistration) UnmarshalJSON(data []byte) error {
type bundleRegistration BundleRegistration
var v bundleRegistration
if err := json.Unmarshal(data, &v); err != nil {
return err
}
*b = BundleRegistration(v)
return nil
}
func (b *BundleRegistrationCollection) UnmarshalJSON(data []byte) error {
type bundleRegistrations []BundleRegistration
var v bundleRegistrations
if err := json.Unmarshal(data, &v); err != nil {
return err
}
*b = BundleRegistrationCollection(v)
return nil
}
func (b *BundleRegistrationCollection) ToSlice() *[]interface{} {
ret := make([]interface{}, len(*b))
for i, v := range *b {
ret[i] = v
}
return &ret
}