-
Notifications
You must be signed in to change notification settings - Fork 2
/
usercipheruse.go
55 lines (44 loc) · 1.52 KB
/
usercipheruse.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
package files_sdk
import (
"encoding/json"
"time"
lib "github.com/Files-com/files-sdk-go/v2/lib"
)
type UserCipherUse struct {
Id int64 `json:"id,omitempty" path:"id"`
ProtocolCipher string `json:"protocol_cipher,omitempty" path:"protocol_cipher"`
CreatedAt *time.Time `json:"created_at,omitempty" path:"created_at"`
Interface string `json:"interface,omitempty" path:"interface"`
UpdatedAt *time.Time `json:"updated_at,omitempty" path:"updated_at"`
UserId int64 `json:"user_id,omitempty" path:"user_id"`
}
type UserCipherUseCollection []UserCipherUse
type UserCipherUseListParams struct {
UserId int64 `url:"user_id,omitempty" required:"false" json:"user_id,omitempty" path:"user_id"`
lib.ListParams
}
func (u *UserCipherUse) UnmarshalJSON(data []byte) error {
type userCipherUse UserCipherUse
var v userCipherUse
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, map[string]interface{}{})
}
*u = UserCipherUse(v)
return nil
}
func (u *UserCipherUseCollection) UnmarshalJSON(data []byte) error {
type userCipherUses UserCipherUseCollection
var v userCipherUses
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, []map[string]interface{}{})
}
*u = UserCipherUseCollection(v)
return nil
}
func (u *UserCipherUseCollection) ToSlice() *[]interface{} {
ret := make([]interface{}, len(*u))
for i, v := range *u {
ret[i] = v
}
return &ret
}