-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsquads.go
More file actions
450 lines (392 loc) · 15 KB
/
squads.go
File metadata and controls
450 lines (392 loc) · 15 KB
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
// Code generated by Fern. DO NOT EDIT.
package api
import (
json "encoding/json"
fmt "fmt"
internal "github.com/VapiAI/server-sdk-go/internal"
big "math/big"
time "time"
)
var (
deleteSquadsRequestFieldId = big.NewInt(1 << 0)
)
type DeleteSquadsRequest struct {
Id string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (d *DeleteSquadsRequest) require(field *big.Int) {
if d.explicitFields == nil {
d.explicitFields = big.NewInt(0)
}
d.explicitFields.Or(d.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (d *DeleteSquadsRequest) SetId(id string) {
d.Id = id
d.require(deleteSquadsRequestFieldId)
}
var (
getSquadsRequestFieldId = big.NewInt(1 << 0)
)
type GetSquadsRequest struct {
Id string `json:"-" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (g *GetSquadsRequest) require(field *big.Int) {
if g.explicitFields == nil {
g.explicitFields = big.NewInt(0)
}
g.explicitFields.Or(g.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (g *GetSquadsRequest) SetId(id string) {
g.Id = id
g.require(getSquadsRequestFieldId)
}
var (
listSquadsRequestFieldLimit = big.NewInt(1 << 0)
listSquadsRequestFieldCreatedAtGt = big.NewInt(1 << 1)
listSquadsRequestFieldCreatedAtLt = big.NewInt(1 << 2)
listSquadsRequestFieldCreatedAtGe = big.NewInt(1 << 3)
listSquadsRequestFieldCreatedAtLe = big.NewInt(1 << 4)
listSquadsRequestFieldUpdatedAtGt = big.NewInt(1 << 5)
listSquadsRequestFieldUpdatedAtLt = big.NewInt(1 << 6)
listSquadsRequestFieldUpdatedAtGe = big.NewInt(1 << 7)
listSquadsRequestFieldUpdatedAtLe = big.NewInt(1 << 8)
)
type ListSquadsRequest struct {
// This is the maximum number of items to return. Defaults to 100.
Limit *float64 `json:"-" url:"limit,omitempty"`
// This will return items where the createdAt is greater than the specified value.
CreatedAtGt *time.Time `json:"-" url:"createdAtGt,omitempty"`
// This will return items where the createdAt is less than the specified value.
CreatedAtLt *time.Time `json:"-" url:"createdAtLt,omitempty"`
// This will return items where the createdAt is greater than or equal to the specified value.
CreatedAtGe *time.Time `json:"-" url:"createdAtGe,omitempty"`
// This will return items where the createdAt is less than or equal to the specified value.
CreatedAtLe *time.Time `json:"-" url:"createdAtLe,omitempty"`
// This will return items where the updatedAt is greater than the specified value.
UpdatedAtGt *time.Time `json:"-" url:"updatedAtGt,omitempty"`
// This will return items where the updatedAt is less than the specified value.
UpdatedAtLt *time.Time `json:"-" url:"updatedAtLt,omitempty"`
// This will return items where the updatedAt is greater than or equal to the specified value.
UpdatedAtGe *time.Time `json:"-" url:"updatedAtGe,omitempty"`
// This will return items where the updatedAt is less than or equal to the specified value.
UpdatedAtLe *time.Time `json:"-" url:"updatedAtLe,omitempty"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (l *ListSquadsRequest) require(field *big.Int) {
if l.explicitFields == nil {
l.explicitFields = big.NewInt(0)
}
l.explicitFields.Or(l.explicitFields, field)
}
// SetLimit sets the Limit field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetLimit(limit *float64) {
l.Limit = limit
l.require(listSquadsRequestFieldLimit)
}
// SetCreatedAtGt sets the CreatedAtGt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetCreatedAtGt(createdAtGt *time.Time) {
l.CreatedAtGt = createdAtGt
l.require(listSquadsRequestFieldCreatedAtGt)
}
// SetCreatedAtLt sets the CreatedAtLt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetCreatedAtLt(createdAtLt *time.Time) {
l.CreatedAtLt = createdAtLt
l.require(listSquadsRequestFieldCreatedAtLt)
}
// SetCreatedAtGe sets the CreatedAtGe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetCreatedAtGe(createdAtGe *time.Time) {
l.CreatedAtGe = createdAtGe
l.require(listSquadsRequestFieldCreatedAtGe)
}
// SetCreatedAtLe sets the CreatedAtLe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetCreatedAtLe(createdAtLe *time.Time) {
l.CreatedAtLe = createdAtLe
l.require(listSquadsRequestFieldCreatedAtLe)
}
// SetUpdatedAtGt sets the UpdatedAtGt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetUpdatedAtGt(updatedAtGt *time.Time) {
l.UpdatedAtGt = updatedAtGt
l.require(listSquadsRequestFieldUpdatedAtGt)
}
// SetUpdatedAtLt sets the UpdatedAtLt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetUpdatedAtLt(updatedAtLt *time.Time) {
l.UpdatedAtLt = updatedAtLt
l.require(listSquadsRequestFieldUpdatedAtLt)
}
// SetUpdatedAtGe sets the UpdatedAtGe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetUpdatedAtGe(updatedAtGe *time.Time) {
l.UpdatedAtGe = updatedAtGe
l.require(listSquadsRequestFieldUpdatedAtGe)
}
// SetUpdatedAtLe sets the UpdatedAtLe field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (l *ListSquadsRequest) SetUpdatedAtLe(updatedAtLe *time.Time) {
l.UpdatedAtLe = updatedAtLe
l.require(listSquadsRequestFieldUpdatedAtLe)
}
var (
squadFieldName = big.NewInt(1 << 0)
squadFieldMembers = big.NewInt(1 << 1)
squadFieldMembersOverrides = big.NewInt(1 << 2)
squadFieldId = big.NewInt(1 << 3)
squadFieldOrgId = big.NewInt(1 << 4)
squadFieldCreatedAt = big.NewInt(1 << 5)
squadFieldUpdatedAt = big.NewInt(1 << 6)
)
type Squad struct {
// This is the name of the squad.
Name *string `json:"name,omitempty" url:"name,omitempty"`
// This is the list of assistants that make up the squad.
//
// The call will start with the first assistant in the list.
Members []*SquadMemberDto `json:"members" url:"members"`
// This can be used to override all the assistants' settings and provide values for their template variables.
//
// Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.
MembersOverrides *AssistantOverrides `json:"membersOverrides,omitempty" url:"membersOverrides,omitempty"`
// This is the unique identifier for the squad.
Id string `json:"id" url:"id"`
// This is the unique identifier for the org that this squad belongs to.
OrgId string `json:"orgId" url:"orgId"`
// This is the ISO 8601 date-time string of when the squad was created.
CreatedAt time.Time `json:"createdAt" url:"createdAt"`
// This is the ISO 8601 date-time string of when the squad was last updated.
UpdatedAt time.Time `json:"updatedAt" url:"updatedAt"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
extraProperties map[string]interface{}
rawJSON json.RawMessage
}
func (s *Squad) GetName() *string {
if s == nil {
return nil
}
return s.Name
}
func (s *Squad) GetMembers() []*SquadMemberDto {
if s == nil {
return nil
}
return s.Members
}
func (s *Squad) GetMembersOverrides() *AssistantOverrides {
if s == nil {
return nil
}
return s.MembersOverrides
}
func (s *Squad) GetId() string {
if s == nil {
return ""
}
return s.Id
}
func (s *Squad) GetOrgId() string {
if s == nil {
return ""
}
return s.OrgId
}
func (s *Squad) GetCreatedAt() time.Time {
if s == nil {
return time.Time{}
}
return s.CreatedAt
}
func (s *Squad) GetUpdatedAt() time.Time {
if s == nil {
return time.Time{}
}
return s.UpdatedAt
}
func (s *Squad) GetExtraProperties() map[string]interface{} {
if s == nil {
return nil
}
return s.extraProperties
}
func (s *Squad) require(field *big.Int) {
if s.explicitFields == nil {
s.explicitFields = big.NewInt(0)
}
s.explicitFields.Or(s.explicitFields, field)
}
// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetName(name *string) {
s.Name = name
s.require(squadFieldName)
}
// SetMembers sets the Members field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetMembers(members []*SquadMemberDto) {
s.Members = members
s.require(squadFieldMembers)
}
// SetMembersOverrides sets the MembersOverrides field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetMembersOverrides(membersOverrides *AssistantOverrides) {
s.MembersOverrides = membersOverrides
s.require(squadFieldMembersOverrides)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetId(id string) {
s.Id = id
s.require(squadFieldId)
}
// SetOrgId sets the OrgId field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetOrgId(orgId string) {
s.OrgId = orgId
s.require(squadFieldOrgId)
}
// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetCreatedAt(createdAt time.Time) {
s.CreatedAt = createdAt
s.require(squadFieldCreatedAt)
}
// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (s *Squad) SetUpdatedAt(updatedAt time.Time) {
s.UpdatedAt = updatedAt
s.require(squadFieldUpdatedAt)
}
func (s *Squad) UnmarshalJSON(data []byte) error {
type embed Squad
var unmarshaler = struct {
embed
CreatedAt *internal.DateTime `json:"createdAt"`
UpdatedAt *internal.DateTime `json:"updatedAt"`
}{
embed: embed(*s),
}
if err := json.Unmarshal(data, &unmarshaler); err != nil {
return err
}
*s = Squad(unmarshaler.embed)
s.CreatedAt = unmarshaler.CreatedAt.Time()
s.UpdatedAt = unmarshaler.UpdatedAt.Time()
extraProperties, err := internal.ExtractExtraProperties(data, *s)
if err != nil {
return err
}
s.extraProperties = extraProperties
s.rawJSON = json.RawMessage(data)
return nil
}
func (s *Squad) MarshalJSON() ([]byte, error) {
type embed Squad
var marshaler = struct {
embed
CreatedAt *internal.DateTime `json:"createdAt"`
UpdatedAt *internal.DateTime `json:"updatedAt"`
}{
embed: embed(*s),
CreatedAt: internal.NewDateTime(s.CreatedAt),
UpdatedAt: internal.NewDateTime(s.UpdatedAt),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields)
return json.Marshal(explicitMarshaler)
}
func (s *Squad) String() string {
if s == nil {
return "<nil>"
}
if len(s.rawJSON) > 0 {
if value, err := internal.StringifyJSON(s.rawJSON); err == nil {
return value
}
}
if value, err := internal.StringifyJSON(s); err == nil {
return value
}
return fmt.Sprintf("%#v", s)
}
var (
updateSquadDtoFieldId = big.NewInt(1 << 0)
updateSquadDtoFieldName = big.NewInt(1 << 1)
updateSquadDtoFieldMembers = big.NewInt(1 << 2)
updateSquadDtoFieldMembersOverrides = big.NewInt(1 << 3)
)
type UpdateSquadDto struct {
Id string `json:"-" url:"-"`
// This is the name of the squad.
Name *string `json:"name,omitempty" url:"-"`
// This is the list of assistants that make up the squad.
//
// The call will start with the first assistant in the list.
Members []*SquadMemberDto `json:"members" url:"-"`
// This can be used to override all the assistants' settings and provide values for their template variables.
//
// Both `membersOverrides` and `members[n].assistantOverrides` can be used together. First, `members[n].assistantOverrides` is applied. Then, `membersOverrides` is applied as a global override.
MembersOverrides *AssistantOverrides `json:"membersOverrides,omitempty" url:"-"`
// Private bitmask of fields set to an explicit value and therefore not to be omitted
explicitFields *big.Int `json:"-" url:"-"`
}
func (u *UpdateSquadDto) require(field *big.Int) {
if u.explicitFields == nil {
u.explicitFields = big.NewInt(0)
}
u.explicitFields.Or(u.explicitFields, field)
}
// SetId sets the Id field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSquadDto) SetId(id string) {
u.Id = id
u.require(updateSquadDtoFieldId)
}
// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSquadDto) SetName(name *string) {
u.Name = name
u.require(updateSquadDtoFieldName)
}
// SetMembers sets the Members field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSquadDto) SetMembers(members []*SquadMemberDto) {
u.Members = members
u.require(updateSquadDtoFieldMembers)
}
// SetMembersOverrides sets the MembersOverrides field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (u *UpdateSquadDto) SetMembersOverrides(membersOverrides *AssistantOverrides) {
u.MembersOverrides = membersOverrides
u.require(updateSquadDtoFieldMembersOverrides)
}
func (u *UpdateSquadDto) UnmarshalJSON(data []byte) error {
type unmarshaler UpdateSquadDto
var body unmarshaler
if err := json.Unmarshal(data, &body); err != nil {
return err
}
*u = UpdateSquadDto(body)
return nil
}
func (u *UpdateSquadDto) MarshalJSON() ([]byte, error) {
type embed UpdateSquadDto
var marshaler = struct {
embed
}{
embed: embed(*u),
}
explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields)
return json.Marshal(explicitMarshaler)
}