-
Notifications
You must be signed in to change notification settings - Fork 12
/
analyticsconversationsegment.go
365 lines (231 loc) · 11.1 KB
/
analyticsconversationsegment.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
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
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Analyticsconversationsegment
type Analyticsconversationsegment struct {
// AudioMuted - Flag indicating if audio is muted or not (true/false)
AudioMuted *bool `json:"audioMuted,omitempty"`
// Conference - Indicates whether the segment was a conference
Conference *bool `json:"conference,omitempty"`
// DestinationConversationId - The unique identifier of a new conversation when a conversation is ended for a conference
DestinationConversationId *string `json:"destinationConversationId,omitempty"`
// DestinationSessionId - The unique identifier of a new session when a session is ended for a conference
DestinationSessionId *string `json:"destinationSessionId,omitempty"`
// DisconnectType - The session disconnect type
DisconnectType *string `json:"disconnectType,omitempty"`
// ErrorCode - A code corresponding to the error that occurred
ErrorCode *string `json:"errorCode,omitempty"`
// GroupId - Unique identifier for a PureCloud group
GroupId *string `json:"groupId,omitempty"`
// Q850ResponseCodes - Q.850 response code(s)
Q850ResponseCodes *[]int `json:"q850ResponseCodes,omitempty"`
// QueueId - Queue identifier
QueueId *string `json:"queueId,omitempty"`
// RequestedLanguageId - Unique identifier for the language requested for an interaction
RequestedLanguageId *string `json:"requestedLanguageId,omitempty"`
// RequestedRoutingSkillIds - Unique identifier(s) for skill(s) requested for an interaction
RequestedRoutingSkillIds *[]string `json:"requestedRoutingSkillIds,omitempty"`
// RequestedRoutingUserIds - Unique identifier(s) for agent(s) requested for an interaction
RequestedRoutingUserIds *[]string `json:"requestedRoutingUserIds,omitempty"`
// SegmentEnd - The end time of a segment. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
SegmentEnd *time.Time `json:"segmentEnd,omitempty"`
// SegmentStart - The start time of a segment. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
SegmentStart *time.Time `json:"segmentStart,omitempty"`
// SegmentType - The activity that takes place in the segment, such as hold or interact
SegmentType *string `json:"segmentType,omitempty"`
// SipResponseCodes - SIP response code(s)
SipResponseCodes *[]int `json:"sipResponseCodes,omitempty"`
// SourceConversationId - The unique identifier of the previous conversation when a new conversation is created for a conference
SourceConversationId *string `json:"sourceConversationId,omitempty"`
// SourceSessionId - The unique identifier of the previous session when a new session is created for a conference
SourceSessionId *string `json:"sourceSessionId,omitempty"`
// Subject - The subject for the initial email that started this conversation
Subject *string `json:"subject,omitempty"`
// VideoMuted - Flag indicating if video is muted/paused or not (true/false)
VideoMuted *bool `json:"videoMuted,omitempty"`
// WrapUpCode - Wrap up code
WrapUpCode *string `json:"wrapUpCode,omitempty"`
// WrapUpNote - Note entered by an agent during after-call work
WrapUpNote *string `json:"wrapUpNote,omitempty"`
// WrapUpTags - Tag(s) assigned during after-call work
WrapUpTags *[]string `json:"wrapUpTags,omitempty"`
// ScoredAgents - Scored agents
ScoredAgents *[]Analyticsscoredagent `json:"scoredAgents,omitempty"`
// Properties - Additional segment properties
Properties *[]Analyticsproperty `json:"properties,omitempty"`
}
func (o *Analyticsconversationsegment) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Analyticsconversationsegment
SegmentEnd := new(string)
if o.SegmentEnd != nil {
*SegmentEnd = timeutil.Strftime(o.SegmentEnd, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
SegmentEnd = nil
}
SegmentStart := new(string)
if o.SegmentStart != nil {
*SegmentStart = timeutil.Strftime(o.SegmentStart, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
SegmentStart = nil
}
return json.Marshal(&struct {
AudioMuted *bool `json:"audioMuted,omitempty"`
Conference *bool `json:"conference,omitempty"`
DestinationConversationId *string `json:"destinationConversationId,omitempty"`
DestinationSessionId *string `json:"destinationSessionId,omitempty"`
DisconnectType *string `json:"disconnectType,omitempty"`
ErrorCode *string `json:"errorCode,omitempty"`
GroupId *string `json:"groupId,omitempty"`
Q850ResponseCodes *[]int `json:"q850ResponseCodes,omitempty"`
QueueId *string `json:"queueId,omitempty"`
RequestedLanguageId *string `json:"requestedLanguageId,omitempty"`
RequestedRoutingSkillIds *[]string `json:"requestedRoutingSkillIds,omitempty"`
RequestedRoutingUserIds *[]string `json:"requestedRoutingUserIds,omitempty"`
SegmentEnd *string `json:"segmentEnd,omitempty"`
SegmentStart *string `json:"segmentStart,omitempty"`
SegmentType *string `json:"segmentType,omitempty"`
SipResponseCodes *[]int `json:"sipResponseCodes,omitempty"`
SourceConversationId *string `json:"sourceConversationId,omitempty"`
SourceSessionId *string `json:"sourceSessionId,omitempty"`
Subject *string `json:"subject,omitempty"`
VideoMuted *bool `json:"videoMuted,omitempty"`
WrapUpCode *string `json:"wrapUpCode,omitempty"`
WrapUpNote *string `json:"wrapUpNote,omitempty"`
WrapUpTags *[]string `json:"wrapUpTags,omitempty"`
ScoredAgents *[]Analyticsscoredagent `json:"scoredAgents,omitempty"`
Properties *[]Analyticsproperty `json:"properties,omitempty"`
*Alias
}{
AudioMuted: o.AudioMuted,
Conference: o.Conference,
DestinationConversationId: o.DestinationConversationId,
DestinationSessionId: o.DestinationSessionId,
DisconnectType: o.DisconnectType,
ErrorCode: o.ErrorCode,
GroupId: o.GroupId,
Q850ResponseCodes: o.Q850ResponseCodes,
QueueId: o.QueueId,
RequestedLanguageId: o.RequestedLanguageId,
RequestedRoutingSkillIds: o.RequestedRoutingSkillIds,
RequestedRoutingUserIds: o.RequestedRoutingUserIds,
SegmentEnd: SegmentEnd,
SegmentStart: SegmentStart,
SegmentType: o.SegmentType,
SipResponseCodes: o.SipResponseCodes,
SourceConversationId: o.SourceConversationId,
SourceSessionId: o.SourceSessionId,
Subject: o.Subject,
VideoMuted: o.VideoMuted,
WrapUpCode: o.WrapUpCode,
WrapUpNote: o.WrapUpNote,
WrapUpTags: o.WrapUpTags,
ScoredAgents: o.ScoredAgents,
Properties: o.Properties,
Alias: (*Alias)(o),
})
}
func (o *Analyticsconversationsegment) UnmarshalJSON(b []byte) error {
var AnalyticsconversationsegmentMap map[string]interface{}
err := json.Unmarshal(b, &AnalyticsconversationsegmentMap)
if err != nil {
return err
}
if AudioMuted, ok := AnalyticsconversationsegmentMap["audioMuted"].(bool); ok {
o.AudioMuted = &AudioMuted
}
if Conference, ok := AnalyticsconversationsegmentMap["conference"].(bool); ok {
o.Conference = &Conference
}
if DestinationConversationId, ok := AnalyticsconversationsegmentMap["destinationConversationId"].(string); ok {
o.DestinationConversationId = &DestinationConversationId
}
if DestinationSessionId, ok := AnalyticsconversationsegmentMap["destinationSessionId"].(string); ok {
o.DestinationSessionId = &DestinationSessionId
}
if DisconnectType, ok := AnalyticsconversationsegmentMap["disconnectType"].(string); ok {
o.DisconnectType = &DisconnectType
}
if ErrorCode, ok := AnalyticsconversationsegmentMap["errorCode"].(string); ok {
o.ErrorCode = &ErrorCode
}
if GroupId, ok := AnalyticsconversationsegmentMap["groupId"].(string); ok {
o.GroupId = &GroupId
}
if Q850ResponseCodes, ok := AnalyticsconversationsegmentMap["q850ResponseCodes"].([]interface{}); ok {
Q850ResponseCodesString, _ := json.Marshal(Q850ResponseCodes)
json.Unmarshal(Q850ResponseCodesString, &o.Q850ResponseCodes)
}
if QueueId, ok := AnalyticsconversationsegmentMap["queueId"].(string); ok {
o.QueueId = &QueueId
}
if RequestedLanguageId, ok := AnalyticsconversationsegmentMap["requestedLanguageId"].(string); ok {
o.RequestedLanguageId = &RequestedLanguageId
}
if RequestedRoutingSkillIds, ok := AnalyticsconversationsegmentMap["requestedRoutingSkillIds"].([]interface{}); ok {
RequestedRoutingSkillIdsString, _ := json.Marshal(RequestedRoutingSkillIds)
json.Unmarshal(RequestedRoutingSkillIdsString, &o.RequestedRoutingSkillIds)
}
if RequestedRoutingUserIds, ok := AnalyticsconversationsegmentMap["requestedRoutingUserIds"].([]interface{}); ok {
RequestedRoutingUserIdsString, _ := json.Marshal(RequestedRoutingUserIds)
json.Unmarshal(RequestedRoutingUserIdsString, &o.RequestedRoutingUserIds)
}
if segmentEndString, ok := AnalyticsconversationsegmentMap["segmentEnd"].(string); ok {
SegmentEnd, _ := time.Parse("2006-01-02T15:04:05.999999Z", segmentEndString)
o.SegmentEnd = &SegmentEnd
}
if segmentStartString, ok := AnalyticsconversationsegmentMap["segmentStart"].(string); ok {
SegmentStart, _ := time.Parse("2006-01-02T15:04:05.999999Z", segmentStartString)
o.SegmentStart = &SegmentStart
}
if SegmentType, ok := AnalyticsconversationsegmentMap["segmentType"].(string); ok {
o.SegmentType = &SegmentType
}
if SipResponseCodes, ok := AnalyticsconversationsegmentMap["sipResponseCodes"].([]interface{}); ok {
SipResponseCodesString, _ := json.Marshal(SipResponseCodes)
json.Unmarshal(SipResponseCodesString, &o.SipResponseCodes)
}
if SourceConversationId, ok := AnalyticsconversationsegmentMap["sourceConversationId"].(string); ok {
o.SourceConversationId = &SourceConversationId
}
if SourceSessionId, ok := AnalyticsconversationsegmentMap["sourceSessionId"].(string); ok {
o.SourceSessionId = &SourceSessionId
}
if Subject, ok := AnalyticsconversationsegmentMap["subject"].(string); ok {
o.Subject = &Subject
}
if VideoMuted, ok := AnalyticsconversationsegmentMap["videoMuted"].(bool); ok {
o.VideoMuted = &VideoMuted
}
if WrapUpCode, ok := AnalyticsconversationsegmentMap["wrapUpCode"].(string); ok {
o.WrapUpCode = &WrapUpCode
}
if WrapUpNote, ok := AnalyticsconversationsegmentMap["wrapUpNote"].(string); ok {
o.WrapUpNote = &WrapUpNote
}
if WrapUpTags, ok := AnalyticsconversationsegmentMap["wrapUpTags"].([]interface{}); ok {
WrapUpTagsString, _ := json.Marshal(WrapUpTags)
json.Unmarshal(WrapUpTagsString, &o.WrapUpTags)
}
if ScoredAgents, ok := AnalyticsconversationsegmentMap["scoredAgents"].([]interface{}); ok {
ScoredAgentsString, _ := json.Marshal(ScoredAgents)
json.Unmarshal(ScoredAgentsString, &o.ScoredAgents)
}
if Properties, ok := AnalyticsconversationsegmentMap["properties"].([]interface{}); ok {
PropertiesString, _ := json.Marshal(Properties)
json.Unmarshal(PropertiesString, &o.Properties)
}
return nil
}
// String returns a JSON representation of the model
func (o *Analyticsconversationsegment) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}