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
@@ -0,0 +1,229 @@
|
|
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
|
+
# Defines components of the Action Config.
|
21
|
+
class ActionConfig
|
22
|
+
# Configuration of outbound request.
|
23
|
+
attr_accessor :request
|
24
|
+
|
25
|
+
# Configuration of response processing.
|
26
|
+
attr_accessor :response
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
|
32
|
+
:'request' => :'request',
|
33
|
+
|
34
|
+
:'response' => :'response'
|
35
|
+
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
|
43
|
+
:'request' => :'RequestConfig',
|
44
|
+
|
45
|
+
:'response' => :'ResponseConfig'
|
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?(:'request')
|
60
|
+
|
61
|
+
|
62
|
+
self.request = attributes[:'request']
|
63
|
+
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
if attributes.has_key?(:'response')
|
69
|
+
|
70
|
+
|
71
|
+
self.response = attributes[:'response']
|
72
|
+
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properies with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
|
84
|
+
|
85
|
+
return invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
# Checks equality by comparing each attribute.
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def ==(o)
|
116
|
+
return true if self.equal?(o)
|
117
|
+
self.class == o.class &&
|
118
|
+
request == o.request &&
|
119
|
+
response == o.response
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Fixnum] Hash code
|
130
|
+
def hash
|
131
|
+
[request, response].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# build the object from hash
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.swagger_types.each_pair do |key, type|
|
138
|
+
if type =~ /^Array<(.*)>/i
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
141
|
+
else
|
142
|
+
#TODO show warning in debug mode
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
+
else
|
147
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :DateTime
|
157
|
+
DateTime.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :BOOLEAN
|
167
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
188
|
+
_model.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_body (backward compatibility))
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# return the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = self.send(attr)
|
206
|
+
next if value.nil?
|
207
|
+
hash[param] = _to_hash(value)
|
208
|
+
end
|
209
|
+
hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Method to output non-array value in the form of hash
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map{ |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,229 @@
|
|
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
|
+
# This resource contains all of the schemas needed to define the inputs and outputs, of a single Action.
|
21
|
+
class ActionContract
|
22
|
+
# The output to expect when executing this action.
|
23
|
+
attr_accessor :output
|
24
|
+
|
25
|
+
# The input required when executing this action.
|
26
|
+
attr_accessor :input
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
|
32
|
+
:'output' => :'output',
|
33
|
+
|
34
|
+
:'input' => :'input'
|
35
|
+
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
|
43
|
+
:'output' => :'ActionOutput',
|
44
|
+
|
45
|
+
:'input' => :'ActionInput'
|
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?(:'output')
|
60
|
+
|
61
|
+
|
62
|
+
self.output = attributes[:'output']
|
63
|
+
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
if attributes.has_key?(:'input')
|
69
|
+
|
70
|
+
|
71
|
+
self.input = attributes[:'input']
|
72
|
+
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properies with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
|
84
|
+
|
85
|
+
return invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
# Checks equality by comparing each attribute.
|
114
|
+
# @param [Object] Object to be compared
|
115
|
+
def ==(o)
|
116
|
+
return true if self.equal?(o)
|
117
|
+
self.class == o.class &&
|
118
|
+
output == o.output &&
|
119
|
+
input == o.input
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Fixnum] Hash code
|
130
|
+
def hash
|
131
|
+
[output, input].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# build the object from hash
|
135
|
+
def build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.swagger_types.each_pair do |key, type|
|
138
|
+
if type =~ /^Array<(.*)>/i
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
141
|
+
else
|
142
|
+
#TODO show warning in debug mode
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
+
else
|
147
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :DateTime
|
157
|
+
DateTime.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :BOOLEAN
|
167
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
188
|
+
_model.build_from_hash(value)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_body (backward compatibility))
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# return the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = self.send(attr)
|
206
|
+
next if value.nil?
|
207
|
+
hash[param] = _to_hash(value)
|
208
|
+
end
|
209
|
+
hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Method to output non-array value in the form of hash
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map{ |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|
229
|
+
end
|