forked from MyPureCloud/platform-client-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
participantbasic.go
652 lines (407 loc) · 17.8 KB
/
participantbasic.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
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Participantbasic
type Participantbasic struct {
// Id - A globally unique identifier for this conversation.
Id *string `json:"id"`
// StartTime - The timestamp when this participant joined the conversation in the provider clock. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
StartTime *time.Time `json:"startTime"`
// EndTime - The timestamp when this participant disconnected from the conversation in the provider clock. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
EndTime *time.Time `json:"endTime"`
// ConnectedTime - The timestamp when this participant was connected to the conversation in the provider clock. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
ConnectedTime *time.Time `json:"connectedTime"`
// Name - A human readable name identifying the participant.
Name *string `json:"name"`
// UserUri - If this participant represents a user, then this will be an URI that can be used to fetch the user.
UserUri *string `json:"userUri"`
// UserId - If this participant represents a user, then this will be the globally unique identifier for the user.
UserId *string `json:"userId"`
// ExternalContactId - If this participant represents an external contact, then this will be the globally unique identifier for the external contact.
ExternalContactId *string `json:"externalContactId"`
// ExternalOrganizationId - If this participant represents an external org, then this will be the globally unique identifier for the external org.
ExternalOrganizationId *string `json:"externalOrganizationId"`
// QueueId - If present, the queue id that the communication channel came in on.
QueueId *string `json:"queueId"`
// GroupId - If present, group of users the participant represents.
GroupId *string `json:"groupId"`
// TeamId - The team id that this participant is a member of when added to the conversation.
TeamId *string `json:"teamId"`
// QueueName - If present, the queue name that the communication channel came in on.
QueueName *string `json:"queueName"`
// Purpose - A well known string that specifies the purpose of this participant.
Purpose *string `json:"purpose"`
// ParticipantType - A well known string that specifies the type of this participant.
ParticipantType *string `json:"participantType"`
// ConsultParticipantId - If this participant is part of a consult transfer, then this will be the participant id of the participant being transferred.
ConsultParticipantId *string `json:"consultParticipantId"`
// Address - The address for the this participant. For a phone call this will be the ANI.
Address *string `json:"address"`
// Ani - The address for the this participant. For a phone call this will be the ANI.
Ani *string `json:"ani"`
// AniName - The ani-based name for this participant.
AniName *string `json:"aniName"`
// Dnis - The address for the this participant. For a phone call this will be the ANI.
Dnis *string `json:"dnis"`
// Locale - An ISO 639 language code specifying the locale for this participant
Locale *string `json:"locale"`
// WrapupRequired - True iff this participant is required to enter wrapup for this conversation.
WrapupRequired *bool `json:"wrapupRequired"`
// WrapupPrompt - This field controls how the UI prompts the agent for a wrapup.
WrapupPrompt *string `json:"wrapupPrompt"`
// WrapupTimeoutMs - Specifies how long a timed ACW session will last.
WrapupTimeoutMs *int `json:"wrapupTimeoutMs"`
// WrapupSkipped - The UI sets this field when the agent chooses to skip entering a wrapup for this participant.
WrapupSkipped *bool `json:"wrapupSkipped"`
// Wrapup - Call wrap up or disposition data.
Wrapup *Wrapup `json:"wrapup"`
// ConversationRoutingData - Information on how a communication should be routed to an agent.
ConversationRoutingData *Conversationroutingdata `json:"conversationRoutingData"`
// AlertingTimeoutMs - Specifies how long the agent has to answer an interaction before being marked as not responding.
AlertingTimeoutMs *int `json:"alertingTimeoutMs"`
// MonitoredParticipantId - If this participant is a monitor, then this will be the id of the participant that is being monitored.
MonitoredParticipantId *string `json:"monitoredParticipantId"`
// CoachedParticipantId - If this participant is a coach, then this will be the id of the participant that is being coached.
CoachedParticipantId *string `json:"coachedParticipantId"`
// Attributes - Additional participant attributes
Attributes *map[string]string `json:"attributes"`
// Calls
Calls *[]Callbasic `json:"calls"`
// Callbacks
Callbacks *[]Callbackbasic `json:"callbacks"`
// Chats
Chats *[]Conversationchat `json:"chats"`
// Cobrowsesessions
Cobrowsesessions *[]Cobrowsesession `json:"cobrowsesessions"`
// Emails
Emails *[]Email `json:"emails"`
// Messages
Messages *[]Message `json:"messages"`
// Screenshares
Screenshares *[]Screenshare `json:"screenshares"`
// SocialExpressions
SocialExpressions *[]Socialexpression `json:"socialExpressions"`
// Videos
Videos *[]Video `json:"videos"`
// Evaluations
Evaluations *[]Evaluation `json:"evaluations"`
// ScreenRecordingState - The current screen recording state for this participant.
ScreenRecordingState *string `json:"screenRecordingState"`
// FlaggedReason - The reason specifying why participant flagged the conversation.
FlaggedReason *string `json:"flaggedReason"`
// StartAcwTime - The timestamp when this participant started after-call work. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
StartAcwTime *time.Time `json:"startAcwTime"`
// EndAcwTime - The timestamp when this participant ended after-call work. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
EndAcwTime *time.Time `json:"endAcwTime"`
// BargedParticipantId - If this participant barged in a participant's call, then this will be the id of the targeted participant.
BargedParticipantId *string `json:"bargedParticipantId"`
}
func (o *Participantbasic) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Participantbasic
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
}
ConnectedTime := new(string)
if o.ConnectedTime != nil {
*ConnectedTime = timeutil.Strftime(o.ConnectedTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
ConnectedTime = nil
}
StartAcwTime := new(string)
if o.StartAcwTime != nil {
*StartAcwTime = timeutil.Strftime(o.StartAcwTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
StartAcwTime = nil
}
EndAcwTime := new(string)
if o.EndAcwTime != nil {
*EndAcwTime = timeutil.Strftime(o.EndAcwTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
EndAcwTime = nil
}
return json.Marshal(&struct {
Id *string `json:"id"`
StartTime *string `json:"startTime"`
EndTime *string `json:"endTime"`
ConnectedTime *string `json:"connectedTime"`
Name *string `json:"name"`
UserUri *string `json:"userUri"`
UserId *string `json:"userId"`
ExternalContactId *string `json:"externalContactId"`
ExternalOrganizationId *string `json:"externalOrganizationId"`
QueueId *string `json:"queueId"`
GroupId *string `json:"groupId"`
TeamId *string `json:"teamId"`
QueueName *string `json:"queueName"`
Purpose *string `json:"purpose"`
ParticipantType *string `json:"participantType"`
ConsultParticipantId *string `json:"consultParticipantId"`
Address *string `json:"address"`
Ani *string `json:"ani"`
AniName *string `json:"aniName"`
Dnis *string `json:"dnis"`
Locale *string `json:"locale"`
WrapupRequired *bool `json:"wrapupRequired"`
WrapupPrompt *string `json:"wrapupPrompt"`
WrapupTimeoutMs *int `json:"wrapupTimeoutMs"`
WrapupSkipped *bool `json:"wrapupSkipped"`
Wrapup *Wrapup `json:"wrapup"`
ConversationRoutingData *Conversationroutingdata `json:"conversationRoutingData"`
AlertingTimeoutMs *int `json:"alertingTimeoutMs"`
MonitoredParticipantId *string `json:"monitoredParticipantId"`
CoachedParticipantId *string `json:"coachedParticipantId"`
Attributes *map[string]string `json:"attributes"`
Calls *[]Callbasic `json:"calls"`
Callbacks *[]Callbackbasic `json:"callbacks"`
Chats *[]Conversationchat `json:"chats"`
Cobrowsesessions *[]Cobrowsesession `json:"cobrowsesessions"`
Emails *[]Email `json:"emails"`
Messages *[]Message `json:"messages"`
Screenshares *[]Screenshare `json:"screenshares"`
SocialExpressions *[]Socialexpression `json:"socialExpressions"`
Videos *[]Video `json:"videos"`
Evaluations *[]Evaluation `json:"evaluations"`
ScreenRecordingState *string `json:"screenRecordingState"`
FlaggedReason *string `json:"flaggedReason"`
StartAcwTime *string `json:"startAcwTime"`
EndAcwTime *string `json:"endAcwTime"`
BargedParticipantId *string `json:"bargedParticipantId"`
*Alias
}{
Id: o.Id,
StartTime: StartTime,
EndTime: EndTime,
ConnectedTime: ConnectedTime,
Name: o.Name,
UserUri: o.UserUri,
UserId: o.UserId,
ExternalContactId: o.ExternalContactId,
ExternalOrganizationId: o.ExternalOrganizationId,
QueueId: o.QueueId,
GroupId: o.GroupId,
TeamId: o.TeamId,
QueueName: o.QueueName,
Purpose: o.Purpose,
ParticipantType: o.ParticipantType,
ConsultParticipantId: o.ConsultParticipantId,
Address: o.Address,
Ani: o.Ani,
AniName: o.AniName,
Dnis: o.Dnis,
Locale: o.Locale,
WrapupRequired: o.WrapupRequired,
WrapupPrompt: o.WrapupPrompt,
WrapupTimeoutMs: o.WrapupTimeoutMs,
WrapupSkipped: o.WrapupSkipped,
Wrapup: o.Wrapup,
ConversationRoutingData: o.ConversationRoutingData,
AlertingTimeoutMs: o.AlertingTimeoutMs,
MonitoredParticipantId: o.MonitoredParticipantId,
CoachedParticipantId: o.CoachedParticipantId,
Attributes: o.Attributes,
Calls: o.Calls,
Callbacks: o.Callbacks,
Chats: o.Chats,
Cobrowsesessions: o.Cobrowsesessions,
Emails: o.Emails,
Messages: o.Messages,
Screenshares: o.Screenshares,
SocialExpressions: o.SocialExpressions,
Videos: o.Videos,
Evaluations: o.Evaluations,
ScreenRecordingState: o.ScreenRecordingState,
FlaggedReason: o.FlaggedReason,
StartAcwTime: StartAcwTime,
EndAcwTime: EndAcwTime,
BargedParticipantId: o.BargedParticipantId,
Alias: (*Alias)(o),
})
}
func (o *Participantbasic) UnmarshalJSON(b []byte) error {
var ParticipantbasicMap map[string]interface{}
err := json.Unmarshal(b, &ParticipantbasicMap)
if err != nil {
return err
}
if Id, ok := ParticipantbasicMap["id"].(string); ok {
o.Id = &Id
}
if startTimeString, ok := ParticipantbasicMap["startTime"].(string); ok {
StartTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", startTimeString)
o.StartTime = &StartTime
}
if endTimeString, ok := ParticipantbasicMap["endTime"].(string); ok {
EndTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", endTimeString)
o.EndTime = &EndTime
}
if connectedTimeString, ok := ParticipantbasicMap["connectedTime"].(string); ok {
ConnectedTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", connectedTimeString)
o.ConnectedTime = &ConnectedTime
}
if Name, ok := ParticipantbasicMap["name"].(string); ok {
o.Name = &Name
}
if UserUri, ok := ParticipantbasicMap["userUri"].(string); ok {
o.UserUri = &UserUri
}
if UserId, ok := ParticipantbasicMap["userId"].(string); ok {
o.UserId = &UserId
}
if ExternalContactId, ok := ParticipantbasicMap["externalContactId"].(string); ok {
o.ExternalContactId = &ExternalContactId
}
if ExternalOrganizationId, ok := ParticipantbasicMap["externalOrganizationId"].(string); ok {
o.ExternalOrganizationId = &ExternalOrganizationId
}
if QueueId, ok := ParticipantbasicMap["queueId"].(string); ok {
o.QueueId = &QueueId
}
if GroupId, ok := ParticipantbasicMap["groupId"].(string); ok {
o.GroupId = &GroupId
}
if TeamId, ok := ParticipantbasicMap["teamId"].(string); ok {
o.TeamId = &TeamId
}
if QueueName, ok := ParticipantbasicMap["queueName"].(string); ok {
o.QueueName = &QueueName
}
if Purpose, ok := ParticipantbasicMap["purpose"].(string); ok {
o.Purpose = &Purpose
}
if ParticipantType, ok := ParticipantbasicMap["participantType"].(string); ok {
o.ParticipantType = &ParticipantType
}
if ConsultParticipantId, ok := ParticipantbasicMap["consultParticipantId"].(string); ok {
o.ConsultParticipantId = &ConsultParticipantId
}
if Address, ok := ParticipantbasicMap["address"].(string); ok {
o.Address = &Address
}
if Ani, ok := ParticipantbasicMap["ani"].(string); ok {
o.Ani = &Ani
}
if AniName, ok := ParticipantbasicMap["aniName"].(string); ok {
o.AniName = &AniName
}
if Dnis, ok := ParticipantbasicMap["dnis"].(string); ok {
o.Dnis = &Dnis
}
if Locale, ok := ParticipantbasicMap["locale"].(string); ok {
o.Locale = &Locale
}
if WrapupRequired, ok := ParticipantbasicMap["wrapupRequired"].(bool); ok {
o.WrapupRequired = &WrapupRequired
}
if WrapupPrompt, ok := ParticipantbasicMap["wrapupPrompt"].(string); ok {
o.WrapupPrompt = &WrapupPrompt
}
if WrapupTimeoutMs, ok := ParticipantbasicMap["wrapupTimeoutMs"].(float64); ok {
WrapupTimeoutMsInt := int(WrapupTimeoutMs)
o.WrapupTimeoutMs = &WrapupTimeoutMsInt
}
if WrapupSkipped, ok := ParticipantbasicMap["wrapupSkipped"].(bool); ok {
o.WrapupSkipped = &WrapupSkipped
}
if Wrapup, ok := ParticipantbasicMap["wrapup"].(map[string]interface{}); ok {
WrapupString, _ := json.Marshal(Wrapup)
json.Unmarshal(WrapupString, &o.Wrapup)
}
if ConversationRoutingData, ok := ParticipantbasicMap["conversationRoutingData"].(map[string]interface{}); ok {
ConversationRoutingDataString, _ := json.Marshal(ConversationRoutingData)
json.Unmarshal(ConversationRoutingDataString, &o.ConversationRoutingData)
}
if AlertingTimeoutMs, ok := ParticipantbasicMap["alertingTimeoutMs"].(float64); ok {
AlertingTimeoutMsInt := int(AlertingTimeoutMs)
o.AlertingTimeoutMs = &AlertingTimeoutMsInt
}
if MonitoredParticipantId, ok := ParticipantbasicMap["monitoredParticipantId"].(string); ok {
o.MonitoredParticipantId = &MonitoredParticipantId
}
if CoachedParticipantId, ok := ParticipantbasicMap["coachedParticipantId"].(string); ok {
o.CoachedParticipantId = &CoachedParticipantId
}
if Attributes, ok := ParticipantbasicMap["attributes"].(map[string]interface{}); ok {
AttributesString, _ := json.Marshal(Attributes)
json.Unmarshal(AttributesString, &o.Attributes)
}
if Calls, ok := ParticipantbasicMap["calls"].([]interface{}); ok {
CallsString, _ := json.Marshal(Calls)
json.Unmarshal(CallsString, &o.Calls)
}
if Callbacks, ok := ParticipantbasicMap["callbacks"].([]interface{}); ok {
CallbacksString, _ := json.Marshal(Callbacks)
json.Unmarshal(CallbacksString, &o.Callbacks)
}
if Chats, ok := ParticipantbasicMap["chats"].([]interface{}); ok {
ChatsString, _ := json.Marshal(Chats)
json.Unmarshal(ChatsString, &o.Chats)
}
if Cobrowsesessions, ok := ParticipantbasicMap["cobrowsesessions"].([]interface{}); ok {
CobrowsesessionsString, _ := json.Marshal(Cobrowsesessions)
json.Unmarshal(CobrowsesessionsString, &o.Cobrowsesessions)
}
if Emails, ok := ParticipantbasicMap["emails"].([]interface{}); ok {
EmailsString, _ := json.Marshal(Emails)
json.Unmarshal(EmailsString, &o.Emails)
}
if Messages, ok := ParticipantbasicMap["messages"].([]interface{}); ok {
MessagesString, _ := json.Marshal(Messages)
json.Unmarshal(MessagesString, &o.Messages)
}
if Screenshares, ok := ParticipantbasicMap["screenshares"].([]interface{}); ok {
ScreensharesString, _ := json.Marshal(Screenshares)
json.Unmarshal(ScreensharesString, &o.Screenshares)
}
if SocialExpressions, ok := ParticipantbasicMap["socialExpressions"].([]interface{}); ok {
SocialExpressionsString, _ := json.Marshal(SocialExpressions)
json.Unmarshal(SocialExpressionsString, &o.SocialExpressions)
}
if Videos, ok := ParticipantbasicMap["videos"].([]interface{}); ok {
VideosString, _ := json.Marshal(Videos)
json.Unmarshal(VideosString, &o.Videos)
}
if Evaluations, ok := ParticipantbasicMap["evaluations"].([]interface{}); ok {
EvaluationsString, _ := json.Marshal(Evaluations)
json.Unmarshal(EvaluationsString, &o.Evaluations)
}
if ScreenRecordingState, ok := ParticipantbasicMap["screenRecordingState"].(string); ok {
o.ScreenRecordingState = &ScreenRecordingState
}
if FlaggedReason, ok := ParticipantbasicMap["flaggedReason"].(string); ok {
o.FlaggedReason = &FlaggedReason
}
if startAcwTimeString, ok := ParticipantbasicMap["startAcwTime"].(string); ok {
StartAcwTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", startAcwTimeString)
o.StartAcwTime = &StartAcwTime
}
if endAcwTimeString, ok := ParticipantbasicMap["endAcwTime"].(string); ok {
EndAcwTime, _ := time.Parse("2006-01-02T15:04:05.999999Z", endAcwTimeString)
o.EndAcwTime = &EndAcwTime
}
if BargedParticipantId, ok := ParticipantbasicMap["bargedParticipantId"].(string); ok {
o.BargedParticipantId = &BargedParticipantId
}
return nil
}
// String returns a JSON representation of the model
func (o *Participantbasic) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}