-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogs.go
171 lines (146 loc) · 4.48 KB
/
logs.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// This file was auto-generated by Fern from our API Definition.
package basistheory
import (
json "encoding/json"
fmt "fmt"
core "github.com/Basis-Theory/go-sdk/core"
time "time"
)
type LogsListRequest struct {
EntityType *string `json:"-" url:"entity_type,omitempty"`
EntityID *string `json:"-" url:"entity_id,omitempty"`
StartDate *time.Time `json:"-" url:"start_date,omitempty"`
EndDate *time.Time `json:"-" url:"end_date,omitempty"`
Page *int `json:"-" url:"page,omitempty"`
Start *string `json:"-" url:"start,omitempty"`
Size *int `json:"-" url:"size,omitempty"`
}
type Log struct {
ID *string `json:"id,omitempty" url:"id,omitempty"`
TenantID *string `json:"tenant_id,omitempty" url:"tenant_id,omitempty"`
ActorID *string `json:"actor_id,omitempty" url:"actor_id,omitempty"`
ActorType *string `json:"actor_type,omitempty" url:"actor_type,omitempty"`
EntityType *string `json:"entity_type,omitempty" url:"entity_type,omitempty"`
EntityID *string `json:"entity_id,omitempty" url:"entity_id,omitempty"`
Operation *string `json:"operation,omitempty" url:"operation,omitempty"`
Message *string `json:"message,omitempty" url:"message,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (l *Log) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *Log) UnmarshalJSON(data []byte) error {
type embed Log
var unmarshaler = struct {
embed
CreatedAt *core.DateTime `json:"created_at,omitempty"`
}{
embed: embed(*l),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*l = Log(unmarshaler.embed)
l.CreatedAt = unmarshaler.CreatedAt.TimePtr()
extraProperties, err := core.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l._rawJSON = json.RawMessage(data)
return nil
}
func (l *Log) MarshalJSON() ([]byte, error) {
type embed Log
var marshaler = struct {
embed
CreatedAt *core.DateTime `json:"created_at,omitempty"`
}{
embed: embed(*l),
CreatedAt: core.NewOptionalDateTime(l.CreatedAt),
}
return json.Marshal(marshaler)
}
func (l *Log) String() string {
if len(l._rawJSON) > 0 {
if value, err := core.StringifyJSON(l._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}
type LogEntityType struct {
DisplayName *string `json:"display_name,omitempty" url:"display_name,omitempty"`
Value *string `json:"value,omitempty" url:"value,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (l *LogEntityType) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *LogEntityType) UnmarshalJSON(data []byte) error {
type unmarshaler LogEntityType
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = LogEntityType(value)
extraProperties, err := core.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l._rawJSON = json.RawMessage(data)
return nil
}
func (l *LogEntityType) String() string {
if len(l._rawJSON) > 0 {
if value, err := core.StringifyJSON(l._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}
type LogPaginatedList struct {
Pagination *Pagination `json:"pagination,omitempty" url:"pagination,omitempty"`
Data []*Log `json:"data,omitempty" url:"data,omitempty"`
extraProperties map[string]interface{}
_rawJSON json.RawMessage
}
func (l *LogPaginatedList) GetExtraProperties() map[string]interface{} {
return l.extraProperties
}
func (l *LogPaginatedList) UnmarshalJSON(data []byte) error {
type unmarshaler LogPaginatedList
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*l = LogPaginatedList(value)
extraProperties, err := core.ExtractExtraProperties(data, *l)
if err != nil {
return err
}
l.extraProperties = extraProperties
l._rawJSON = json.RawMessage(data)
return nil
}
func (l *LogPaginatedList) String() string {
if len(l._rawJSON) > 0 {
if value, err := core.StringifyJSON(l._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(l); err == nil {
return value
}
return fmt.Sprintf("%#v", l)
}