purecloudplatformclientv2 21.0.0 → 22.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/Entity.md +0 -1
- data/docs/GroupProfile.md +18 -0
- data/docs/GroupsApi.md +60 -0
- data/docs/InboundRoute.md +1 -1
- data/docs/JsonNode.md +1 -1
- data/docs/MediaPolicies.md +1 -0
- data/docs/MessageMediaPolicy.md +14 -0
- data/docs/MessageMediaPolicyConditions.md +17 -0
- data/docs/NamedEntity.md +14 -0
- data/docs/OrgOAuthClient.md +1 -1
- data/docs/RoutingApi.md +2 -2
- data/docs/TokenInfo.md +2 -2
- data/docs/UserConversationSummary.md +1 -0
- data/docs/UserExpands.md +19 -0
- data/docs/UserProfile.md +19 -0
- data/docs/UserProfileEntityListing.md +22 -0
- data/docs/UsersApi.md +137 -0
- data/docs/WorkforceManagementApi.md +5 -3
- data/lib/purecloudplatformclientv2.rb +7 -0
- data/lib/purecloudplatformclientv2/api/groups_api.rb +65 -0
- data/lib/purecloudplatformclientv2/api/users_api.rb +200 -0
- data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +14 -1
- data/lib/purecloudplatformclientv2/api_client.rb +1 -1
- data/lib/purecloudplatformclientv2/models/entity.rb +4 -29
- data/lib/purecloudplatformclientv2/models/event_log.rb +2 -2
- data/lib/purecloudplatformclientv2/models/event_message.rb +2 -2
- data/lib/purecloudplatformclientv2/models/group_profile.rb +350 -0
- data/lib/purecloudplatformclientv2/models/inbound_route.rb +7 -7
- data/lib/purecloudplatformclientv2/models/json_node.rb +17 -17
- data/lib/purecloudplatformclientv2/models/media_policies.rb +30 -4
- data/lib/purecloudplatformclientv2/models/message_media_policy.rb +228 -0
- data/lib/purecloudplatformclientv2/models/message_media_policy_conditions.rb +309 -0
- data/lib/purecloudplatformclientv2/models/named_entity.rb +228 -0
- data/lib/purecloudplatformclientv2/models/org_o_auth_client.rb +1 -1
- data/lib/purecloudplatformclientv2/models/token_info.rb +2 -2
- data/lib/purecloudplatformclientv2/models/user_conversation_summary.rb +26 -1
- data/lib/purecloudplatformclientv2/models/user_expands.rb +358 -0
- data/lib/purecloudplatformclientv2/models/user_profile.rb +376 -0
- data/lib/purecloudplatformclientv2/models/user_profile_entity_listing.rb +428 -0
- data/lib/purecloudplatformclientv2/version.rb +1 -1
- metadata +16 -2
@@ -0,0 +1,228 @@
|
|
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 NamedEntity
|
21
|
+
# The globally unique identifier for the object.
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
# The name of the object.
|
25
|
+
attr_accessor :name
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
|
31
|
+
:'id' => :'id',
|
32
|
+
|
33
|
+
:'name' => :'name'
|
34
|
+
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
|
42
|
+
:'id' => :'String',
|
43
|
+
|
44
|
+
:'name' => :'String'
|
45
|
+
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
56
|
+
|
57
|
+
|
58
|
+
if attributes.has_key?(:'id')
|
59
|
+
|
60
|
+
|
61
|
+
self.id = attributes[:'id']
|
62
|
+
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
if attributes.has_key?(:'name')
|
68
|
+
|
69
|
+
|
70
|
+
self.name = attributes[:'name']
|
71
|
+
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
+
# @return Array for valid properies with the reasons
|
80
|
+
def list_invalid_properties
|
81
|
+
invalid_properties = Array.new
|
82
|
+
|
83
|
+
|
84
|
+
return invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def ==(o)
|
115
|
+
return true if self.equal?(o)
|
116
|
+
self.class == o.class &&
|
117
|
+
id == o.id &&
|
118
|
+
name == o.name
|
119
|
+
end
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def eql?(o)
|
124
|
+
self == o
|
125
|
+
end
|
126
|
+
|
127
|
+
# Calculates hash code according to all attributes.
|
128
|
+
# @return [Fixnum] Hash code
|
129
|
+
def hash
|
130
|
+
[id, name].hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# build the object from hash
|
134
|
+
def build_from_hash(attributes)
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
136
|
+
self.class.swagger_types.each_pair do |key, type|
|
137
|
+
if type =~ /^Array<(.*)>/i
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
140
|
+
else
|
141
|
+
#TODO show warning in debug mode
|
142
|
+
end
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
145
|
+
else
|
146
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
self
|
151
|
+
end
|
152
|
+
|
153
|
+
def _deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :DateTime
|
156
|
+
DateTime.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :BOOLEAN
|
166
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
187
|
+
_model.build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
def to_s
|
192
|
+
to_hash.to_s
|
193
|
+
end
|
194
|
+
|
195
|
+
# to_body is an alias to to_body (backward compatibility))
|
196
|
+
def to_body
|
197
|
+
to_hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# return the object in the form of hash
|
201
|
+
def to_hash
|
202
|
+
hash = {}
|
203
|
+
self.class.attribute_map.each_pair do |attr, param|
|
204
|
+
value = self.send(attr)
|
205
|
+
next if value.nil?
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Method to output non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map{ |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
end
|
228
|
+
end
|
@@ -26,6 +26,8 @@ module PureCloud
|
|
26
26
|
|
27
27
|
attr_accessor :email
|
28
28
|
|
29
|
+
attr_accessor :message
|
30
|
+
|
29
31
|
attr_accessor :chat
|
30
32
|
|
31
33
|
attr_accessor :social_expression
|
@@ -44,6 +46,8 @@ module PureCloud
|
|
44
46
|
|
45
47
|
:'email' => :'email',
|
46
48
|
|
49
|
+
:'message' => :'message',
|
50
|
+
|
47
51
|
:'chat' => :'chat',
|
48
52
|
|
49
53
|
:'social_expression' => :'socialExpression',
|
@@ -65,6 +69,8 @@ module PureCloud
|
|
65
69
|
|
66
70
|
:'email' => :'MediaSummary',
|
67
71
|
|
72
|
+
:'message' => :'MediaSummary',
|
73
|
+
|
68
74
|
:'chat' => :'MediaSummary',
|
69
75
|
|
70
76
|
:'social_expression' => :'MediaSummary',
|
@@ -119,6 +125,15 @@ module PureCloud
|
|
119
125
|
end
|
120
126
|
|
121
127
|
|
128
|
+
if attributes.has_key?(:'message')
|
129
|
+
|
130
|
+
|
131
|
+
self.message = attributes[:'message']
|
132
|
+
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
|
122
137
|
if attributes.has_key?(:'chat')
|
123
138
|
|
124
139
|
|
@@ -184,6 +199,10 @@ module PureCloud
|
|
184
199
|
|
185
200
|
|
186
201
|
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
187
206
|
|
188
207
|
|
189
208
|
|
@@ -221,6 +240,11 @@ module PureCloud
|
|
221
240
|
|
222
241
|
|
223
242
|
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
224
248
|
|
225
249
|
|
226
250
|
|
@@ -236,6 +260,7 @@ module PureCloud
|
|
236
260
|
call == o.call &&
|
237
261
|
callback == o.callback &&
|
238
262
|
email == o.email &&
|
263
|
+
message == o.message &&
|
239
264
|
chat == o.chat &&
|
240
265
|
social_expression == o.social_expression &&
|
241
266
|
video == o.video
|
@@ -250,7 +275,7 @@ module PureCloud
|
|
250
275
|
# Calculates hash code according to all attributes.
|
251
276
|
# @return [Fixnum] Hash code
|
252
277
|
def hash
|
253
|
-
[user_id, call, callback, email, chat, social_expression, video].hash
|
278
|
+
[user_id, call, callback, email, message, chat, social_expression, video].hash
|
254
279
|
end
|
255
280
|
|
256
281
|
# build the object from hash
|
@@ -0,0 +1,358 @@
|
|
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 UserExpands
|
21
|
+
# ACD routing status
|
22
|
+
attr_accessor :routing_status
|
23
|
+
|
24
|
+
# Active presence
|
25
|
+
attr_accessor :presence
|
26
|
+
|
27
|
+
# Summary of conversion statistics for conversation types.
|
28
|
+
attr_accessor :conversation_summary
|
29
|
+
|
30
|
+
# Determine if out of office is enabled
|
31
|
+
attr_accessor :out_of_office
|
32
|
+
|
33
|
+
# Current geolocation position
|
34
|
+
attr_accessor :geolocation
|
35
|
+
|
36
|
+
# Effective, default, and last station information
|
37
|
+
attr_accessor :station
|
38
|
+
|
39
|
+
# Roles and permissions assigned to the user
|
40
|
+
attr_accessor :authorization
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
|
46
|
+
:'routing_status' => :'routingStatus',
|
47
|
+
|
48
|
+
:'presence' => :'presence',
|
49
|
+
|
50
|
+
:'conversation_summary' => :'conversationSummary',
|
51
|
+
|
52
|
+
:'out_of_office' => :'outOfOffice',
|
53
|
+
|
54
|
+
:'geolocation' => :'geolocation',
|
55
|
+
|
56
|
+
:'station' => :'station',
|
57
|
+
|
58
|
+
:'authorization' => :'authorization'
|
59
|
+
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute type mapping.
|
64
|
+
def self.swagger_types
|
65
|
+
{
|
66
|
+
|
67
|
+
:'routing_status' => :'RoutingStatus',
|
68
|
+
|
69
|
+
:'presence' => :'UserPresence',
|
70
|
+
|
71
|
+
:'conversation_summary' => :'UserConversationSummary',
|
72
|
+
|
73
|
+
:'out_of_office' => :'OutOfOffice',
|
74
|
+
|
75
|
+
:'geolocation' => :'Geolocation',
|
76
|
+
|
77
|
+
:'station' => :'UserStations',
|
78
|
+
|
79
|
+
:'authorization' => :'UserAuthorization'
|
80
|
+
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# Initializes the object
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
86
|
+
def initialize(attributes = {})
|
87
|
+
return unless attributes.is_a?(Hash)
|
88
|
+
|
89
|
+
# convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
91
|
+
|
92
|
+
|
93
|
+
if attributes.has_key?(:'routingStatus')
|
94
|
+
|
95
|
+
|
96
|
+
self.routing_status = attributes[:'routingStatus']
|
97
|
+
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
if attributes.has_key?(:'presence')
|
103
|
+
|
104
|
+
|
105
|
+
self.presence = attributes[:'presence']
|
106
|
+
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
if attributes.has_key?(:'conversationSummary')
|
112
|
+
|
113
|
+
|
114
|
+
self.conversation_summary = attributes[:'conversationSummary']
|
115
|
+
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
if attributes.has_key?(:'outOfOffice')
|
121
|
+
|
122
|
+
|
123
|
+
self.out_of_office = attributes[:'outOfOffice']
|
124
|
+
|
125
|
+
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
if attributes.has_key?(:'geolocation')
|
130
|
+
|
131
|
+
|
132
|
+
self.geolocation = attributes[:'geolocation']
|
133
|
+
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
if attributes.has_key?(:'station')
|
139
|
+
|
140
|
+
|
141
|
+
self.station = attributes[:'station']
|
142
|
+
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
if attributes.has_key?(:'authorization')
|
148
|
+
|
149
|
+
|
150
|
+
self.authorization = attributes[:'authorization']
|
151
|
+
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
end
|
157
|
+
|
158
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
159
|
+
# @return Array for valid properies with the reasons
|
160
|
+
def list_invalid_properties
|
161
|
+
invalid_properties = Array.new
|
162
|
+
|
163
|
+
|
164
|
+
return invalid_properties
|
165
|
+
end
|
166
|
+
|
167
|
+
# Check to see if the all the properties in the model are valid
|
168
|
+
# @return true if the model is valid
|
169
|
+
def valid?
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
end
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
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
|
+
# Checks equality by comparing each attribute.
|
238
|
+
# @param [Object] Object to be compared
|
239
|
+
def ==(o)
|
240
|
+
return true if self.equal?(o)
|
241
|
+
self.class == o.class &&
|
242
|
+
routing_status == o.routing_status &&
|
243
|
+
presence == o.presence &&
|
244
|
+
conversation_summary == o.conversation_summary &&
|
245
|
+
out_of_office == o.out_of_office &&
|
246
|
+
geolocation == o.geolocation &&
|
247
|
+
station == o.station &&
|
248
|
+
authorization == o.authorization
|
249
|
+
end
|
250
|
+
|
251
|
+
# @see the `==` method
|
252
|
+
# @param [Object] Object to be compared
|
253
|
+
def eql?(o)
|
254
|
+
self == o
|
255
|
+
end
|
256
|
+
|
257
|
+
# Calculates hash code according to all attributes.
|
258
|
+
# @return [Fixnum] Hash code
|
259
|
+
def hash
|
260
|
+
[routing_status, presence, conversation_summary, out_of_office, geolocation, station, authorization].hash
|
261
|
+
end
|
262
|
+
|
263
|
+
# build the object from hash
|
264
|
+
def build_from_hash(attributes)
|
265
|
+
return nil unless attributes.is_a?(Hash)
|
266
|
+
self.class.swagger_types.each_pair do |key, type|
|
267
|
+
if type =~ /^Array<(.*)>/i
|
268
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
269
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
270
|
+
else
|
271
|
+
#TODO show warning in debug mode
|
272
|
+
end
|
273
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
274
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
275
|
+
else
|
276
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
277
|
+
end
|
278
|
+
end
|
279
|
+
|
280
|
+
self
|
281
|
+
end
|
282
|
+
|
283
|
+
def _deserialize(type, value)
|
284
|
+
case type.to_sym
|
285
|
+
when :DateTime
|
286
|
+
DateTime.parse(value)
|
287
|
+
when :Date
|
288
|
+
Date.parse(value)
|
289
|
+
when :String
|
290
|
+
value.to_s
|
291
|
+
when :Integer
|
292
|
+
value.to_i
|
293
|
+
when :Float
|
294
|
+
value.to_f
|
295
|
+
when :BOOLEAN
|
296
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
297
|
+
true
|
298
|
+
else
|
299
|
+
false
|
300
|
+
end
|
301
|
+
when :Object
|
302
|
+
# generic object (usually a Hash), return directly
|
303
|
+
value
|
304
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
305
|
+
inner_type = Regexp.last_match[:inner_type]
|
306
|
+
value.map { |v| _deserialize(inner_type, v) }
|
307
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
308
|
+
k_type = Regexp.last_match[:k_type]
|
309
|
+
v_type = Regexp.last_match[:v_type]
|
310
|
+
{}.tap do |hash|
|
311
|
+
value.each do |k, v|
|
312
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
313
|
+
end
|
314
|
+
end
|
315
|
+
else # model
|
316
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
317
|
+
_model.build_from_hash(value)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
def to_s
|
322
|
+
to_hash.to_s
|
323
|
+
end
|
324
|
+
|
325
|
+
# to_body is an alias to to_body (backward compatibility))
|
326
|
+
def to_body
|
327
|
+
to_hash
|
328
|
+
end
|
329
|
+
|
330
|
+
# return the object in the form of hash
|
331
|
+
def to_hash
|
332
|
+
hash = {}
|
333
|
+
self.class.attribute_map.each_pair do |attr, param|
|
334
|
+
value = self.send(attr)
|
335
|
+
next if value.nil?
|
336
|
+
hash[param] = _to_hash(value)
|
337
|
+
end
|
338
|
+
hash
|
339
|
+
end
|
340
|
+
|
341
|
+
# Method to output non-array value in the form of hash
|
342
|
+
# For object, use to_hash. Otherwise, just return the value
|
343
|
+
def _to_hash(value)
|
344
|
+
if value.is_a?(Array)
|
345
|
+
value.compact.map{ |v| _to_hash(v) }
|
346
|
+
elsif value.is_a?(Hash)
|
347
|
+
{}.tap do |hash|
|
348
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
349
|
+
end
|
350
|
+
elsif value.respond_to? :to_hash
|
351
|
+
value.to_hash
|
352
|
+
else
|
353
|
+
value
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
end
|
358
|
+
end
|