purecloudplatformclientv2 87.0.0 → 92.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/docs/AmazonLexRequest.md +14 -0
  4. data/docs/AnalyticsEvaluation.md +1 -1
  5. data/docs/ApiUsageQuery.md +16 -0
  6. data/docs/ApiUsageQueryResult.md +14 -0
  7. data/docs/ApiUsageRow.md +25 -0
  8. data/docs/ArchitectApi.md +132 -0
  9. data/docs/AuditApi.md +130 -0
  10. data/docs/AuditQueryEntity.md +14 -0
  11. data/docs/AuditQueryExecutionStatusResponse.md +1 -0
  12. data/docs/AuditQueryRequest.md +1 -0
  13. data/docs/AuditQueryService.md +14 -0
  14. data/docs/AuditQueryServiceMapping.md +13 -0
  15. data/docs/AuditQuerySort.md +14 -0
  16. data/docs/AuditRealtimeQueryRequest.md +18 -0
  17. data/docs/AuditRealtimeQueryResultsResponse.md +17 -0
  18. data/docs/BuAgentScheduleActivity.md +2 -0
  19. data/docs/BuRescheduleRequest.md +2 -2
  20. data/docs/ButtonComponent.md +16 -0
  21. data/docs/CoachingApi.md +1 -1
  22. data/docs/ContentActions.md +17 -0
  23. data/docs/ContentAttachment.md +19 -0
  24. data/docs/ContentGeneric.md +19 -0
  25. data/docs/ContentList.md +19 -0
  26. data/docs/ContentLocation.md +17 -0
  27. data/docs/ContentNotificationTemplate.md +17 -0
  28. data/docs/ContentQuickReply.md +16 -0
  29. data/docs/ConversationAggregationQuery.md +1 -1
  30. data/docs/CreateQueueRequest.md +1 -0
  31. data/docs/EdgeGroup.md +1 -0
  32. data/docs/EntityListing.md +1 -5
  33. data/docs/EvaluationAggregationQuery.md +1 -1
  34. data/docs/ExternalContact.md +2 -0
  35. data/docs/ExternalOrganization.md +2 -0
  36. data/docs/FlowAggregationQuery.md +1 -1
  37. data/docs/FlowExecutionLaunchRequest.md +16 -0
  38. data/docs/FlowExecutionLaunchResponse.md +16 -0
  39. data/docs/FlowRuntimeExecution.md +23 -0
  40. data/docs/GenericSAML.md +22 -0
  41. data/docs/GoogleDialogflowCustomSettings.md +13 -0
  42. data/docs/GroupsApi.md +4 -4
  43. data/docs/IdentityProviderApi.md +187 -0
  44. data/docs/IpAddressAuthentication.md +13 -0
  45. data/docs/KnowledgeSearchResponse.md +1 -1
  46. data/docs/LanguageUnderstandingApi.md +164 -30
  47. data/docs/ListItemComponent.md +19 -0
  48. data/docs/MessageContent.md +19 -0
  49. data/docs/NluDomainVersion.md +3 -1
  50. data/docs/NotificationTemplateBody.md +14 -0
  51. data/docs/NotificationTemplateFooter.md +13 -0
  52. data/docs/NotificationTemplateHeader.md +16 -0
  53. data/docs/NotificationTemplateParameter.md +14 -0
  54. data/docs/OAuthApi.md +208 -0
  55. data/docs/OrganizationApi.md +126 -0
  56. data/docs/PostTextMessage.md +15 -0
  57. data/docs/PostTextRequest.md +23 -0
  58. data/docs/PostTextResponse.md +20 -0
  59. data/docs/Prompt.md +2 -2
  60. data/docs/Queue.md +1 -0
  61. data/docs/QueueRequest.md +1 -0
  62. data/docs/RecordingApi.md +12 -0
  63. data/docs/ReportingDataExportTopicDataExportNotification.md +1 -0
  64. data/docs/ScimEmail.md +1 -1
  65. data/docs/SurveyAggregationQuery.md +1 -1
  66. data/docs/SurveyForm.md +0 -2
  67. data/docs/TextbotsApi.md +78 -0
  68. data/docs/UploadUrlRequest.md +1 -0
  69. data/docs/UsageApi.md +144 -0
  70. data/docs/UsageExecutionResult.md +14 -0
  71. data/docs/UserAggregationQuery.md +1 -1
  72. data/docs/UserQueue.md +1 -0
  73. data/docs/UsersApi.md +5 -5
  74. data/docs/ViewFilter.md +2 -0
  75. data/docs/VoicemailMessagesTopicOwner.md +13 -0
  76. data/docs/VoicemailMessagesTopicVoicemailCopyRecord.md +14 -0
  77. data/docs/VoicemailMessagesTopicVoicemailMessage.md +2 -0
  78. data/docs/WfmBuShortTermForecastImportCompleteTopicBuForecastModification.md +23 -0
  79. data/docs/WfmBuShortTermForecastImportCompleteTopicBuShortTermForecast.md +24 -0
  80. data/docs/WfmBuShortTermForecastImportCompleteTopicBuShortTermForecastNotification.md +15 -0
  81. data/docs/WfmBuShortTermForecastImportCompleteTopicForecastSourceDayPointer.md +17 -0
  82. data/docs/WfmBuShortTermForecastImportCompleteTopicModificationIntervalOffsetValue.md +14 -0
  83. data/docs/WfmBuShortTermForecastImportCompleteTopicUserReference.md +13 -0
  84. data/docs/WfmBuShortTermForecastImportCompleteTopicWfmVersionedEntityMetadata.md +15 -0
  85. data/docs/WorkforceManagementApi.md +3 -3
  86. data/lib/purecloudplatformclientv2.rb +45 -0
  87. data/lib/purecloudplatformclientv2/api/architect_api.rb +130 -0
  88. data/lib/purecloudplatformclientv2/api/audit_api.rb +129 -0
  89. data/lib/purecloudplatformclientv2/api/groups_api.rb +4 -4
  90. data/lib/purecloudplatformclientv2/api/identity_provider_api.rb +175 -0
  91. data/lib/purecloudplatformclientv2/api/language_understanding_api.rb +189 -30
  92. data/lib/purecloudplatformclientv2/api/o_auth_api.rb +224 -0
  93. data/lib/purecloudplatformclientv2/api/organization_api.rb +120 -0
  94. data/lib/purecloudplatformclientv2/api/recording_api.rb +78 -0
  95. data/lib/purecloudplatformclientv2/api/textbots_api.rb +92 -0
  96. data/lib/purecloudplatformclientv2/api/usage_api.rb +157 -0
  97. data/lib/purecloudplatformclientv2/api/users_api.rb +4 -4
  98. data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +6 -6
  99. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  100. data/lib/purecloudplatformclientv2/models/amazon_lex_request.rb +232 -0
  101. data/lib/purecloudplatformclientv2/models/analytics_evaluation.rb +13 -13
  102. data/lib/purecloudplatformclientv2/models/api_usage_query.rb +303 -0
  103. data/lib/purecloudplatformclientv2/models/api_usage_query_result.rb +244 -0
  104. data/lib/purecloudplatformclientv2/models/api_usage_row.rb +514 -0
  105. data/lib/purecloudplatformclientv2/models/audit_log_message.rb +6 -6
  106. data/lib/purecloudplatformclientv2/models/audit_query_entity.rb +244 -0
  107. data/lib/purecloudplatformclientv2/models/audit_query_execution_status_response.rb +34 -6
  108. data/lib/purecloudplatformclientv2/models/audit_query_request.rb +34 -6
  109. data/lib/purecloudplatformclientv2/models/audit_query_service.rb +244 -0
  110. data/lib/purecloudplatformclientv2/models/audit_query_service_mapping.rb +204 -0
  111. data/lib/purecloudplatformclientv2/models/audit_query_sort.rb +266 -0
  112. data/lib/purecloudplatformclientv2/models/audit_realtime_query_request.rb +360 -0
  113. data/lib/purecloudplatformclientv2/models/audit_realtime_query_results_response.rb +303 -0
  114. data/lib/purecloudplatformclientv2/models/bu_agent_schedule_activity.rb +70 -4
  115. data/lib/purecloudplatformclientv2/models/bu_reschedule_request.rb +2 -12
  116. data/lib/purecloudplatformclientv2/models/button_component.rb +281 -0
  117. data/lib/purecloudplatformclientv2/models/coaching_appointment_response.rb +2 -2
  118. data/lib/purecloudplatformclientv2/models/coaching_notification.rb +2 -2
  119. data/lib/purecloudplatformclientv2/models/content_actions.rb +309 -0
  120. data/lib/purecloudplatformclientv2/models/content_attachment.rb +378 -0
  121. data/lib/purecloudplatformclientv2/models/content_generic.rb +361 -0
  122. data/lib/purecloudplatformclientv2/models/content_list.rb +375 -0
  123. data/lib/purecloudplatformclientv2/models/content_location.rb +307 -0
  124. data/lib/purecloudplatformclientv2/models/content_notification_template.rb +312 -0
  125. data/lib/purecloudplatformclientv2/models/content_quick_reply.rb +300 -0
  126. data/lib/purecloudplatformclientv2/models/conversation_aggregate_query_predicate.rb +2 -2
  127. data/lib/purecloudplatformclientv2/models/conversation_aggregation_query.rb +1 -1
  128. data/lib/purecloudplatformclientv2/models/create_queue_request.rb +29 -1
  129. data/lib/purecloudplatformclientv2/models/edge_group.rb +27 -1
  130. data/lib/purecloudplatformclientv2/models/entity_listing.rb +4 -104
  131. data/lib/purecloudplatformclientv2/models/evaluation_aggregation_query.rb +1 -1
  132. data/lib/purecloudplatformclientv2/models/event_message.rb +2 -2
  133. data/lib/purecloudplatformclientv2/models/external_contact.rb +55 -1
  134. data/lib/purecloudplatformclientv2/models/external_organization.rb +55 -1
  135. data/lib/purecloudplatformclientv2/models/flow_aggregate_query_predicate.rb +2 -2
  136. data/lib/purecloudplatformclientv2/models/flow_aggregation_query.rb +1 -1
  137. data/lib/purecloudplatformclientv2/models/flow_execution_launch_request.rb +288 -0
  138. data/lib/purecloudplatformclientv2/models/flow_execution_launch_response.rb +281 -0
  139. data/lib/purecloudplatformclientv2/models/flow_runtime_execution.rb +494 -0
  140. data/lib/purecloudplatformclientv2/models/generic_saml.rb +428 -0
  141. data/lib/purecloudplatformclientv2/models/google_dialogflow_custom_settings.rb +202 -0
  142. data/lib/purecloudplatformclientv2/models/ip_address_authentication.rb +203 -0
  143. data/lib/purecloudplatformclientv2/models/knowledge_search_response.rb +18 -18
  144. data/lib/purecloudplatformclientv2/models/list_item_component.rb +373 -0
  145. data/lib/purecloudplatformclientv2/models/message_content.rb +378 -0
  146. data/lib/purecloudplatformclientv2/models/nlu_domain_version.rb +72 -1
  147. data/lib/purecloudplatformclientv2/models/notification_template_body.rb +236 -0
  148. data/lib/purecloudplatformclientv2/models/notification_template_footer.rb +203 -0
  149. data/lib/purecloudplatformclientv2/models/notification_template_header.rb +302 -0
  150. data/lib/purecloudplatformclientv2/models/notification_template_parameter.rb +234 -0
  151. data/lib/purecloudplatformclientv2/models/post_text_message.rb +275 -0
  152. data/lib/purecloudplatformclientv2/models/post_text_request.rb +482 -0
  153. data/lib/purecloudplatformclientv2/models/post_text_response.rb +413 -0
  154. data/lib/purecloudplatformclientv2/models/prompt.rb +2 -0
  155. data/lib/purecloudplatformclientv2/models/prompt_asset.rb +15 -1
  156. data/lib/purecloudplatformclientv2/models/prompt_asset_create.rb +15 -1
  157. data/lib/purecloudplatformclientv2/models/queue.rb +29 -1
  158. data/lib/purecloudplatformclientv2/models/queue_request.rb +29 -1
  159. data/lib/purecloudplatformclientv2/models/reporting_data_export_topic_data_export_notification.rb +31 -4
  160. data/lib/purecloudplatformclientv2/models/scim_email.rb +1 -1
  161. data/lib/purecloudplatformclientv2/models/survey_aggregation_query.rb +1 -1
  162. data/lib/purecloudplatformclientv2/models/survey_form.rb +1 -53
  163. data/lib/purecloudplatformclientv2/models/upload_url_request.rb +43 -4
  164. data/lib/purecloudplatformclientv2/models/usage_execution_result.rb +228 -0
  165. data/lib/purecloudplatformclientv2/models/user_aggregation_query.rb +1 -1
  166. data/lib/purecloudplatformclientv2/models/user_queue.rb +29 -1
  167. data/lib/purecloudplatformclientv2/models/view_filter.rb +58 -4
  168. data/lib/purecloudplatformclientv2/models/voicemail_messages_topic_owner.rb +201 -0
  169. data/lib/purecloudplatformclientv2/models/voicemail_messages_topic_voicemail_copy_record.rb +226 -0
  170. data/lib/purecloudplatformclientv2/models/voicemail_messages_topic_voicemail_message.rb +56 -4
  171. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_bu_forecast_modification.rb +497 -0
  172. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_bu_short_term_forecast.rb +494 -0
  173. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_bu_short_term_forecast_notification.rb +265 -0
  174. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_forecast_source_day_pointer.rb +315 -0
  175. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_modification_interval_offset_value.rb +226 -0
  176. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_user_reference.rb +201 -0
  177. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_wfm_versioned_entity_metadata.rb +251 -0
  178. data/lib/purecloudplatformclientv2/version.rb +1 -1
  179. metadata +92 -2
@@ -0,0 +1,514 @@
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: UNLICENSED
11
+ https://help.mypurecloud.com/articles/terms-and-conditions/
12
+
13
+ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class ApiUsageRow
21
+ # Client Id associated with this query result
22
+ attr_accessor :client_id
23
+
24
+ # Client Name associated with this query result
25
+ attr_accessor :client_name
26
+
27
+ # Organization Id associated with this query result
28
+ attr_accessor :organization_id
29
+
30
+ # User Id associated with this query result
31
+ attr_accessor :user_id
32
+
33
+ # Template Uri associated with this query result
34
+ attr_accessor :template_uri
35
+
36
+ # HTTP Method associated with this query result
37
+ attr_accessor :http_method
38
+
39
+ # Number of requests resulting in a 2xx HTTP status code
40
+ attr_accessor :status200
41
+
42
+ # Number of requests resulting in a 3xx HTTP status code
43
+ attr_accessor :status300
44
+
45
+ # Number of requests resulting in a 4xx HTTP status code
46
+ attr_accessor :status400
47
+
48
+ # Number of requests resulting in a 5xx HTTP status code
49
+ attr_accessor :status500
50
+
51
+ # Number of requests resulting in a 429 HTTP status code, this is a subset of the count returned with status400
52
+ attr_accessor :status429
53
+
54
+ # Total number of requests
55
+ attr_accessor :requests
56
+
57
+ # Date of requests, based on granularity. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
58
+ attr_accessor :date
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+
64
+ :'client_id' => :'clientId',
65
+
66
+ :'client_name' => :'clientName',
67
+
68
+ :'organization_id' => :'organizationId',
69
+
70
+ :'user_id' => :'userId',
71
+
72
+ :'template_uri' => :'templateUri',
73
+
74
+ :'http_method' => :'httpMethod',
75
+
76
+ :'status200' => :'status200',
77
+
78
+ :'status300' => :'status300',
79
+
80
+ :'status400' => :'status400',
81
+
82
+ :'status500' => :'status500',
83
+
84
+ :'status429' => :'status429',
85
+
86
+ :'requests' => :'requests',
87
+
88
+ :'date' => :'date'
89
+
90
+ }
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.swagger_types
95
+ {
96
+
97
+ :'client_id' => :'String',
98
+
99
+ :'client_name' => :'String',
100
+
101
+ :'organization_id' => :'String',
102
+
103
+ :'user_id' => :'String',
104
+
105
+ :'template_uri' => :'String',
106
+
107
+ :'http_method' => :'String',
108
+
109
+ :'status200' => :'Integer',
110
+
111
+ :'status300' => :'Integer',
112
+
113
+ :'status400' => :'Integer',
114
+
115
+ :'status500' => :'Integer',
116
+
117
+ :'status429' => :'Integer',
118
+
119
+ :'requests' => :'Integer',
120
+
121
+ :'date' => :'DateTime'
122
+
123
+ }
124
+ end
125
+
126
+ # Initializes the object
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ def initialize(attributes = {})
129
+ return unless attributes.is_a?(Hash)
130
+
131
+ # convert string to symbol for hash key
132
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
133
+
134
+
135
+ if attributes.has_key?(:'clientId')
136
+
137
+
138
+ self.client_id = attributes[:'clientId']
139
+
140
+
141
+ end
142
+
143
+
144
+ if attributes.has_key?(:'clientName')
145
+
146
+
147
+ self.client_name = attributes[:'clientName']
148
+
149
+
150
+ end
151
+
152
+
153
+ if attributes.has_key?(:'organizationId')
154
+
155
+
156
+ self.organization_id = attributes[:'organizationId']
157
+
158
+
159
+ end
160
+
161
+
162
+ if attributes.has_key?(:'userId')
163
+
164
+
165
+ self.user_id = attributes[:'userId']
166
+
167
+
168
+ end
169
+
170
+
171
+ if attributes.has_key?(:'templateUri')
172
+
173
+
174
+ self.template_uri = attributes[:'templateUri']
175
+
176
+
177
+ end
178
+
179
+
180
+ if attributes.has_key?(:'httpMethod')
181
+
182
+
183
+ self.http_method = attributes[:'httpMethod']
184
+
185
+
186
+ end
187
+
188
+
189
+ if attributes.has_key?(:'status200')
190
+
191
+
192
+ self.status200 = attributes[:'status200']
193
+
194
+
195
+ end
196
+
197
+
198
+ if attributes.has_key?(:'status300')
199
+
200
+
201
+ self.status300 = attributes[:'status300']
202
+
203
+
204
+ end
205
+
206
+
207
+ if attributes.has_key?(:'status400')
208
+
209
+
210
+ self.status400 = attributes[:'status400']
211
+
212
+
213
+ end
214
+
215
+
216
+ if attributes.has_key?(:'status500')
217
+
218
+
219
+ self.status500 = attributes[:'status500']
220
+
221
+
222
+ end
223
+
224
+
225
+ if attributes.has_key?(:'status429')
226
+
227
+
228
+ self.status429 = attributes[:'status429']
229
+
230
+
231
+ end
232
+
233
+
234
+ if attributes.has_key?(:'requests')
235
+
236
+
237
+ self.requests = attributes[:'requests']
238
+
239
+
240
+ end
241
+
242
+
243
+ if attributes.has_key?(:'date')
244
+
245
+
246
+ self.date = attributes[:'date']
247
+
248
+
249
+ end
250
+
251
+
252
+ end
253
+
254
+ # Show invalid properties with the reasons. Usually used together with valid?
255
+ # @return Array for valid properies with the reasons
256
+ def list_invalid_properties
257
+ invalid_properties = Array.new
258
+
259
+
260
+ return invalid_properties
261
+ end
262
+
263
+ # Check to see if the all the properties in the model are valid
264
+ # @return true if the model is valid
265
+ def valid?
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
+ end
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
+ # Checks equality by comparing each attribute.
388
+ # @param [Object] Object to be compared
389
+ def ==(o)
390
+ return true if self.equal?(o)
391
+ self.class == o.class &&
392
+ client_id == o.client_id &&
393
+ client_name == o.client_name &&
394
+ organization_id == o.organization_id &&
395
+ user_id == o.user_id &&
396
+ template_uri == o.template_uri &&
397
+ http_method == o.http_method &&
398
+ status200 == o.status200 &&
399
+ status300 == o.status300 &&
400
+ status400 == o.status400 &&
401
+ status500 == o.status500 &&
402
+ status429 == o.status429 &&
403
+ requests == o.requests &&
404
+ date == o.date
405
+ end
406
+
407
+ # @see the `==` method
408
+ # @param [Object] Object to be compared
409
+ def eql?(o)
410
+ self == o
411
+ end
412
+
413
+ # Calculates hash code according to all attributes.
414
+ # @return [Fixnum] Hash code
415
+ def hash
416
+ [client_id, client_name, organization_id, user_id, template_uri, http_method, status200, status300, status400, status500, status429, requests, date].hash
417
+ end
418
+
419
+ # build the object from hash
420
+ def build_from_hash(attributes)
421
+ return nil unless attributes.is_a?(Hash)
422
+ self.class.swagger_types.each_pair do |key, type|
423
+ if type =~ /^Array<(.*)>/i
424
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
425
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
426
+ else
427
+ #TODO show warning in debug mode
428
+ end
429
+ elsif !attributes[self.class.attribute_map[key]].nil?
430
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
431
+ else
432
+ # data not found in attributes(hash), not an issue as the data can be optional
433
+ end
434
+ end
435
+
436
+ self
437
+ end
438
+
439
+ def _deserialize(type, value)
440
+ case type.to_sym
441
+ when :DateTime
442
+ DateTime.parse(value)
443
+ when :Date
444
+ Date.parse(value)
445
+ when :String
446
+ value.to_s
447
+ when :Integer
448
+ value.to_i
449
+ when :Float
450
+ value.to_f
451
+ when :BOOLEAN
452
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
453
+ true
454
+ else
455
+ false
456
+ end
457
+ when :Object
458
+ # generic object (usually a Hash), return directly
459
+ value
460
+ when /\AArray<(?<inner_type>.+)>\z/
461
+ inner_type = Regexp.last_match[:inner_type]
462
+ value.map { |v| _deserialize(inner_type, v) }
463
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
464
+ k_type = Regexp.last_match[:k_type]
465
+ v_type = Regexp.last_match[:v_type]
466
+ {}.tap do |hash|
467
+ value.each do |k, v|
468
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
469
+ end
470
+ end
471
+ else # model
472
+ _model = Object.const_get("PureCloud").const_get(type).new
473
+ _model.build_from_hash(value)
474
+ end
475
+ end
476
+
477
+ def to_s
478
+ to_hash.to_s
479
+ end
480
+
481
+ # to_body is an alias to to_body (backward compatibility))
482
+ def to_body
483
+ to_hash
484
+ end
485
+
486
+ # return the object in the form of hash
487
+ def to_hash
488
+ hash = {}
489
+ self.class.attribute_map.each_pair do |attr, param|
490
+ value = self.send(attr)
491
+ next if value.nil?
492
+ hash[param] = _to_hash(value)
493
+ end
494
+ hash
495
+ end
496
+
497
+ # Method to output non-array value in the form of hash
498
+ # For object, use to_hash. Otherwise, just return the value
499
+ def _to_hash(value)
500
+ if value.is_a?(Array)
501
+ value.compact.map{ |v| _to_hash(v) }
502
+ elsif value.is_a?(Hash)
503
+ {}.tap do |hash|
504
+ value.each { |k, v| hash[k] = _to_hash(v) }
505
+ end
506
+ elsif value.respond_to? :to_hash
507
+ value.to_hash
508
+ else
509
+ value
510
+ end
511
+ end
512
+
513
+ end
514
+ end