purecloudplatformclientv2 15.0.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/docs/Action.md +21 -0
- data/docs/ActionConfig.md +14 -0
- data/docs/ActionContract.md +14 -0
- data/docs/ActionContractInput.md +14 -0
- data/docs/ActionEntityListing.md +22 -0
- data/docs/ActionInput.md +15 -0
- data/docs/ActionOutput.md +18 -0
- data/docs/ActiveAlertCount.md +13 -0
- data/docs/AggregationQuery.md +1 -1
- data/docs/AlertingApi.md +54 -0
- data/docs/ArchitectApi.md +31 -25
- data/docs/CallConversationNotificationCallMediaParticipant.md +1 -0
- data/docs/CallConversationNotificationParticipants.md +1 -0
- data/docs/CallbackConversationNotificationCallbackMediaParticipant.md +1 -0
- data/docs/CallbackConversationNotificationParticipants.md +1 -0
- data/docs/Category.md +13 -0
- data/docs/CategoryEntityListing.md +17 -0
- data/docs/ChatConversationNotificationChatMediaParticipant.md +1 -0
- data/docs/ChatConversationNotificationParticipants.md +1 -0
- data/docs/CobrowseConversationNotificationCobrowseMediaParticipant.md +1 -0
- data/docs/CobrowseConversationNotificationParticipants.md +1 -0
- data/docs/ConversationNotificationCall.md +1 -0
- data/docs/ConversationNotificationCalls.md +1 -0
- data/docs/ConversationNotificationEmail.md +1 -0
- data/docs/ConversationNotificationEmails.md +1 -0
- data/docs/ConversationNotificationParticipant.md +1 -0
- data/docs/ConversationNotificationParticipants.md +1 -0
- data/docs/ConversationsApi.md +3 -3
- data/docs/Document.md +1 -1
- data/docs/DomainOrganizationRole.md +1 -1
- data/docs/DomainOrganizationRoleCreate.md +1 -1
- data/docs/DomainOrganizationRoleUpdate.md +1 -1
- data/docs/DraftValidationResult.md +14 -0
- data/docs/EmailConversationNotificationEmailMediaParticipant.md +2 -0
- data/docs/EmailConversationNotificationParticipants.md +2 -0
- data/docs/FaxDocument.md +1 -1
- data/docs/IntegrationsApi.md +1355 -0
- data/docs/JsonNode.md +4 -4
- data/docs/ManagementUnit.md +1 -1
- data/docs/ManagementUnitListing.md +22 -0
- data/docs/OutboundApi.md +59 -0
- data/docs/PostActionInput.md +18 -0
- data/docs/PostInputContract.md +13 -0
- data/docs/PostOutputContract.md +13 -0
- data/docs/PublishDraftInput.md +13 -0
- data/docs/RecordingApi.md +123 -0
- data/docs/RequestConfig.md +17 -0
- data/docs/ResponseConfig.md +15 -0
- data/docs/ScreenShareConversationNotificationParticipants.md +1 -0
- data/docs/ScreenShareConversationNotificationScreenShareMediaParticipant.md +1 -0
- data/docs/SocialConversationNotificationParticipants.md +1 -0
- data/docs/SocialConversationNotificationSocialMediaParticipant.md +1 -0
- data/docs/TestExecutionOperationResult.md +17 -0
- data/docs/TestExecutionResult.md +16 -0
- data/docs/UpdateActionInput.md +16 -0
- data/docs/UpdateDraftInput.md +18 -0
- data/docs/VideoConversationNotificationParticipants.md +1 -0
- data/docs/VideoConversationNotificationVideoMediaParticipant.md +1 -0
- data/docs/WorkforceManagementApi.md +2 -4
- data/lib/purecloudplatformclientv2.rb +23 -1
- data/lib/purecloudplatformclientv2/api/alerting_api.rb +55 -0
- data/lib/purecloudplatformclientv2/api/architect_api.rb +52 -20
- data/lib/purecloudplatformclientv2/api/conversations_api.rb +2 -2
- data/lib/purecloudplatformclientv2/api/integrations_api.rb +1723 -0
- data/lib/purecloudplatformclientv2/api/outbound_api.rb +65 -0
- data/lib/purecloudplatformclientv2/api/recording_api.rb +140 -0
- data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +3 -12
- data/lib/purecloudplatformclientv2/api_client.rb +1 -1
- data/lib/purecloudplatformclientv2/models/action.rb +409 -0
- data/lib/purecloudplatformclientv2/models/action_config.rb +229 -0
- data/lib/purecloudplatformclientv2/models/action_contract.rb +229 -0
- data/lib/purecloudplatformclientv2/models/action_contract_input.rb +239 -0
- data/lib/purecloudplatformclientv2/models/action_entity_listing.rb +428 -0
- data/lib/purecloudplatformclientv2/models/action_input.rb +255 -0
- data/lib/purecloudplatformclientv2/models/action_output.rb +333 -0
- data/lib/purecloudplatformclientv2/models/active_alert_count.rb +202 -0
- data/lib/purecloudplatformclientv2/models/aggregation_query.rb +1 -1
- data/lib/purecloudplatformclientv2/models/call_conversation_notification_call_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/call_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/callback_conversation_notification_callback_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/callback_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/category.rb +203 -0
- data/lib/purecloudplatformclientv2/models/category_entity_listing.rb +303 -0
- data/lib/purecloudplatformclientv2/models/chat_conversation_notification_chat_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/chat_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/cobrowse_conversation_notification_cobrowse_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/cobrowse_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/condition.rb +2 -2
- data/lib/purecloudplatformclientv2/models/conversation_notification_call.rb +26 -1
- data/lib/purecloudplatformclientv2/models/conversation_notification_calls.rb +26 -1
- data/lib/purecloudplatformclientv2/models/conversation_notification_email.rb +26 -1
- data/lib/purecloudplatformclientv2/models/conversation_notification_emails.rb +26 -1
- data/lib/purecloudplatformclientv2/models/conversation_notification_participant.rb +40 -1
- data/lib/purecloudplatformclientv2/models/conversation_notification_participants.rb +40 -1
- data/lib/purecloudplatformclientv2/models/dependency.rb +2 -2
- data/lib/purecloudplatformclientv2/models/dependency_object.rb +2 -2
- data/lib/purecloudplatformclientv2/models/document.rb +12 -12
- data/lib/purecloudplatformclientv2/models/domain_organization_role.rb +12 -12
- data/lib/purecloudplatformclientv2/models/domain_organization_role_create.rb +12 -12
- data/lib/purecloudplatformclientv2/models/domain_organization_role_update.rb +12 -12
- data/lib/purecloudplatformclientv2/models/draft_validation_result.rb +231 -0
- data/lib/purecloudplatformclientv2/models/email_conversation_notification_email_media_participant.rb +54 -4
- data/lib/purecloudplatformclientv2/models/email_conversation_notification_participants.rb +54 -4
- data/lib/purecloudplatformclientv2/models/fax_document.rb +12 -12
- data/lib/purecloudplatformclientv2/models/flow.rb +2 -2
- data/lib/purecloudplatformclientv2/models/interaction_stats_alert.rb +2 -2
- data/lib/purecloudplatformclientv2/models/interaction_stats_rule.rb +2 -2
- data/lib/purecloudplatformclientv2/models/json_node.rb +72 -72
- data/lib/purecloudplatformclientv2/models/management_unit.rb +7 -7
- data/lib/purecloudplatformclientv2/models/management_unit_listing.rb +428 -0
- data/lib/purecloudplatformclientv2/models/post_action_input.rb +358 -0
- data/lib/purecloudplatformclientv2/models/post_input_contract.rb +208 -0
- data/lib/purecloudplatformclientv2/models/post_output_contract.rb +208 -0
- data/lib/purecloudplatformclientv2/models/publish_draft_input.rb +208 -0
- data/lib/purecloudplatformclientv2/models/request_config.rb +309 -0
- data/lib/purecloudplatformclientv2/models/response_config.rb +257 -0
- data/lib/purecloudplatformclientv2/models/screen_share_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/screen_share_conversation_notification_screen_share_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/social_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/social_conversation_notification_social_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/test_execution_operation_result.rb +306 -0
- data/lib/purecloudplatformclientv2/models/test_execution_result.rb +282 -0
- data/lib/purecloudplatformclientv2/models/{publish_flow_notification_notification.rb → update_action_input.rb} +35 -26
- data/lib/purecloudplatformclientv2/models/update_draft_input.rb +338 -0
- data/lib/purecloudplatformclientv2/models/video_conversation_notification_participants.rb +26 -1
- data/lib/purecloudplatformclientv2/models/video_conversation_notification_video_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/version.rb +1 -1
- metadata +91 -47
- data/docs/PublishFlowNotificationNotification.md +0 -16
@@ -28,7 +28,7 @@ module PureCloud
|
|
28
28
|
attr_accessor :start_day_of_week
|
29
29
|
|
30
30
|
# The time zone for the management unit in standard Olson Format (See https://en.wikipedia.org/wiki/Tz_database)
|
31
|
-
attr_accessor :
|
31
|
+
attr_accessor :time_zone
|
32
32
|
|
33
33
|
# The version of the underlying ManagementUnit object. Useful for handling eventual consistency issues. User must submit the current version they of the ManagementUnit in any write requests
|
34
34
|
attr_accessor :version
|
@@ -49,7 +49,7 @@ module PureCloud
|
|
49
49
|
|
50
50
|
:'start_day_of_week' => :'startDayOfWeek',
|
51
51
|
|
52
|
-
:'
|
52
|
+
:'time_zone' => :'timeZone',
|
53
53
|
|
54
54
|
:'version' => :'version',
|
55
55
|
|
@@ -70,7 +70,7 @@ module PureCloud
|
|
70
70
|
|
71
71
|
:'start_day_of_week' => :'String',
|
72
72
|
|
73
|
-
:'
|
73
|
+
:'time_zone' => :'String',
|
74
74
|
|
75
75
|
:'version' => :'Integer',
|
76
76
|
|
@@ -117,10 +117,10 @@ module PureCloud
|
|
117
117
|
end
|
118
118
|
|
119
119
|
|
120
|
-
if attributes.has_key?(:'
|
120
|
+
if attributes.has_key?(:'timeZone')
|
121
121
|
|
122
122
|
|
123
|
-
self.
|
123
|
+
self.time_zone = attributes[:'timeZone']
|
124
124
|
|
125
125
|
|
126
126
|
end
|
@@ -261,7 +261,7 @@ module PureCloud
|
|
261
261
|
id == o.id &&
|
262
262
|
name == o.name &&
|
263
263
|
start_day_of_week == o.start_day_of_week &&
|
264
|
-
|
264
|
+
time_zone == o.time_zone &&
|
265
265
|
version == o.version &&
|
266
266
|
date_modified == o.date_modified &&
|
267
267
|
self_uri == o.self_uri
|
@@ -276,7 +276,7 @@ module PureCloud
|
|
276
276
|
# Calculates hash code according to all attributes.
|
277
277
|
# @return [Fixnum] Hash code
|
278
278
|
def hash
|
279
|
-
[id, name, start_day_of_week,
|
279
|
+
[id, name, start_day_of_week, time_zone, version, date_modified, self_uri].hash
|
280
280
|
end
|
281
281
|
|
282
282
|
# build the object from hash
|
@@ -0,0 +1,428 @@
|
|
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 ManagementUnitListing
|
21
|
+
attr_accessor :entities
|
22
|
+
|
23
|
+
attr_accessor :page_size
|
24
|
+
|
25
|
+
attr_accessor :page_number
|
26
|
+
|
27
|
+
attr_accessor :total
|
28
|
+
|
29
|
+
attr_accessor :self_uri
|
30
|
+
|
31
|
+
attr_accessor :first_uri
|
32
|
+
|
33
|
+
attr_accessor :next_uri
|
34
|
+
|
35
|
+
attr_accessor :previous_uri
|
36
|
+
|
37
|
+
attr_accessor :last_uri
|
38
|
+
|
39
|
+
attr_accessor :page_count
|
40
|
+
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
42
|
+
def self.attribute_map
|
43
|
+
{
|
44
|
+
|
45
|
+
:'entities' => :'entities',
|
46
|
+
|
47
|
+
:'page_size' => :'pageSize',
|
48
|
+
|
49
|
+
:'page_number' => :'pageNumber',
|
50
|
+
|
51
|
+
:'total' => :'total',
|
52
|
+
|
53
|
+
:'self_uri' => :'selfUri',
|
54
|
+
|
55
|
+
:'first_uri' => :'firstUri',
|
56
|
+
|
57
|
+
:'next_uri' => :'nextUri',
|
58
|
+
|
59
|
+
:'previous_uri' => :'previousUri',
|
60
|
+
|
61
|
+
:'last_uri' => :'lastUri',
|
62
|
+
|
63
|
+
:'page_count' => :'pageCount'
|
64
|
+
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.swagger_types
|
70
|
+
{
|
71
|
+
|
72
|
+
:'entities' => :'Array<ManagementUnit>',
|
73
|
+
|
74
|
+
:'page_size' => :'Integer',
|
75
|
+
|
76
|
+
:'page_number' => :'Integer',
|
77
|
+
|
78
|
+
:'total' => :'Integer',
|
79
|
+
|
80
|
+
:'self_uri' => :'String',
|
81
|
+
|
82
|
+
:'first_uri' => :'String',
|
83
|
+
|
84
|
+
:'next_uri' => :'String',
|
85
|
+
|
86
|
+
:'previous_uri' => :'String',
|
87
|
+
|
88
|
+
:'last_uri' => :'String',
|
89
|
+
|
90
|
+
:'page_count' => :'Integer'
|
91
|
+
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
# Initializes the object
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
def initialize(attributes = {})
|
98
|
+
return unless attributes.is_a?(Hash)
|
99
|
+
|
100
|
+
# convert string to symbol for hash key
|
101
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
102
|
+
|
103
|
+
|
104
|
+
if attributes.has_key?(:'entities')
|
105
|
+
|
106
|
+
if (value = attributes[:'entities']).is_a?(Array)
|
107
|
+
self.entities = value
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
end
|
113
|
+
|
114
|
+
|
115
|
+
if attributes.has_key?(:'pageSize')
|
116
|
+
|
117
|
+
|
118
|
+
self.page_size = attributes[:'pageSize']
|
119
|
+
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
if attributes.has_key?(:'pageNumber')
|
125
|
+
|
126
|
+
|
127
|
+
self.page_number = attributes[:'pageNumber']
|
128
|
+
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
|
133
|
+
if attributes.has_key?(:'total')
|
134
|
+
|
135
|
+
|
136
|
+
self.total = attributes[:'total']
|
137
|
+
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
|
142
|
+
if attributes.has_key?(:'selfUri')
|
143
|
+
|
144
|
+
|
145
|
+
self.self_uri = attributes[:'selfUri']
|
146
|
+
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
|
151
|
+
if attributes.has_key?(:'firstUri')
|
152
|
+
|
153
|
+
|
154
|
+
self.first_uri = attributes[:'firstUri']
|
155
|
+
|
156
|
+
|
157
|
+
end
|
158
|
+
|
159
|
+
|
160
|
+
if attributes.has_key?(:'nextUri')
|
161
|
+
|
162
|
+
|
163
|
+
self.next_uri = attributes[:'nextUri']
|
164
|
+
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
|
169
|
+
if attributes.has_key?(:'previousUri')
|
170
|
+
|
171
|
+
|
172
|
+
self.previous_uri = attributes[:'previousUri']
|
173
|
+
|
174
|
+
|
175
|
+
end
|
176
|
+
|
177
|
+
|
178
|
+
if attributes.has_key?(:'lastUri')
|
179
|
+
|
180
|
+
|
181
|
+
self.last_uri = attributes[:'lastUri']
|
182
|
+
|
183
|
+
|
184
|
+
end
|
185
|
+
|
186
|
+
|
187
|
+
if attributes.has_key?(:'pageCount')
|
188
|
+
|
189
|
+
|
190
|
+
self.page_count = attributes[:'pageCount']
|
191
|
+
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
|
196
|
+
end
|
197
|
+
|
198
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
199
|
+
# @return Array for valid properies with the reasons
|
200
|
+
def list_invalid_properties
|
201
|
+
invalid_properties = Array.new
|
202
|
+
|
203
|
+
|
204
|
+
return invalid_properties
|
205
|
+
end
|
206
|
+
|
207
|
+
# Check to see if the all the properties in the model are valid
|
208
|
+
# @return true if the model is valid
|
209
|
+
def valid?
|
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
|
+
end
|
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
|
+
# Checks equality by comparing each attribute.
|
305
|
+
# @param [Object] Object to be compared
|
306
|
+
def ==(o)
|
307
|
+
return true if self.equal?(o)
|
308
|
+
self.class == o.class &&
|
309
|
+
entities == o.entities &&
|
310
|
+
page_size == o.page_size &&
|
311
|
+
page_number == o.page_number &&
|
312
|
+
total == o.total &&
|
313
|
+
self_uri == o.self_uri &&
|
314
|
+
first_uri == o.first_uri &&
|
315
|
+
next_uri == o.next_uri &&
|
316
|
+
previous_uri == o.previous_uri &&
|
317
|
+
last_uri == o.last_uri &&
|
318
|
+
page_count == o.page_count
|
319
|
+
end
|
320
|
+
|
321
|
+
# @see the `==` method
|
322
|
+
# @param [Object] Object to be compared
|
323
|
+
def eql?(o)
|
324
|
+
self == o
|
325
|
+
end
|
326
|
+
|
327
|
+
# Calculates hash code according to all attributes.
|
328
|
+
# @return [Fixnum] Hash code
|
329
|
+
def hash
|
330
|
+
[entities, page_size, page_number, total, self_uri, first_uri, next_uri, previous_uri, last_uri, page_count].hash
|
331
|
+
end
|
332
|
+
|
333
|
+
# build the object from hash
|
334
|
+
def build_from_hash(attributes)
|
335
|
+
return nil unless attributes.is_a?(Hash)
|
336
|
+
self.class.swagger_types.each_pair do |key, type|
|
337
|
+
if type =~ /^Array<(.*)>/i
|
338
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
339
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
340
|
+
else
|
341
|
+
#TODO show warning in debug mode
|
342
|
+
end
|
343
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
344
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
345
|
+
else
|
346
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
self
|
351
|
+
end
|
352
|
+
|
353
|
+
def _deserialize(type, value)
|
354
|
+
case type.to_sym
|
355
|
+
when :DateTime
|
356
|
+
DateTime.parse(value)
|
357
|
+
when :Date
|
358
|
+
Date.parse(value)
|
359
|
+
when :String
|
360
|
+
value.to_s
|
361
|
+
when :Integer
|
362
|
+
value.to_i
|
363
|
+
when :Float
|
364
|
+
value.to_f
|
365
|
+
when :BOOLEAN
|
366
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
367
|
+
true
|
368
|
+
else
|
369
|
+
false
|
370
|
+
end
|
371
|
+
when :Object
|
372
|
+
# generic object (usually a Hash), return directly
|
373
|
+
value
|
374
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
375
|
+
inner_type = Regexp.last_match[:inner_type]
|
376
|
+
value.map { |v| _deserialize(inner_type, v) }
|
377
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
378
|
+
k_type = Regexp.last_match[:k_type]
|
379
|
+
v_type = Regexp.last_match[:v_type]
|
380
|
+
{}.tap do |hash|
|
381
|
+
value.each do |k, v|
|
382
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
383
|
+
end
|
384
|
+
end
|
385
|
+
else # model
|
386
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
387
|
+
_model.build_from_hash(value)
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
def to_s
|
392
|
+
to_hash.to_s
|
393
|
+
end
|
394
|
+
|
395
|
+
# to_body is an alias to to_body (backward compatibility))
|
396
|
+
def to_body
|
397
|
+
to_hash
|
398
|
+
end
|
399
|
+
|
400
|
+
# return the object in the form of hash
|
401
|
+
def to_hash
|
402
|
+
hash = {}
|
403
|
+
self.class.attribute_map.each_pair do |attr, param|
|
404
|
+
value = self.send(attr)
|
405
|
+
next if value.nil?
|
406
|
+
hash[param] = _to_hash(value)
|
407
|
+
end
|
408
|
+
hash
|
409
|
+
end
|
410
|
+
|
411
|
+
# Method to output non-array value in the form of hash
|
412
|
+
# For object, use to_hash. Otherwise, just return the value
|
413
|
+
def _to_hash(value)
|
414
|
+
if value.is_a?(Array)
|
415
|
+
value.compact.map{ |v| _to_hash(v) }
|
416
|
+
elsif value.is_a?(Hash)
|
417
|
+
{}.tap do |hash|
|
418
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
419
|
+
end
|
420
|
+
elsif value.respond_to? :to_hash
|
421
|
+
value.to_hash
|
422
|
+
else
|
423
|
+
value
|
424
|
+
end
|
425
|
+
end
|
426
|
+
|
427
|
+
end
|
428
|
+
end
|