-
Notifications
You must be signed in to change notification settings - Fork 2
/
settingschange.go
57 lines (46 loc) · 1.83 KB
/
settingschange.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
package files_sdk
import (
"encoding/json"
"time"
lib "github.com/Files-com/files-sdk-go/v2/lib"
)
type SettingsChange struct {
Changes []string `json:"changes,omitempty" path:"changes"`
CreatedAt *time.Time `json:"created_at,omitempty" path:"created_at"`
UserId int64 `json:"user_id,omitempty" path:"user_id"`
UserIsFilesSupport *bool `json:"user_is_files_support,omitempty" path:"user_is_files_support"`
Username string `json:"username,omitempty" path:"username"`
}
type SettingsChangeCollection []SettingsChange
type SettingsChangeListParams struct {
SortBy json.RawMessage `url:"sort_by,omitempty" required:"false" json:"sort_by,omitempty" path:"sort_by"`
ApiKeyId string `url:"api_key_id,omitempty" required:"false" json:"api_key_id,omitempty" path:"api_key_id"`
UserId string `url:"user_id,omitempty" required:"false" json:"user_id,omitempty" path:"user_id"`
Filter json.RawMessage `url:"filter,omitempty" required:"false" json:"filter,omitempty" path:"filter"`
lib.ListParams
}
func (s *SettingsChange) UnmarshalJSON(data []byte) error {
type settingsChange SettingsChange
var v settingsChange
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, map[string]interface{}{})
}
*s = SettingsChange(v)
return nil
}
func (s *SettingsChangeCollection) UnmarshalJSON(data []byte) error {
type settingsChanges SettingsChangeCollection
var v settingsChanges
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, []map[string]interface{}{})
}
*s = SettingsChangeCollection(v)
return nil
}
func (s *SettingsChangeCollection) ToSlice() *[]interface{} {
ret := make([]interface{}, len(*s))
for i, v := range *s {
ret[i] = v
}
return &ret
}