-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsquads.go
171 lines (154 loc) · 5.39 KB
/
squads.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 api
import (
json "encoding/json"
fmt "fmt"
internal "github.com/VapiAI/server-sdk-go/internal"
time "time"
)
type SquadsListRequest 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"`
}
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,omitempty" url:"members,omitempty"`
// 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"`
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{} {
return s.extraProperties
}
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),
}
return json.Marshal(marshaler)
}
func (s *Squad) String() string {
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)
}
type UpdateSquadDto struct {
// 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,omitempty" 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:"-"`
}