-
Notifications
You must be signed in to change notification settings - Fork 12
/
callhistoryparticipant.go
293 lines (189 loc) · 7.8 KB
/
callhistoryparticipant.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
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
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Callhistoryparticipant
type Callhistoryparticipant struct {
// Id - The unique participant ID.
Id *string `json:"id,omitempty"`
// Name - The display friendly name of the participant.
Name *string `json:"name,omitempty"`
// Address - The participant address.
Address *string `json:"address,omitempty"`
// StartTime - The time when this participant first joined the conversation. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
StartTime *time.Time `json:"startTime,omitempty"`
// EndTime - The time when this participant went disconnected for this media (eg: video disconnected time). Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
EndTime *time.Time `json:"endTime,omitempty"`
// Purpose - The participant's purpose. Values can be: 'agent', 'user', 'customer', 'external', 'acd', 'ivr
Purpose *string `json:"purpose,omitempty"`
// Direction - The participant's direction. Values can be: 'inbound' or 'outbound'
Direction *string `json:"direction,omitempty"`
// Ani - The call ANI.
Ani *string `json:"ani,omitempty"`
// Dnis - The call DNIS.
Dnis *string `json:"dnis,omitempty"`
// User - The PureCloud user for this participant.
User *User `json:"user,omitempty"`
// Queue - The PureCloud queue for this participant.
Queue *Queue `json:"queue,omitempty"`
// Group - The group involved in the group ring call.
Group *Group `json:"group,omitempty"`
// DisconnectType - The reason the participant was disconnected from the conversation.
DisconnectType *string `json:"disconnectType,omitempty"`
// ExternalContact - The PureCloud external contact
ExternalContact *Externalcontact `json:"externalContact,omitempty"`
// ExternalOrganization - The PureCloud external organization
ExternalOrganization *Externalorganization `json:"externalOrganization,omitempty"`
// DidInteract - Indicates whether the contact ever connected
DidInteract *bool `json:"didInteract,omitempty"`
// SipResponseCodes - Indicates SIP Response codes associated with the participant
SipResponseCodes *[]int `json:"sipResponseCodes,omitempty"`
// FlaggedReason - The reason specifying why participant flagged the conversation.
FlaggedReason *string `json:"flaggedReason,omitempty"`
// OutboundCampaign - The outbound campaign associated with the participant
OutboundCampaign *Campaign `json:"outboundCampaign,omitempty"`
}
func (o *Callhistoryparticipant) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Callhistoryparticipant
StartTime := new(string)
if o.StartTime != nil {
*StartTime = timeutil.Strftime(o.StartTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
StartTime = nil
}
EndTime := new(string)
if o.EndTime != nil {
*EndTime = timeutil.Strftime(o.EndTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
EndTime = nil
}
return json.Marshal(&struct {
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Address *string `json:"address,omitempty"`
StartTime *string `json:"startTime,omitempty"`
EndTime *string `json:"endTime,omitempty"`
Purpose *string `json:"purpose,omitempty"`
Direction *string `json:"direction,omitempty"`
Ani *string `json:"ani,omitempty"`
Dnis *string `json:"dnis,omitempty"`
User *User `json:"user,omitempty"`
Queue *Queue `json:"queue,omitempty"`
Group *Group `json:"group,omitempty"`
DisconnectType *string `json:"disconnectType,omitempty"`
ExternalContact *Externalcontact `json:"externalContact,omitempty"`
ExternalOrganization *Externalorganization `json:"externalOrganization,omitempty"`
DidInteract *bool `json:"didInteract,omitempty"`
SipResponseCodes *[]int `json:"sipResponseCodes,omitempty"`
FlaggedReason *string `json:"flaggedReason,omitempty"`
OutboundCampaign *Campaign `json:"outboundCampaign,omitempty"`
*Alias
}{
Id: o.Id,
Name: o.Name,
Address: o.Address,
StartTime: StartTime,
EndTime: EndTime,
Purpose: o.Purpose,
Direction: o.Direction,
Ani: o.Ani,
Dnis: o.Dnis,
User: o.User,
Queue: o.Queue,
Group: o.Group,
DisconnectType: o.DisconnectType,
ExternalContact: o.ExternalContact,
ExternalOrganization: o.ExternalOrganization,
DidInteract: o.DidInteract,
SipResponseCodes: o.SipResponseCodes,
FlaggedReason: o.FlaggedReason,
OutboundCampaign: o.OutboundCampaign,
Alias: (*Alias)(o),
})
}
func (o *Callhistoryparticipant) UnmarshalJSON(b []byte) error {
var CallhistoryparticipantMap map[string]interface{}
err := json.Unmarshal(b, &CallhistoryparticipantMap)
if err != nil {
return err
}
if Id, ok := CallhistoryparticipantMap["id"].(string); ok {
o.Id = &Id
}
if Name, ok := CallhistoryparticipantMap["name"].(string); ok {
o.Name = &Name
}
if Address, ok := CallhistoryparticipantMap["address"].(string); ok {
o.Address = &Address
}
if startTimeString, ok := CallhistoryparticipantMap["startTime"].(string); ok {
StartTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", startTimeString)
o.StartTime = &StartTime
}
if endTimeString, ok := CallhistoryparticipantMap["endTime"].(string); ok {
EndTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", endTimeString)
o.EndTime = &EndTime
}
if Purpose, ok := CallhistoryparticipantMap["purpose"].(string); ok {
o.Purpose = &Purpose
}
if Direction, ok := CallhistoryparticipantMap["direction"].(string); ok {
o.Direction = &Direction
}
if Ani, ok := CallhistoryparticipantMap["ani"].(string); ok {
o.Ani = &Ani
}
if Dnis, ok := CallhistoryparticipantMap["dnis"].(string); ok {
o.Dnis = &Dnis
}
if User, ok := CallhistoryparticipantMap["user"].(map[string]interface{}); ok {
UserString, _ := json.Marshal(User)
json.Unmarshal(UserString, &o.User)
}
if Queue, ok := CallhistoryparticipantMap["queue"].(map[string]interface{}); ok {
QueueString, _ := json.Marshal(Queue)
json.Unmarshal(QueueString, &o.Queue)
}
if Group, ok := CallhistoryparticipantMap["group"].(map[string]interface{}); ok {
GroupString, _ := json.Marshal(Group)
json.Unmarshal(GroupString, &o.Group)
}
if DisconnectType, ok := CallhistoryparticipantMap["disconnectType"].(string); ok {
o.DisconnectType = &DisconnectType
}
if ExternalContact, ok := CallhistoryparticipantMap["externalContact"].(map[string]interface{}); ok {
ExternalContactString, _ := json.Marshal(ExternalContact)
json.Unmarshal(ExternalContactString, &o.ExternalContact)
}
if ExternalOrganization, ok := CallhistoryparticipantMap["externalOrganization"].(map[string]interface{}); ok {
ExternalOrganizationString, _ := json.Marshal(ExternalOrganization)
json.Unmarshal(ExternalOrganizationString, &o.ExternalOrganization)
}
if DidInteract, ok := CallhistoryparticipantMap["didInteract"].(bool); ok {
o.DidInteract = &DidInteract
}
if SipResponseCodes, ok := CallhistoryparticipantMap["sipResponseCodes"].([]interface{}); ok {
SipResponseCodesString, _ := json.Marshal(SipResponseCodes)
json.Unmarshal(SipResponseCodesString, &o.SipResponseCodes)
}
if FlaggedReason, ok := CallhistoryparticipantMap["flaggedReason"].(string); ok {
o.FlaggedReason = &FlaggedReason
}
if OutboundCampaign, ok := CallhistoryparticipantMap["outboundCampaign"].(map[string]interface{}); ok {
OutboundCampaignString, _ := json.Marshal(OutboundCampaign)
json.Unmarshal(OutboundCampaignString, &o.OutboundCampaign)
}
return nil
}
// String returns a JSON representation of the model
func (o *Callhistoryparticipant) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}