purecloudplatformclientv2 27.1.0 → 28.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/AdditionalMessage.md +13 -0
  4. data/docs/AnalyticsParticipant.md +1 -0
  5. data/docs/ArchitectApi.md +40 -28
  6. data/docs/Attachment.md +5 -5
  7. data/docs/ConversationNotificationAttachment.md +18 -0
  8. data/docs/ConversationNotificationDraftAttachments.md +18 -0
  9. data/docs/ConversationNotificationEmail.md +1 -0
  10. data/docs/ConversationNotificationEmails.md +1 -0
  11. data/docs/ConversationsApi.md +964 -198
  12. data/docs/DataTable.md +17 -0
  13. data/docs/DataTableRowEntityListing.md +22 -0
  14. data/docs/DataTablesDomainEntityListing.md +22 -0
  15. data/docs/Document.md +1 -1
  16. data/docs/DomainEdgeSoftwareVersionDto.md +1 -1
  17. data/docs/DomainOrganizationRole.md +1 -1
  18. data/docs/DomainOrganizationRoleCreate.md +1 -1
  19. data/docs/DomainOrganizationRoleUpdate.md +1 -1
  20. data/docs/Email.md +1 -0
  21. data/docs/EmailConversationNotificationAttachment.md +18 -0
  22. data/docs/EmailConversationNotificationEmailMediaParticipant.md +1 -0
  23. data/docs/EmailConversationNotificationParticipants.md +1 -0
  24. data/docs/EmailMediaParticipant.md +1 -0
  25. data/docs/FaxDocument.md +1 -1
  26. data/docs/JsonNode.md +4 -4
  27. data/docs/MessageConversation.md +17 -0
  28. data/docs/MessageConversationEntityListing.md +22 -0
  29. data/docs/MessageData.md +25 -0
  30. data/docs/MessageMediaParticipant.md +44 -0
  31. data/docs/Question.md +1 -1
  32. data/docs/Recipient.md +20 -0
  33. data/docs/RecipientListing.md +22 -0
  34. data/docs/RoutingApi.md +632 -0
  35. data/docs/SMSAvailablePhoneNumberEntityListing.md +13 -0
  36. data/docs/SmsAddressProvision.md +21 -0
  37. data/docs/SmsAvailablePhoneNumber.md +22 -0
  38. data/docs/SmsPhoneNumber.md +25 -0
  39. data/docs/SmsPhoneNumberEntityListing.md +22 -0
  40. data/docs/SmsPhoneNumberProvision.md +18 -0
  41. data/docs/TextMessageListing.md +22 -0
  42. data/lib/purecloudplatformclientv2.rb +20 -0
  43. data/lib/purecloudplatformclientv2/api/architect_api.rb +108 -34
  44. data/lib/purecloudplatformclientv2/api/conversations_api.rb +1247 -317
  45. data/lib/purecloudplatformclientv2/api/routing_api.rb +829 -43
  46. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  47. data/lib/purecloudplatformclientv2/models/additional_message.rb +207 -0
  48. data/lib/purecloudplatformclientv2/models/aggregate_metric_data.rb +2 -2
  49. data/lib/purecloudplatformclientv2/models/analytics_participant.rb +41 -1
  50. data/lib/purecloudplatformclientv2/models/analytics_query_predicate.rb +4 -4
  51. data/lib/purecloudplatformclientv2/models/attachment.rb +5 -0
  52. data/lib/purecloudplatformclientv2/models/conversation_notification_attachment.rb +326 -0
  53. data/lib/purecloudplatformclientv2/models/conversation_notification_draft_attachments.rb +326 -0
  54. data/lib/purecloudplatformclientv2/models/conversation_notification_email.rb +28 -1
  55. data/lib/purecloudplatformclientv2/models/conversation_notification_emails.rb +28 -1
  56. data/lib/purecloudplatformclientv2/models/data_table.rb +306 -0
  57. data/lib/purecloudplatformclientv2/models/data_table_row_entity_listing.rb +428 -0
  58. data/lib/purecloudplatformclientv2/models/data_tables_domain_entity_listing.rb +428 -0
  59. data/lib/purecloudplatformclientv2/models/document.rb +12 -12
  60. data/lib/purecloudplatformclientv2/models/domain_edge_software_version_dto.rb +12 -12
  61. data/lib/purecloudplatformclientv2/models/domain_organization_role.rb +12 -12
  62. data/lib/purecloudplatformclientv2/models/domain_organization_role_create.rb +12 -12
  63. data/lib/purecloudplatformclientv2/models/domain_organization_role_update.rb +12 -12
  64. data/lib/purecloudplatformclientv2/models/email.rb +32 -4
  65. data/lib/purecloudplatformclientv2/models/email_conversation_notification_attachment.rb +326 -0
  66. data/lib/purecloudplatformclientv2/models/email_conversation_notification_email_media_participant.rb +31 -4
  67. data/lib/purecloudplatformclientv2/models/email_conversation_notification_participants.rb +31 -4
  68. data/lib/purecloudplatformclientv2/models/email_media_participant.rb +32 -4
  69. data/lib/purecloudplatformclientv2/models/fax_document.rb +12 -12
  70. data/lib/purecloudplatformclientv2/models/json_node.rb +72 -72
  71. data/lib/purecloudplatformclientv2/models/message_conversation.rb +309 -0
  72. data/lib/purecloudplatformclientv2/models/message_conversation_entity_listing.rb +428 -0
  73. data/lib/purecloudplatformclientv2/models/message_data.rb +572 -0
  74. data/lib/purecloudplatformclientv2/models/message_media_participant.rb +1068 -0
  75. data/lib/purecloudplatformclientv2/models/question.rb +13 -13
  76. data/lib/purecloudplatformclientv2/models/recipient.rb +383 -0
  77. data/lib/purecloudplatformclientv2/models/recipient_listing.rb +428 -0
  78. data/lib/purecloudplatformclientv2/models/sms_address_provision.rb +440 -0
  79. data/lib/purecloudplatformclientv2/models/sms_available_phone_number.rb +465 -0
  80. data/lib/purecloudplatformclientv2/models/sms_available_phone_number_entity_listing.rb +203 -0
  81. data/lib/purecloudplatformclientv2/models/sms_phone_number.rb +546 -0
  82. data/lib/purecloudplatformclientv2/models/sms_phone_number_entity_listing.rb +428 -0
  83. data/lib/purecloudplatformclientv2/models/sms_phone_number_provision.rb +360 -0
  84. data/lib/purecloudplatformclientv2/models/text_message_listing.rb +428 -0
  85. data/lib/purecloudplatformclientv2/version.rb +1 -1
  86. metadata +42 -2
@@ -0,0 +1,1068 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@genesys.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class MessageMediaParticipant
21
+ # The unique participant ID.
22
+ attr_accessor :id
23
+
24
+ # The display friendly name of the participant.
25
+ attr_accessor :name
26
+
27
+ # The participant address.
28
+ attr_accessor :address
29
+
30
+ # 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.SSSZ
31
+ attr_accessor :start_time
32
+
33
+ # The time when this participant went connected for this media (eg: video connected time). Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
34
+ attr_accessor :connected_time
35
+
36
+ # 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.SSSZ
37
+ attr_accessor :end_time
38
+
39
+ # The time when this participant's hold started. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
40
+ attr_accessor :start_hold_time
41
+
42
+ # The participant's purpose. Values can be: 'agent', 'user', 'customer', 'external', 'acd', 'ivr
43
+ attr_accessor :purpose
44
+
45
+ # The participant's state. Values can be: 'alerting', 'connected', 'disconnected', 'dialing', 'contacting
46
+ attr_accessor :state
47
+
48
+ # The participant's direction. Values can be: 'inbound' or 'outbound'
49
+ attr_accessor :direction
50
+
51
+ # The reason the participant was disconnected from the conversation.
52
+ attr_accessor :disconnect_type
53
+
54
+ # Value is true when the participant is on hold.
55
+ attr_accessor :held
56
+
57
+ # Value is true when the participant requires wrap-up.
58
+ attr_accessor :wrapup_required
59
+
60
+ # The wrap-up prompt indicating the type of wrap-up to be performed.
61
+ attr_accessor :wrapup_prompt
62
+
63
+ # The PureCloud user for this participant.
64
+ attr_accessor :user
65
+
66
+ # The PureCloud queue for this participant.
67
+ attr_accessor :queue
68
+
69
+ # A list of ad-hoc attributes for the participant.
70
+ attr_accessor :attributes
71
+
72
+ # If the conversation ends in error, contains additional error details.
73
+ attr_accessor :error_info
74
+
75
+ # The Engage script that should be used by this participant.
76
+ attr_accessor :script
77
+
78
+ # The amount of time the participant has to complete wrap-up.
79
+ attr_accessor :wrapup_timeout_ms
80
+
81
+ # Value is true when the participant has skipped wrap-up.
82
+ attr_accessor :wrapup_skipped
83
+
84
+ # The source provider for the communication.
85
+ attr_accessor :provider
86
+
87
+ # If this participant represents an external contact, then this will be the reference for the external contact.
88
+ attr_accessor :external_contact
89
+
90
+ # If this participant represents an external org, then this will be the reference for the external org.
91
+ attr_accessor :external_organization
92
+
93
+ # Wrapup for this participant, if it has been applied.
94
+ attr_accessor :wrapup
95
+
96
+ # The peer communication corresponding to a matching leg for this communication.
97
+ attr_accessor :peer
98
+
99
+ # Address for the participant on receiving side of the message conversation. If the address is a phone number, E.164 format is recommended.
100
+ attr_accessor :to_address
101
+
102
+ # Address for the participant on the sending side of the message conversation. If the address is a phone number, E.164 format is recommended.
103
+ attr_accessor :from_address
104
+
105
+ # Message instance details on the communication.
106
+ attr_accessor :messages
107
+
108
+ # Indicates the type of message platform from which the message originated.
109
+ attr_accessor :type
110
+
111
+ # Indicates the country where the recipient is associated in ISO 3166-1 alpha-2 format.
112
+ attr_accessor :recipient_country
113
+
114
+ # The type of the recipient. Eg: Provisioned phoneNumber is the recipient for sms message type.
115
+ attr_accessor :recipient_type
116
+
117
+ # Attribute mapping from ruby-style variable name to JSON key.
118
+ def self.attribute_map
119
+ {
120
+
121
+ :'id' => :'id',
122
+
123
+ :'name' => :'name',
124
+
125
+ :'address' => :'address',
126
+
127
+ :'start_time' => :'startTime',
128
+
129
+ :'connected_time' => :'connectedTime',
130
+
131
+ :'end_time' => :'endTime',
132
+
133
+ :'start_hold_time' => :'startHoldTime',
134
+
135
+ :'purpose' => :'purpose',
136
+
137
+ :'state' => :'state',
138
+
139
+ :'direction' => :'direction',
140
+
141
+ :'disconnect_type' => :'disconnectType',
142
+
143
+ :'held' => :'held',
144
+
145
+ :'wrapup_required' => :'wrapupRequired',
146
+
147
+ :'wrapup_prompt' => :'wrapupPrompt',
148
+
149
+ :'user' => :'user',
150
+
151
+ :'queue' => :'queue',
152
+
153
+ :'attributes' => :'attributes',
154
+
155
+ :'error_info' => :'errorInfo',
156
+
157
+ :'script' => :'script',
158
+
159
+ :'wrapup_timeout_ms' => :'wrapupTimeoutMs',
160
+
161
+ :'wrapup_skipped' => :'wrapupSkipped',
162
+
163
+ :'provider' => :'provider',
164
+
165
+ :'external_contact' => :'externalContact',
166
+
167
+ :'external_organization' => :'externalOrganization',
168
+
169
+ :'wrapup' => :'wrapup',
170
+
171
+ :'peer' => :'peer',
172
+
173
+ :'to_address' => :'toAddress',
174
+
175
+ :'from_address' => :'fromAddress',
176
+
177
+ :'messages' => :'messages',
178
+
179
+ :'type' => :'type',
180
+
181
+ :'recipient_country' => :'recipientCountry',
182
+
183
+ :'recipient_type' => :'recipientType'
184
+
185
+ }
186
+ end
187
+
188
+ # Attribute type mapping.
189
+ def self.swagger_types
190
+ {
191
+
192
+ :'id' => :'String',
193
+
194
+ :'name' => :'String',
195
+
196
+ :'address' => :'String',
197
+
198
+ :'start_time' => :'DateTime',
199
+
200
+ :'connected_time' => :'DateTime',
201
+
202
+ :'end_time' => :'DateTime',
203
+
204
+ :'start_hold_time' => :'DateTime',
205
+
206
+ :'purpose' => :'String',
207
+
208
+ :'state' => :'String',
209
+
210
+ :'direction' => :'String',
211
+
212
+ :'disconnect_type' => :'String',
213
+
214
+ :'held' => :'BOOLEAN',
215
+
216
+ :'wrapup_required' => :'BOOLEAN',
217
+
218
+ :'wrapup_prompt' => :'String',
219
+
220
+ :'user' => :'UriReference',
221
+
222
+ :'queue' => :'UriReference',
223
+
224
+ :'attributes' => :'Hash<String, String>',
225
+
226
+ :'error_info' => :'ErrorBody',
227
+
228
+ :'script' => :'UriReference',
229
+
230
+ :'wrapup_timeout_ms' => :'Integer',
231
+
232
+ :'wrapup_skipped' => :'BOOLEAN',
233
+
234
+ :'provider' => :'String',
235
+
236
+ :'external_contact' => :'UriReference',
237
+
238
+ :'external_organization' => :'UriReference',
239
+
240
+ :'wrapup' => :'Wrapup',
241
+
242
+ :'peer' => :'String',
243
+
244
+ :'to_address' => :'Address',
245
+
246
+ :'from_address' => :'Address',
247
+
248
+ :'messages' => :'Array<MessageDetails>',
249
+
250
+ :'type' => :'String',
251
+
252
+ :'recipient_country' => :'String',
253
+
254
+ :'recipient_type' => :'String'
255
+
256
+ }
257
+ end
258
+
259
+ # Initializes the object
260
+ # @param [Hash] attributes Model attributes in the form of hash
261
+ def initialize(attributes = {})
262
+ return unless attributes.is_a?(Hash)
263
+
264
+ # convert string to symbol for hash key
265
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
266
+
267
+
268
+ if attributes.has_key?(:'id')
269
+
270
+
271
+ self.id = attributes[:'id']
272
+
273
+
274
+ end
275
+
276
+
277
+ if attributes.has_key?(:'name')
278
+
279
+
280
+ self.name = attributes[:'name']
281
+
282
+
283
+ end
284
+
285
+
286
+ if attributes.has_key?(:'address')
287
+
288
+
289
+ self.address = attributes[:'address']
290
+
291
+
292
+ end
293
+
294
+
295
+ if attributes.has_key?(:'startTime')
296
+
297
+
298
+ self.start_time = attributes[:'startTime']
299
+
300
+
301
+ end
302
+
303
+
304
+ if attributes.has_key?(:'connectedTime')
305
+
306
+
307
+ self.connected_time = attributes[:'connectedTime']
308
+
309
+
310
+ end
311
+
312
+
313
+ if attributes.has_key?(:'endTime')
314
+
315
+
316
+ self.end_time = attributes[:'endTime']
317
+
318
+
319
+ end
320
+
321
+
322
+ if attributes.has_key?(:'startHoldTime')
323
+
324
+
325
+ self.start_hold_time = attributes[:'startHoldTime']
326
+
327
+
328
+ end
329
+
330
+
331
+ if attributes.has_key?(:'purpose')
332
+
333
+
334
+ self.purpose = attributes[:'purpose']
335
+
336
+
337
+ end
338
+
339
+
340
+ if attributes.has_key?(:'state')
341
+
342
+
343
+ self.state = attributes[:'state']
344
+
345
+
346
+ end
347
+
348
+
349
+ if attributes.has_key?(:'direction')
350
+
351
+
352
+ self.direction = attributes[:'direction']
353
+
354
+
355
+ end
356
+
357
+
358
+ if attributes.has_key?(:'disconnectType')
359
+
360
+
361
+ self.disconnect_type = attributes[:'disconnectType']
362
+
363
+
364
+ end
365
+
366
+
367
+ if attributes.has_key?(:'held')
368
+
369
+
370
+ self.held = attributes[:'held']
371
+
372
+
373
+ end
374
+
375
+
376
+ if attributes.has_key?(:'wrapupRequired')
377
+
378
+
379
+ self.wrapup_required = attributes[:'wrapupRequired']
380
+
381
+
382
+ end
383
+
384
+
385
+ if attributes.has_key?(:'wrapupPrompt')
386
+
387
+
388
+ self.wrapup_prompt = attributes[:'wrapupPrompt']
389
+
390
+
391
+ end
392
+
393
+
394
+ if attributes.has_key?(:'user')
395
+
396
+
397
+ self.user = attributes[:'user']
398
+
399
+
400
+ end
401
+
402
+
403
+ if attributes.has_key?(:'queue')
404
+
405
+
406
+ self.queue = attributes[:'queue']
407
+
408
+
409
+ end
410
+
411
+
412
+ if attributes.has_key?(:'attributes')
413
+
414
+ if (value = attributes[:'attributes']).is_a?(Array)
415
+ self.attributes = value
416
+ end
417
+
418
+
419
+
420
+ end
421
+
422
+
423
+ if attributes.has_key?(:'errorInfo')
424
+
425
+
426
+ self.error_info = attributes[:'errorInfo']
427
+
428
+
429
+ end
430
+
431
+
432
+ if attributes.has_key?(:'script')
433
+
434
+
435
+ self.script = attributes[:'script']
436
+
437
+
438
+ end
439
+
440
+
441
+ if attributes.has_key?(:'wrapupTimeoutMs')
442
+
443
+
444
+ self.wrapup_timeout_ms = attributes[:'wrapupTimeoutMs']
445
+
446
+
447
+ end
448
+
449
+
450
+ if attributes.has_key?(:'wrapupSkipped')
451
+
452
+
453
+ self.wrapup_skipped = attributes[:'wrapupSkipped']
454
+
455
+
456
+ end
457
+
458
+
459
+ if attributes.has_key?(:'provider')
460
+
461
+
462
+ self.provider = attributes[:'provider']
463
+
464
+
465
+ end
466
+
467
+
468
+ if attributes.has_key?(:'externalContact')
469
+
470
+
471
+ self.external_contact = attributes[:'externalContact']
472
+
473
+
474
+ end
475
+
476
+
477
+ if attributes.has_key?(:'externalOrganization')
478
+
479
+
480
+ self.external_organization = attributes[:'externalOrganization']
481
+
482
+
483
+ end
484
+
485
+
486
+ if attributes.has_key?(:'wrapup')
487
+
488
+
489
+ self.wrapup = attributes[:'wrapup']
490
+
491
+
492
+ end
493
+
494
+
495
+ if attributes.has_key?(:'peer')
496
+
497
+
498
+ self.peer = attributes[:'peer']
499
+
500
+
501
+ end
502
+
503
+
504
+ if attributes.has_key?(:'toAddress')
505
+
506
+
507
+ self.to_address = attributes[:'toAddress']
508
+
509
+
510
+ end
511
+
512
+
513
+ if attributes.has_key?(:'fromAddress')
514
+
515
+
516
+ self.from_address = attributes[:'fromAddress']
517
+
518
+
519
+ end
520
+
521
+
522
+ if attributes.has_key?(:'messages')
523
+
524
+ if (value = attributes[:'messages']).is_a?(Array)
525
+ self.messages = value
526
+ end
527
+
528
+
529
+
530
+ end
531
+
532
+
533
+ if attributes.has_key?(:'type')
534
+
535
+
536
+ self.type = attributes[:'type']
537
+
538
+
539
+ end
540
+
541
+
542
+ if attributes.has_key?(:'recipientCountry')
543
+
544
+
545
+ self.recipient_country = attributes[:'recipientCountry']
546
+
547
+
548
+ end
549
+
550
+
551
+ if attributes.has_key?(:'recipientType')
552
+
553
+
554
+ self.recipient_type = attributes[:'recipientType']
555
+
556
+
557
+ end
558
+
559
+
560
+ end
561
+
562
+ # Show invalid properties with the reasons. Usually used together with valid?
563
+ # @return Array for valid properies with the reasons
564
+ def list_invalid_properties
565
+ invalid_properties = Array.new
566
+
567
+
568
+ return invalid_properties
569
+ end
570
+
571
+ # Check to see if the all the properties in the model are valid
572
+ # @return true if the model is valid
573
+ def valid?
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
+ allowed_values = ["alerting", "dialing", "contacting", "offering", "connected", "disconnected", "terminated", "converting", "uploading", "transmitting", "none"]
610
+ if @state && !allowed_values.include?(@state)
611
+ return false
612
+ end
613
+
614
+
615
+
616
+
617
+
618
+ allowed_values = ["inbound", "outbound"]
619
+ if @direction && !allowed_values.include?(@direction)
620
+ return false
621
+ end
622
+
623
+
624
+
625
+
626
+
627
+ allowed_values = ["endpoint", "client", "system", "transfer", "transfer.conference", "transfer.consult", "transfer.forward", "transfer.noanswer", "transfer.notavailable", "transport.failure", "error", "peer", "other", "spam"]
628
+ if @disconnect_type && !allowed_values.include?(@disconnect_type)
629
+ return false
630
+ end
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+
652
+
653
+
654
+
655
+
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
673
+
674
+
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
707
+
708
+ allowed_values = ["sms"]
709
+ if @type && !allowed_values.include?(@type)
710
+ return false
711
+ end
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+ end
724
+
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+ # Custom attribute writer method checking allowed values (enum).
768
+ # @param [Object] state Object to be assigned
769
+ def state=(state)
770
+ allowed_values = ["alerting", "dialing", "contacting", "offering", "connected", "disconnected", "terminated", "converting", "uploading", "transmitting", "none"]
771
+ if state && !allowed_values.include?(state)
772
+ fail ArgumentError, "invalid value for 'state', must be one of #{allowed_values}."
773
+ end
774
+ @state = state
775
+ end
776
+
777
+
778
+
779
+
780
+
781
+ # Custom attribute writer method checking allowed values (enum).
782
+ # @param [Object] direction Object to be assigned
783
+ def direction=(direction)
784
+ allowed_values = ["inbound", "outbound"]
785
+ if direction && !allowed_values.include?(direction)
786
+ fail ArgumentError, "invalid value for 'direction', must be one of #{allowed_values}."
787
+ end
788
+ @direction = direction
789
+ end
790
+
791
+
792
+
793
+
794
+
795
+ # Custom attribute writer method checking allowed values (enum).
796
+ # @param [Object] disconnect_type Object to be assigned
797
+ def disconnect_type=(disconnect_type)
798
+ allowed_values = ["endpoint", "client", "system", "transfer", "transfer.conference", "transfer.consult", "transfer.forward", "transfer.noanswer", "transfer.notavailable", "transport.failure", "error", "peer", "other", "spam"]
799
+ if disconnect_type && !allowed_values.include?(disconnect_type)
800
+ fail ArgumentError, "invalid value for 'disconnect_type', must be one of #{allowed_values}."
801
+ end
802
+ @disconnect_type = disconnect_type
803
+ end
804
+
805
+
806
+
807
+
808
+
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+
844
+
845
+
846
+
847
+
848
+
849
+
850
+
851
+
852
+
853
+
854
+
855
+
856
+
857
+
858
+
859
+
860
+
861
+
862
+
863
+
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+
872
+
873
+
874
+
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
892
+
893
+
894
+
895
+
896
+
897
+
898
+
899
+ # Custom attribute writer method checking allowed values (enum).
900
+ # @param [Object] type Object to be assigned
901
+ def type=(type)
902
+ allowed_values = ["sms"]
903
+ if type && !allowed_values.include?(type)
904
+ fail ArgumentError, "invalid value for 'type', must be one of #{allowed_values}."
905
+ end
906
+ @type = type
907
+ end
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+ # Checks equality by comparing each attribute.
923
+ # @param [Object] Object to be compared
924
+ def ==(o)
925
+ return true if self.equal?(o)
926
+ self.class == o.class &&
927
+ id == o.id &&
928
+ name == o.name &&
929
+ address == o.address &&
930
+ start_time == o.start_time &&
931
+ connected_time == o.connected_time &&
932
+ end_time == o.end_time &&
933
+ start_hold_time == o.start_hold_time &&
934
+ purpose == o.purpose &&
935
+ state == o.state &&
936
+ direction == o.direction &&
937
+ disconnect_type == o.disconnect_type &&
938
+ held == o.held &&
939
+ wrapup_required == o.wrapup_required &&
940
+ wrapup_prompt == o.wrapup_prompt &&
941
+ user == o.user &&
942
+ queue == o.queue &&
943
+ attributes == o.attributes &&
944
+ error_info == o.error_info &&
945
+ script == o.script &&
946
+ wrapup_timeout_ms == o.wrapup_timeout_ms &&
947
+ wrapup_skipped == o.wrapup_skipped &&
948
+ provider == o.provider &&
949
+ external_contact == o.external_contact &&
950
+ external_organization == o.external_organization &&
951
+ wrapup == o.wrapup &&
952
+ peer == o.peer &&
953
+ to_address == o.to_address &&
954
+ from_address == o.from_address &&
955
+ messages == o.messages &&
956
+ type == o.type &&
957
+ recipient_country == o.recipient_country &&
958
+ recipient_type == o.recipient_type
959
+ end
960
+
961
+ # @see the `==` method
962
+ # @param [Object] Object to be compared
963
+ def eql?(o)
964
+ self == o
965
+ end
966
+
967
+ # Calculates hash code according to all attributes.
968
+ # @return [Fixnum] Hash code
969
+ def hash
970
+ [id, name, address, start_time, connected_time, end_time, start_hold_time, purpose, state, direction, disconnect_type, held, wrapup_required, wrapup_prompt, user, queue, attributes, error_info, script, wrapup_timeout_ms, wrapup_skipped, provider, external_contact, external_organization, wrapup, peer, to_address, from_address, messages, type, recipient_country, recipient_type].hash
971
+ end
972
+
973
+ # build the object from hash
974
+ def build_from_hash(attributes)
975
+ return nil unless attributes.is_a?(Hash)
976
+ self.class.swagger_types.each_pair do |key, type|
977
+ if type =~ /^Array<(.*)>/i
978
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
979
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
980
+ else
981
+ #TODO show warning in debug mode
982
+ end
983
+ elsif !attributes[self.class.attribute_map[key]].nil?
984
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
985
+ else
986
+ # data not found in attributes(hash), not an issue as the data can be optional
987
+ end
988
+ end
989
+
990
+ self
991
+ end
992
+
993
+ def _deserialize(type, value)
994
+ case type.to_sym
995
+ when :DateTime
996
+ DateTime.parse(value)
997
+ when :Date
998
+ Date.parse(value)
999
+ when :String
1000
+ value.to_s
1001
+ when :Integer
1002
+ value.to_i
1003
+ when :Float
1004
+ value.to_f
1005
+ when :BOOLEAN
1006
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
1007
+ true
1008
+ else
1009
+ false
1010
+ end
1011
+ when :Object
1012
+ # generic object (usually a Hash), return directly
1013
+ value
1014
+ when /\AArray<(?<inner_type>.+)>\z/
1015
+ inner_type = Regexp.last_match[:inner_type]
1016
+ value.map { |v| _deserialize(inner_type, v) }
1017
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
1018
+ k_type = Regexp.last_match[:k_type]
1019
+ v_type = Regexp.last_match[:v_type]
1020
+ {}.tap do |hash|
1021
+ value.each do |k, v|
1022
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1023
+ end
1024
+ end
1025
+ else # model
1026
+ _model = Object.const_get("PureCloud").const_get(type).new
1027
+ _model.build_from_hash(value)
1028
+ end
1029
+ end
1030
+
1031
+ def to_s
1032
+ to_hash.to_s
1033
+ end
1034
+
1035
+ # to_body is an alias to to_body (backward compatibility))
1036
+ def to_body
1037
+ to_hash
1038
+ end
1039
+
1040
+ # return the object in the form of hash
1041
+ def to_hash
1042
+ hash = {}
1043
+ self.class.attribute_map.each_pair do |attr, param|
1044
+ value = self.send(attr)
1045
+ next if value.nil?
1046
+ hash[param] = _to_hash(value)
1047
+ end
1048
+ hash
1049
+ end
1050
+
1051
+ # Method to output non-array value in the form of hash
1052
+ # For object, use to_hash. Otherwise, just return the value
1053
+ def _to_hash(value)
1054
+ if value.is_a?(Array)
1055
+ value.compact.map{ |v| _to_hash(v) }
1056
+ elsif value.is_a?(Hash)
1057
+ {}.tap do |hash|
1058
+ value.each { |k, v| hash[k] = _to_hash(v) }
1059
+ end
1060
+ elsif value.respond_to? :to_hash
1061
+ value.to_hash
1062
+ else
1063
+ value
1064
+ end
1065
+ end
1066
+
1067
+ end
1068
+ end