purecloudplatformclientv2 15.0.0 → 16.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -36,10 +36,10 @@ module PureCloud
|
|
36
36
|
# Optional unless patch operation.
|
37
37
|
attr_accessor :role_needs_update
|
38
38
|
|
39
|
-
attr_accessor :default
|
40
|
-
|
41
39
|
attr_accessor :base
|
42
40
|
|
41
|
+
attr_accessor :default
|
42
|
+
|
43
43
|
# The URI for this object
|
44
44
|
attr_accessor :self_uri
|
45
45
|
|
@@ -63,10 +63,10 @@ module PureCloud
|
|
63
63
|
|
64
64
|
:'role_needs_update' => :'roleNeedsUpdate',
|
65
65
|
|
66
|
-
:'default' => :'default',
|
67
|
-
|
68
66
|
:'base' => :'base',
|
69
67
|
|
68
|
+
:'default' => :'default',
|
69
|
+
|
70
70
|
:'self_uri' => :'selfUri'
|
71
71
|
|
72
72
|
}
|
@@ -92,10 +92,10 @@ module PureCloud
|
|
92
92
|
|
93
93
|
:'role_needs_update' => :'BOOLEAN',
|
94
94
|
|
95
|
-
:'default' => :'BOOLEAN',
|
96
|
-
|
97
95
|
:'base' => :'BOOLEAN',
|
98
96
|
|
97
|
+
:'default' => :'BOOLEAN',
|
98
|
+
|
99
99
|
:'self_uri' => :'String'
|
100
100
|
|
101
101
|
}
|
@@ -186,19 +186,19 @@ module PureCloud
|
|
186
186
|
end
|
187
187
|
|
188
188
|
|
189
|
-
if attributes.has_key?(:'
|
189
|
+
if attributes.has_key?(:'base')
|
190
190
|
|
191
191
|
|
192
|
-
self.
|
192
|
+
self.base = attributes[:'base']
|
193
193
|
|
194
194
|
|
195
195
|
end
|
196
196
|
|
197
197
|
|
198
|
-
if attributes.has_key?(:'
|
198
|
+
if attributes.has_key?(:'default')
|
199
199
|
|
200
200
|
|
201
|
-
self.
|
201
|
+
self.default = attributes[:'default']
|
202
202
|
|
203
203
|
|
204
204
|
end
|
@@ -343,8 +343,8 @@ module PureCloud
|
|
343
343
|
permission_policies == o.permission_policies &&
|
344
344
|
user_count == o.user_count &&
|
345
345
|
role_needs_update == o.role_needs_update &&
|
346
|
-
default == o.default &&
|
347
346
|
base == o.base &&
|
347
|
+
default == o.default &&
|
348
348
|
self_uri == o.self_uri
|
349
349
|
end
|
350
350
|
|
@@ -357,7 +357,7 @@ module PureCloud
|
|
357
357
|
# Calculates hash code according to all attributes.
|
358
358
|
# @return [Fixnum] Hash code
|
359
359
|
def hash
|
360
|
-
[id, name, description, default_role_id, permissions, permission_policies, user_count, role_needs_update,
|
360
|
+
[id, name, description, default_role_id, permissions, permission_policies, user_count, role_needs_update, base, default, self_uri].hash
|
361
361
|
end
|
362
362
|
|
363
363
|
# build the object from hash
|
@@ -37,10 +37,10 @@ module PureCloud
|
|
37
37
|
# Optional unless patch operation.
|
38
38
|
attr_accessor :role_needs_update
|
39
39
|
|
40
|
-
attr_accessor :default
|
41
|
-
|
42
40
|
attr_accessor :base
|
43
41
|
|
42
|
+
attr_accessor :default
|
43
|
+
|
44
44
|
# The URI for this object
|
45
45
|
attr_accessor :self_uri
|
46
46
|
|
@@ -64,10 +64,10 @@ module PureCloud
|
|
64
64
|
|
65
65
|
:'role_needs_update' => :'roleNeedsUpdate',
|
66
66
|
|
67
|
-
:'default' => :'default',
|
68
|
-
|
69
67
|
:'base' => :'base',
|
70
68
|
|
69
|
+
:'default' => :'default',
|
70
|
+
|
71
71
|
:'self_uri' => :'selfUri'
|
72
72
|
|
73
73
|
}
|
@@ -93,10 +93,10 @@ module PureCloud
|
|
93
93
|
|
94
94
|
:'role_needs_update' => :'BOOLEAN',
|
95
95
|
|
96
|
-
:'default' => :'BOOLEAN',
|
97
|
-
|
98
96
|
:'base' => :'BOOLEAN',
|
99
97
|
|
98
|
+
:'default' => :'BOOLEAN',
|
99
|
+
|
100
100
|
:'self_uri' => :'String'
|
101
101
|
|
102
102
|
}
|
@@ -187,19 +187,19 @@ module PureCloud
|
|
187
187
|
end
|
188
188
|
|
189
189
|
|
190
|
-
if attributes.has_key?(:'
|
190
|
+
if attributes.has_key?(:'base')
|
191
191
|
|
192
192
|
|
193
|
-
self.
|
193
|
+
self.base = attributes[:'base']
|
194
194
|
|
195
195
|
|
196
196
|
end
|
197
197
|
|
198
198
|
|
199
|
-
if attributes.has_key?(:'
|
199
|
+
if attributes.has_key?(:'default')
|
200
200
|
|
201
201
|
|
202
|
-
self.
|
202
|
+
self.default = attributes[:'default']
|
203
203
|
|
204
204
|
|
205
205
|
end
|
@@ -349,8 +349,8 @@ module PureCloud
|
|
349
349
|
permission_policies == o.permission_policies &&
|
350
350
|
user_count == o.user_count &&
|
351
351
|
role_needs_update == o.role_needs_update &&
|
352
|
-
default == o.default &&
|
353
352
|
base == o.base &&
|
353
|
+
default == o.default &&
|
354
354
|
self_uri == o.self_uri
|
355
355
|
end
|
356
356
|
|
@@ -363,7 +363,7 @@ module PureCloud
|
|
363
363
|
# Calculates hash code according to all attributes.
|
364
364
|
# @return [Fixnum] Hash code
|
365
365
|
def hash
|
366
|
-
[id, name, description, default_role_id, permissions, permission_policies, user_count, role_needs_update,
|
366
|
+
[id, name, description, default_role_id, permissions, permission_policies, user_count, role_needs_update, base, default, self_uri].hash
|
367
367
|
end
|
368
368
|
|
369
369
|
# build the object from hash
|
@@ -37,10 +37,10 @@ module PureCloud
|
|
37
37
|
# Optional unless patch operation.
|
38
38
|
attr_accessor :role_needs_update
|
39
39
|
|
40
|
-
attr_accessor :default
|
41
|
-
|
42
40
|
attr_accessor :base
|
43
41
|
|
42
|
+
attr_accessor :default
|
43
|
+
|
44
44
|
# The URI for this object
|
45
45
|
attr_accessor :self_uri
|
46
46
|
|
@@ -64,10 +64,10 @@ module PureCloud
|
|
64
64
|
|
65
65
|
:'role_needs_update' => :'roleNeedsUpdate',
|
66
66
|
|
67
|
-
:'default' => :'default',
|
68
|
-
|
69
67
|
:'base' => :'base',
|
70
68
|
|
69
|
+
:'default' => :'default',
|
70
|
+
|
71
71
|
:'self_uri' => :'selfUri'
|
72
72
|
|
73
73
|
}
|
@@ -93,10 +93,10 @@ module PureCloud
|
|
93
93
|
|
94
94
|
:'role_needs_update' => :'BOOLEAN',
|
95
95
|
|
96
|
-
:'default' => :'BOOLEAN',
|
97
|
-
|
98
96
|
:'base' => :'BOOLEAN',
|
99
97
|
|
98
|
+
:'default' => :'BOOLEAN',
|
99
|
+
|
100
100
|
:'self_uri' => :'String'
|
101
101
|
|
102
102
|
}
|
@@ -187,19 +187,19 @@ module PureCloud
|
|
187
187
|
end
|
188
188
|
|
189
189
|
|
190
|
-
if attributes.has_key?(:'
|
190
|
+
if attributes.has_key?(:'base')
|
191
191
|
|
192
192
|
|
193
|
-
self.
|
193
|
+
self.base = attributes[:'base']
|
194
194
|
|
195
195
|
|
196
196
|
end
|
197
197
|
|
198
198
|
|
199
|
-
if attributes.has_key?(:'
|
199
|
+
if attributes.has_key?(:'default')
|
200
200
|
|
201
201
|
|
202
|
-
self.
|
202
|
+
self.default = attributes[:'default']
|
203
203
|
|
204
204
|
|
205
205
|
end
|
@@ -349,8 +349,8 @@ module PureCloud
|
|
349
349
|
permission_policies == o.permission_policies &&
|
350
350
|
user_count == o.user_count &&
|
351
351
|
role_needs_update == o.role_needs_update &&
|
352
|
-
default == o.default &&
|
353
352
|
base == o.base &&
|
353
|
+
default == o.default &&
|
354
354
|
self_uri == o.self_uri
|
355
355
|
end
|
356
356
|
|
@@ -363,7 +363,7 @@ module PureCloud
|
|
363
363
|
# Calculates hash code according to all attributes.
|
364
364
|
# @return [Fixnum] Hash code
|
365
365
|
def hash
|
366
|
-
[id, name, description, default_role_id, permissions, permission_policies, user_count, role_needs_update,
|
366
|
+
[id, name, description, default_role_id, permissions, permission_policies, user_count, role_needs_update, base, default, self_uri].hash
|
367
367
|
end
|
368
368
|
|
369
369
|
# build the object from hash
|
@@ -0,0 +1,231 @@
|
|
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
|
+
# Validation results
|
21
|
+
class DraftValidationResult
|
22
|
+
# Indicates if configuration is valid
|
23
|
+
attr_accessor :valid
|
24
|
+
|
25
|
+
# List of errors causing validation failure
|
26
|
+
attr_accessor :errors
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
|
32
|
+
:'valid' => :'valid',
|
33
|
+
|
34
|
+
:'errors' => :'errors'
|
35
|
+
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
|
43
|
+
:'valid' => :'BOOLEAN',
|
44
|
+
|
45
|
+
:'errors' => :'Array<ErrorBody>'
|
46
|
+
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
57
|
+
|
58
|
+
|
59
|
+
if attributes.has_key?(:'valid')
|
60
|
+
|
61
|
+
|
62
|
+
self.valid = attributes[:'valid']
|
63
|
+
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
if attributes.has_key?(:'errors')
|
69
|
+
|
70
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
71
|
+
self.errors = value
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
+
# @return Array for valid properies with the reasons
|
83
|
+
def list_invalid_properties
|
84
|
+
invalid_properties = Array.new
|
85
|
+
|
86
|
+
|
87
|
+
return invalid_properties
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
# Checks equality by comparing each attribute.
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def ==(o)
|
118
|
+
return true if self.equal?(o)
|
119
|
+
self.class == o.class &&
|
120
|
+
valid == o.valid &&
|
121
|
+
errors == o.errors
|
122
|
+
end
|
123
|
+
|
124
|
+
# @see the `==` method
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def eql?(o)
|
127
|
+
self == o
|
128
|
+
end
|
129
|
+
|
130
|
+
# Calculates hash code according to all attributes.
|
131
|
+
# @return [Fixnum] Hash code
|
132
|
+
def hash
|
133
|
+
[valid, errors].hash
|
134
|
+
end
|
135
|
+
|
136
|
+
# build the object from hash
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
self.class.swagger_types.each_pair do |key, type|
|
140
|
+
if type =~ /^Array<(.*)>/i
|
141
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
142
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
143
|
+
else
|
144
|
+
#TODO show warning in debug mode
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
else
|
149
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
def _deserialize(type, value)
|
157
|
+
case type.to_sym
|
158
|
+
when :DateTime
|
159
|
+
DateTime.parse(value)
|
160
|
+
when :Date
|
161
|
+
Date.parse(value)
|
162
|
+
when :String
|
163
|
+
value.to_s
|
164
|
+
when :Integer
|
165
|
+
value.to_i
|
166
|
+
when :Float
|
167
|
+
value.to_f
|
168
|
+
when :BOOLEAN
|
169
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
170
|
+
true
|
171
|
+
else
|
172
|
+
false
|
173
|
+
end
|
174
|
+
when :Object
|
175
|
+
# generic object (usually a Hash), return directly
|
176
|
+
value
|
177
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
178
|
+
inner_type = Regexp.last_match[:inner_type]
|
179
|
+
value.map { |v| _deserialize(inner_type, v) }
|
180
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
181
|
+
k_type = Regexp.last_match[:k_type]
|
182
|
+
v_type = Regexp.last_match[:v_type]
|
183
|
+
{}.tap do |hash|
|
184
|
+
value.each do |k, v|
|
185
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
else # model
|
189
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
190
|
+
_model.build_from_hash(value)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def to_s
|
195
|
+
to_hash.to_s
|
196
|
+
end
|
197
|
+
|
198
|
+
# to_body is an alias to to_body (backward compatibility))
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# return the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
next if value.nil?
|
209
|
+
hash[param] = _to_hash(value)
|
210
|
+
end
|
211
|
+
hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Method to output non-array value in the form of hash
|
215
|
+
# For object, use to_hash. Otherwise, just return the value
|
216
|
+
def _to_hash(value)
|
217
|
+
if value.is_a?(Array)
|
218
|
+
value.compact.map{ |v| _to_hash(v) }
|
219
|
+
elsif value.is_a?(Hash)
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
222
|
+
end
|
223
|
+
elsif value.respond_to? :to_hash
|
224
|
+
value.to_hash
|
225
|
+
else
|
226
|
+
value
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
231
|
+
end
|