purecloud 0.57.1 → 0.58.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/config-ruby.json +1 -1
- data/doc_out/CreateCallbackCommand.html.md +0 -2
- data/doc_out/CreateQueueRequest.html.md +1 -0
- data/doc_out/DomainOrganizationRole.html.md +1 -1
- data/doc_out/DomainOrganizationRoleCreate.html.md +1 -1
- data/doc_out/DomainOrganizationRoleUpdate.html.md +1 -1
- data/doc_out/JsonNode.html.md +3 -3
- data/doc_out/Location.html.md +5 -9
- data/doc_out/LocationDefinition.html.md +21 -0
- data/doc_out/LocationsApi.html.md +4 -4
- data/doc_out/LocationsSearchResponse.html.md +1 -1
- data/doc_out/Queue.html.md +1 -0
- data/doc_out/QueueEmailAddress.html.md +14 -0
- data/doc_out/RecordingApi.html.md +8 -6
- data/doc_out/RoutingApi.html.md +13 -3
- data/doc_out/Site.html.md +1 -1
- data/doc_out/User.html.md +1 -0
- data/doc_out/UserMe.html.md +2 -1
- data/doc_out/UserQueue.html.md +1 -0
- data/doc_out/index.html.md +3 -3
- data/lib/purecloud.rb +2 -0
- data/lib/purecloud/api/locations_api.rb +6 -6
- data/lib/purecloud/api/recording_api.rb +12 -10
- data/lib/purecloud/api/routing_api.rb +12 -0
- data/lib/purecloud/api_client.rb +1 -1
- data/lib/purecloud/models/create_callback_command.rb +1 -25
- data/lib/purecloud/models/create_queue_request.rb +11 -1
- data/lib/purecloud/models/domain_organization_role.rb +13 -13
- data/lib/purecloud/models/domain_organization_role_create.rb +13 -13
- data/lib/purecloud/models/domain_organization_role_update.rb +13 -13
- data/lib/purecloud/models/json_node.rb +32 -32
- data/lib/purecloud/models/location.rb +27 -81
- data/lib/purecloud/models/location_definition.rb +261 -0
- data/lib/purecloud/models/locations_search_response.rb +1 -1
- data/lib/purecloud/models/queue.rb +11 -1
- data/lib/purecloud/models/queue_email_address.rb +175 -0
- data/lib/purecloud/models/site.rb +1 -1
- data/lib/purecloud/models/user.rb +14 -1
- data/lib/purecloud/models/user_me.rb +22 -9
- data/lib/purecloud/models/user_queue.rb +11 -1
- data/lib/purecloud/version.rb +1 -1
- data/newVersion.md +1 -1
- data/swagger.json +1 -1
- data/version.json +1 -1
- metadata +6 -2
@@ -18,10 +18,6 @@ require 'date'
|
|
18
18
|
|
19
19
|
module PureCloud
|
20
20
|
class JsonNode
|
21
|
-
attr_accessor :array
|
22
|
-
|
23
|
-
attr_accessor :null
|
24
|
-
|
25
21
|
attr_accessor :node_type
|
26
22
|
|
27
23
|
attr_accessor :object
|
@@ -38,6 +34,8 @@ module PureCloud
|
|
38
34
|
|
39
35
|
attr_accessor :missing_node
|
40
36
|
|
37
|
+
attr_accessor :pojo
|
38
|
+
|
41
39
|
attr_accessor :integral_number
|
42
40
|
|
43
41
|
attr_accessor :floating_point_number
|
@@ -58,16 +56,14 @@ module PureCloud
|
|
58
56
|
|
59
57
|
attr_accessor :binary
|
60
58
|
|
61
|
-
attr_accessor :
|
59
|
+
attr_accessor :array
|
60
|
+
|
61
|
+
attr_accessor :null
|
62
62
|
|
63
63
|
# Attribute mapping from ruby-style variable name to JSON key.
|
64
64
|
def self.attribute_map
|
65
65
|
{
|
66
66
|
|
67
|
-
:'array' => :'array',
|
68
|
-
|
69
|
-
:'null' => :'null',
|
70
|
-
|
71
67
|
:'node_type' => :'nodeType',
|
72
68
|
|
73
69
|
:'object' => :'object',
|
@@ -84,6 +80,8 @@ module PureCloud
|
|
84
80
|
|
85
81
|
:'missing_node' => :'missingNode',
|
86
82
|
|
83
|
+
:'pojo' => :'pojo',
|
84
|
+
|
87
85
|
:'integral_number' => :'integralNumber',
|
88
86
|
|
89
87
|
:'floating_point_number' => :'floatingPointNumber',
|
@@ -104,7 +102,9 @@ module PureCloud
|
|
104
102
|
|
105
103
|
:'binary' => :'binary',
|
106
104
|
|
107
|
-
:'
|
105
|
+
:'array' => :'array',
|
106
|
+
|
107
|
+
:'null' => :'null'
|
108
108
|
|
109
109
|
}
|
110
110
|
end
|
@@ -112,8 +112,6 @@ module PureCloud
|
|
112
112
|
# Attribute type mapping.
|
113
113
|
def self.swagger_types
|
114
114
|
{
|
115
|
-
:'array' => :'BOOLEAN',
|
116
|
-
:'null' => :'BOOLEAN',
|
117
115
|
:'node_type' => :'String',
|
118
116
|
:'object' => :'BOOLEAN',
|
119
117
|
:'boolean' => :'BOOLEAN',
|
@@ -122,6 +120,7 @@ module PureCloud
|
|
122
120
|
:'value_node' => :'BOOLEAN',
|
123
121
|
:'container_node' => :'BOOLEAN',
|
124
122
|
:'missing_node' => :'BOOLEAN',
|
123
|
+
:'pojo' => :'BOOLEAN',
|
125
124
|
:'integral_number' => :'BOOLEAN',
|
126
125
|
:'floating_point_number' => :'BOOLEAN',
|
127
126
|
:'short' => :'BOOLEAN',
|
@@ -132,7 +131,8 @@ module PureCloud
|
|
132
131
|
:'big_integer' => :'BOOLEAN',
|
133
132
|
:'textual' => :'BOOLEAN',
|
134
133
|
:'binary' => :'BOOLEAN',
|
135
|
-
:'
|
134
|
+
:'array' => :'BOOLEAN',
|
135
|
+
:'null' => :'BOOLEAN'
|
136
136
|
|
137
137
|
}
|
138
138
|
end
|
@@ -144,18 +144,6 @@ module PureCloud
|
|
144
144
|
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
145
145
|
|
146
146
|
|
147
|
-
if attributes[:'array']
|
148
|
-
self.array = attributes[:'array']
|
149
|
-
else
|
150
|
-
self.array = false
|
151
|
-
end
|
152
|
-
|
153
|
-
if attributes[:'null']
|
154
|
-
self.null = attributes[:'null']
|
155
|
-
else
|
156
|
-
self.null = false
|
157
|
-
end
|
158
|
-
|
159
147
|
if attributes[:'nodeType']
|
160
148
|
self.node_type = attributes[:'nodeType']
|
161
149
|
end
|
@@ -202,6 +190,12 @@ module PureCloud
|
|
202
190
|
self.missing_node = false
|
203
191
|
end
|
204
192
|
|
193
|
+
if attributes[:'pojo']
|
194
|
+
self.pojo = attributes[:'pojo']
|
195
|
+
else
|
196
|
+
self.pojo = false
|
197
|
+
end
|
198
|
+
|
205
199
|
if attributes[:'integralNumber']
|
206
200
|
self.integral_number = attributes[:'integralNumber']
|
207
201
|
else
|
@@ -262,10 +256,16 @@ module PureCloud
|
|
262
256
|
self.binary = false
|
263
257
|
end
|
264
258
|
|
265
|
-
if attributes[:'
|
266
|
-
self.
|
259
|
+
if attributes[:'array']
|
260
|
+
self.array = attributes[:'array']
|
267
261
|
else
|
268
|
-
self.
|
262
|
+
self.array = false
|
263
|
+
end
|
264
|
+
|
265
|
+
if attributes[:'null']
|
266
|
+
self.null = attributes[:'null']
|
267
|
+
else
|
268
|
+
self.null = false
|
269
269
|
end
|
270
270
|
|
271
271
|
end
|
@@ -283,8 +283,6 @@ module PureCloud
|
|
283
283
|
def ==(o)
|
284
284
|
return true if self.equal?(o)
|
285
285
|
self.class == o.class &&
|
286
|
-
array == o.array &&
|
287
|
-
null == o.null &&
|
288
286
|
node_type == o.node_type &&
|
289
287
|
object == o.object &&
|
290
288
|
boolean == o.boolean &&
|
@@ -293,6 +291,7 @@ module PureCloud
|
|
293
291
|
value_node == o.value_node &&
|
294
292
|
container_node == o.container_node &&
|
295
293
|
missing_node == o.missing_node &&
|
294
|
+
pojo == o.pojo &&
|
296
295
|
integral_number == o.integral_number &&
|
297
296
|
floating_point_number == o.floating_point_number &&
|
298
297
|
short == o.short &&
|
@@ -303,7 +302,8 @@ module PureCloud
|
|
303
302
|
big_integer == o.big_integer &&
|
304
303
|
textual == o.textual &&
|
305
304
|
binary == o.binary &&
|
306
|
-
|
305
|
+
array == o.array &&
|
306
|
+
null == o.null
|
307
307
|
end
|
308
308
|
|
309
309
|
# @see the `==` method
|
@@ -313,7 +313,7 @@ module PureCloud
|
|
313
313
|
|
314
314
|
# Calculate hash code according to all attributes.
|
315
315
|
def hash
|
316
|
-
[
|
316
|
+
[node_type, object, boolean, number, float, value_node, container_node, missing_node, pojo, integral_number, floating_point_number, short, int, long, double, big_decimal, big_integer, textual, binary, array, null].hash
|
317
317
|
end
|
318
318
|
|
319
319
|
# build the object from hash
|
@@ -18,26 +18,15 @@ require 'date'
|
|
18
18
|
|
19
19
|
module PureCloud
|
20
20
|
class Location
|
21
|
-
# The globally unique identifier for the object.
|
22
21
|
attr_accessor :id
|
23
22
|
|
24
|
-
attr_accessor :
|
23
|
+
attr_accessor :floorplan_id
|
25
24
|
|
26
|
-
attr_accessor :
|
25
|
+
attr_accessor :coordinates
|
27
26
|
|
28
|
-
attr_accessor :
|
27
|
+
attr_accessor :notes
|
29
28
|
|
30
|
-
attr_accessor :
|
31
|
-
|
32
|
-
# Current activity status of the location.
|
33
|
-
attr_accessor :state
|
34
|
-
|
35
|
-
attr_accessor :version
|
36
|
-
|
37
|
-
attr_accessor :path
|
38
|
-
|
39
|
-
# The URI for this object
|
40
|
-
attr_accessor :self_uri
|
29
|
+
attr_accessor :location_definition
|
41
30
|
|
42
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
32
|
def self.attribute_map
|
@@ -45,21 +34,13 @@ module PureCloud
|
|
45
34
|
|
46
35
|
:'id' => :'id',
|
47
36
|
|
48
|
-
:'
|
49
|
-
|
50
|
-
:'address' => :'address',
|
51
|
-
|
52
|
-
:'address_verified' => :'addressVerified',
|
37
|
+
:'floorplan_id' => :'floorplanId',
|
53
38
|
|
54
|
-
:'
|
39
|
+
:'coordinates' => :'coordinates',
|
55
40
|
|
56
|
-
:'
|
41
|
+
:'notes' => :'notes',
|
57
42
|
|
58
|
-
:'
|
59
|
-
|
60
|
-
:'path' => :'path',
|
61
|
-
|
62
|
-
:'self_uri' => :'selfUri'
|
43
|
+
:'location_definition' => :'locationDefinition'
|
63
44
|
|
64
45
|
}
|
65
46
|
end
|
@@ -68,14 +49,10 @@ module PureCloud
|
|
68
49
|
def self.swagger_types
|
69
50
|
{
|
70
51
|
:'id' => :'String',
|
71
|
-
:'
|
72
|
-
:'
|
73
|
-
:'
|
74
|
-
:'
|
75
|
-
:'state' => :'String',
|
76
|
-
:'version' => :'Integer',
|
77
|
-
:'path' => :'Array<String>',
|
78
|
-
:'self_uri' => :'String'
|
52
|
+
:'floorplan_id' => :'String',
|
53
|
+
:'coordinates' => :'Hash<String, Float>',
|
54
|
+
:'notes' => :'String',
|
55
|
+
:'location_definition' => :'LocationDefinition'
|
79
56
|
|
80
57
|
}
|
81
58
|
end
|
@@ -91,51 +68,24 @@ module PureCloud
|
|
91
68
|
self.id = attributes[:'id']
|
92
69
|
end
|
93
70
|
|
94
|
-
if attributes[:'
|
95
|
-
self.
|
96
|
-
end
|
97
|
-
|
98
|
-
if attributes[:'address']
|
99
|
-
self.address = attributes[:'address']
|
100
|
-
end
|
101
|
-
|
102
|
-
if attributes[:'addressVerified']
|
103
|
-
self.address_verified = attributes[:'addressVerified']
|
104
|
-
else
|
105
|
-
self.address_verified = false
|
106
|
-
end
|
107
|
-
|
108
|
-
if attributes[:'emergencyNumber']
|
109
|
-
self.emergency_number = attributes[:'emergencyNumber']
|
110
|
-
end
|
111
|
-
|
112
|
-
if attributes[:'state']
|
113
|
-
self.state = attributes[:'state']
|
71
|
+
if attributes[:'floorplanId']
|
72
|
+
self.floorplan_id = attributes[:'floorplanId']
|
114
73
|
end
|
115
74
|
|
116
|
-
if attributes[:'
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
if attributes[:'path']
|
121
|
-
if (value = attributes[:'path']).is_a?(Array)
|
122
|
-
self.path = value
|
75
|
+
if attributes[:'coordinates']
|
76
|
+
if (value = attributes[:'coordinates']).is_a?(Array)
|
77
|
+
self.coordinates = value
|
123
78
|
end
|
124
79
|
end
|
125
80
|
|
126
|
-
if attributes[:'
|
127
|
-
self.
|
81
|
+
if attributes[:'notes']
|
82
|
+
self.notes = attributes[:'notes']
|
128
83
|
end
|
129
84
|
|
130
|
-
|
131
|
-
|
132
|
-
# Custom attribute writer method checking allowed values (enum).
|
133
|
-
def state=(state)
|
134
|
-
allowed_values = ["active", "deleted"]
|
135
|
-
if state && !allowed_values.include?(state)
|
136
|
-
fail "invalid value for 'state', must be one of #{allowed_values}"
|
85
|
+
if attributes[:'locationDefinition']
|
86
|
+
self.location_definition = attributes[:'locationDefinition']
|
137
87
|
end
|
138
|
-
|
88
|
+
|
139
89
|
end
|
140
90
|
|
141
91
|
# Check equality by comparing each attribute.
|
@@ -143,14 +93,10 @@ module PureCloud
|
|
143
93
|
return true if self.equal?(o)
|
144
94
|
self.class == o.class &&
|
145
95
|
id == o.id &&
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
state == o.state &&
|
151
|
-
version == o.version &&
|
152
|
-
path == o.path &&
|
153
|
-
self_uri == o.self_uri
|
96
|
+
floorplan_id == o.floorplan_id &&
|
97
|
+
coordinates == o.coordinates &&
|
98
|
+
notes == o.notes &&
|
99
|
+
location_definition == o.location_definition
|
154
100
|
end
|
155
101
|
|
156
102
|
# @see the `==` method
|
@@ -160,7 +106,7 @@ module PureCloud
|
|
160
106
|
|
161
107
|
# Calculate hash code according to all attributes.
|
162
108
|
def hash
|
163
|
-
[id,
|
109
|
+
[id, floorplan_id, coordinates, notes, location_definition].hash
|
164
110
|
end
|
165
111
|
|
166
112
|
# build the object from hash
|
@@ -0,0 +1,261 @@
|
|
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@inin.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 LocationDefinition
|
21
|
+
# The globally unique identifier for the object.
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
attr_accessor :address
|
27
|
+
|
28
|
+
attr_accessor :address_verified
|
29
|
+
|
30
|
+
attr_accessor :emergency_number
|
31
|
+
|
32
|
+
# Current activity status of the location.
|
33
|
+
attr_accessor :state
|
34
|
+
|
35
|
+
attr_accessor :version
|
36
|
+
|
37
|
+
attr_accessor :path
|
38
|
+
|
39
|
+
# The URI for this object
|
40
|
+
attr_accessor :self_uri
|
41
|
+
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
43
|
+
def self.attribute_map
|
44
|
+
{
|
45
|
+
|
46
|
+
:'id' => :'id',
|
47
|
+
|
48
|
+
:'name' => :'name',
|
49
|
+
|
50
|
+
:'address' => :'address',
|
51
|
+
|
52
|
+
:'address_verified' => :'addressVerified',
|
53
|
+
|
54
|
+
:'emergency_number' => :'emergencyNumber',
|
55
|
+
|
56
|
+
:'state' => :'state',
|
57
|
+
|
58
|
+
:'version' => :'version',
|
59
|
+
|
60
|
+
:'path' => :'path',
|
61
|
+
|
62
|
+
:'self_uri' => :'selfUri'
|
63
|
+
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Attribute type mapping.
|
68
|
+
def self.swagger_types
|
69
|
+
{
|
70
|
+
:'id' => :'String',
|
71
|
+
:'name' => :'String',
|
72
|
+
:'address' => :'LocationAddress',
|
73
|
+
:'address_verified' => :'BOOLEAN',
|
74
|
+
:'emergency_number' => :'LocationEmergencyNumber',
|
75
|
+
:'state' => :'String',
|
76
|
+
:'version' => :'Integer',
|
77
|
+
:'path' => :'Array<String>',
|
78
|
+
:'self_uri' => :'String'
|
79
|
+
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
def initialize(attributes = {})
|
84
|
+
return unless attributes.is_a?(Hash)
|
85
|
+
|
86
|
+
# convert string to symbol for hash key
|
87
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
88
|
+
|
89
|
+
|
90
|
+
if attributes[:'id']
|
91
|
+
self.id = attributes[:'id']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes[:'name']
|
95
|
+
self.name = attributes[:'name']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes[:'address']
|
99
|
+
self.address = attributes[:'address']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes[:'addressVerified']
|
103
|
+
self.address_verified = attributes[:'addressVerified']
|
104
|
+
else
|
105
|
+
self.address_verified = false
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes[:'emergencyNumber']
|
109
|
+
self.emergency_number = attributes[:'emergencyNumber']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes[:'state']
|
113
|
+
self.state = attributes[:'state']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes[:'version']
|
117
|
+
self.version = attributes[:'version']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes[:'path']
|
121
|
+
if (value = attributes[:'path']).is_a?(Array)
|
122
|
+
self.path = value
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes[:'selfUri']
|
127
|
+
self.self_uri = attributes[:'selfUri']
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
# Custom attribute writer method checking allowed values (enum).
|
133
|
+
def state=(state)
|
134
|
+
allowed_values = ["active", "deleted"]
|
135
|
+
if state && !allowed_values.include?(state)
|
136
|
+
fail "invalid value for 'state', must be one of #{allowed_values}"
|
137
|
+
end
|
138
|
+
@state = state
|
139
|
+
end
|
140
|
+
|
141
|
+
# Check equality by comparing each attribute.
|
142
|
+
def ==(o)
|
143
|
+
return true if self.equal?(o)
|
144
|
+
self.class == o.class &&
|
145
|
+
id == o.id &&
|
146
|
+
name == o.name &&
|
147
|
+
address == o.address &&
|
148
|
+
address_verified == o.address_verified &&
|
149
|
+
emergency_number == o.emergency_number &&
|
150
|
+
state == o.state &&
|
151
|
+
version == o.version &&
|
152
|
+
path == o.path &&
|
153
|
+
self_uri == o.self_uri
|
154
|
+
end
|
155
|
+
|
156
|
+
# @see the `==` method
|
157
|
+
def eql?(o)
|
158
|
+
self == o
|
159
|
+
end
|
160
|
+
|
161
|
+
# Calculate hash code according to all attributes.
|
162
|
+
def hash
|
163
|
+
[id, name, address, address_verified, emergency_number, state, version, path, self_uri].hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# build the object from hash
|
167
|
+
def build_from_hash(attributes)
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
169
|
+
self.class.swagger_types.each_pair do |key, type|
|
170
|
+
if type =~ /^Array<(.*)>/i
|
171
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
172
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
173
|
+
else
|
174
|
+
#TODO show warning in debug mode
|
175
|
+
end
|
176
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
177
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
178
|
+
else
|
179
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
self
|
184
|
+
end
|
185
|
+
|
186
|
+
def _deserialize(type, value)
|
187
|
+
case type.to_sym
|
188
|
+
when :DateTime
|
189
|
+
DateTime.parse(value)
|
190
|
+
when :Date
|
191
|
+
Date.parse(value)
|
192
|
+
when :String
|
193
|
+
value.to_s
|
194
|
+
when :Integer
|
195
|
+
value.to_i
|
196
|
+
when :Float
|
197
|
+
value.to_f
|
198
|
+
when :BOOLEAN
|
199
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
200
|
+
true
|
201
|
+
else
|
202
|
+
false
|
203
|
+
end
|
204
|
+
when :Object
|
205
|
+
# generic object (usually a Hash), return directly
|
206
|
+
value
|
207
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
208
|
+
inner_type = Regexp.last_match[:inner_type]
|
209
|
+
value.map { |v| _deserialize(inner_type, v) }
|
210
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
211
|
+
k_type = Regexp.last_match[:k_type]
|
212
|
+
v_type = Regexp.last_match[:v_type]
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each do |k, v|
|
215
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
else # model
|
219
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
220
|
+
_model.build_from_hash(value)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
def to_s
|
225
|
+
to_hash.to_s
|
226
|
+
end
|
227
|
+
|
228
|
+
# to_body is an alias to to_body (backward compatibility))
|
229
|
+
def to_body
|
230
|
+
to_hash
|
231
|
+
end
|
232
|
+
|
233
|
+
# return the object in the form of hash
|
234
|
+
def to_hash
|
235
|
+
hash = {}
|
236
|
+
self.class.attribute_map.each_pair do |attr, param|
|
237
|
+
value = self.send(attr)
|
238
|
+
next if value.nil?
|
239
|
+
hash[param] = _to_hash(value)
|
240
|
+
end
|
241
|
+
hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Method to output non-array value in the form of hash
|
245
|
+
# For object, use to_hash. Otherwise, just return the value
|
246
|
+
def _to_hash(value)
|
247
|
+
if value.is_a?(Array)
|
248
|
+
value.compact.map{ |v| _to_hash(v) }
|
249
|
+
elsif value.is_a?(Hash)
|
250
|
+
{}.tap do |hash|
|
251
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
252
|
+
end
|
253
|
+
elsif value.respond_to? :to_hash
|
254
|
+
value.to_hash
|
255
|
+
else
|
256
|
+
value
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|
261
|
+
end
|