purecloudplatformclientv2 17.0.0 → 18.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/AnalyticsConversation.md +5 -5
- data/docs/AnalyticsConversationSegment.md +9 -9
- data/docs/AnalyticsEvaluation.md +10 -10
- data/docs/AnalyticsParticipant.md +7 -7
- data/docs/AnalyticsSession.md +27 -27
- data/docs/BillingApi.md +75 -0
- data/docs/BillingUsage.md +15 -0
- data/docs/BillingUsageReport.md +18 -0
- data/docs/BillingUsageResource.md +14 -0
- data/docs/CallCommand.md +1 -0
- data/docs/Conversation.md +1 -1
- data/docs/CreateQueueRequest.md +9 -9
- data/docs/DID.md +9 -9
- data/docs/DIDPool.md +9 -9
- data/docs/DirectoryUserDevicesListing.md +22 -0
- data/docs/DomainCertificateAuthority.md +9 -9
- data/docs/DomainLogicalInterface.md +9 -9
- data/docs/DomainOrganizationRole.md +1 -1
- data/docs/DomainOrganizationRoleCreate.md +1 -1
- data/docs/DomainOrganizationRoleUpdate.md +1 -1
- data/docs/DomainPhysicalInterface.md +9 -9
- data/docs/DomainSchemaReference.md +9 -9
- data/docs/Edge.md +10 -10
- data/docs/EdgeGroup.md +9 -9
- data/docs/EdgeLine.md +9 -9
- data/docs/EdgeLogsJob.md +9 -9
- data/docs/EdgeLogsJobFile.md +9 -9
- data/docs/EdgeLogsJobResponse.md +9 -9
- data/docs/EdgeTrunkBase.md +9 -9
- data/docs/Endpoint.md +9 -9
- data/docs/Extension.md +9 -9
- data/docs/ExtensionPool.md +9 -9
- data/docs/IVR.md +9 -9
- data/docs/JsonNode.md +4 -4
- data/docs/Line.md +9 -9
- data/docs/LineBase.md +9 -9
- data/docs/Metabase.md +8 -8
- data/docs/MobileDevicesApi.md +320 -0
- data/docs/NumberPlan.md +9 -9
- data/docs/OutboundApi.md +113 -0
- data/docs/OutboundRoute.md +9 -9
- data/docs/OutboundRouteBase.md +9 -9
- data/docs/OutboundSettings.md +20 -0
- data/docs/Phone.md +9 -9
- data/docs/PhoneBase.md +9 -9
- data/docs/Queue.md +9 -9
- data/docs/Schedule.md +10 -10
- data/docs/ScheduleGroup.md +10 -10
- data/docs/SchemaCategory.md +9 -9
- data/docs/Site.md +9 -9
- data/docs/Trunk.md +9 -9
- data/docs/TrunkBase.md +9 -9
- data/docs/UserDevice.md +22 -0
- data/docs/UserQueue.md +9 -9
- data/docs/UsersApi.md +1 -1
- data/lib/purecloudplatformclientv2.rb +8 -0
- data/lib/purecloudplatformclientv2/api/billing_api.rb +104 -0
- data/lib/purecloudplatformclientv2/api/mobile_devices_api.rb +380 -0
- data/lib/purecloudplatformclientv2/api/outbound_api.rb +119 -0
- data/lib/purecloudplatformclientv2/api/users_api.rb +2 -2
- data/lib/purecloudplatformclientv2/api_client.rb +1 -1
- data/lib/purecloudplatformclientv2/models/analytics_conversation.rb +5 -2
- data/lib/purecloudplatformclientv2/models/analytics_conversation_segment.rb +9 -2
- data/lib/purecloudplatformclientv2/models/analytics_evaluation.rb +10 -0
- data/lib/purecloudplatformclientv2/models/analytics_participant.rb +7 -0
- data/lib/purecloudplatformclientv2/models/analytics_session.rb +42 -2
- data/lib/purecloudplatformclientv2/models/billing_usage.rb +271 -0
- data/lib/purecloudplatformclientv2/models/billing_usage_report.rb +348 -0
- data/lib/purecloudplatformclientv2/models/billing_usage_resource.rb +238 -0
- data/lib/purecloudplatformclientv2/models/call_command.rb +30 -4
- data/lib/purecloudplatformclientv2/models/conversation.rb +1 -1
- data/lib/purecloudplatformclientv2/models/create_queue_request.rb +9 -2
- data/lib/purecloudplatformclientv2/models/did.rb +9 -2
- data/lib/purecloudplatformclientv2/models/did_pool.rb +9 -2
- data/lib/purecloudplatformclientv2/models/directory_user_devices_listing.rb +428 -0
- data/lib/purecloudplatformclientv2/models/domain_certificate_authority.rb +9 -2
- data/lib/purecloudplatformclientv2/models/domain_logical_interface.rb +9 -2
- 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/domain_physical_interface.rb +9 -2
- data/lib/purecloudplatformclientv2/models/domain_schema_reference.rb +9 -2
- data/lib/purecloudplatformclientv2/models/edge.rb +10 -2
- data/lib/purecloudplatformclientv2/models/edge_group.rb +9 -2
- data/lib/purecloudplatformclientv2/models/edge_line.rb +9 -2
- data/lib/purecloudplatformclientv2/models/edge_logs_job.rb +9 -2
- data/lib/purecloudplatformclientv2/models/edge_logs_job_file.rb +9 -2
- data/lib/purecloudplatformclientv2/models/edge_logs_job_response.rb +9 -2
- data/lib/purecloudplatformclientv2/models/edge_trunk_base.rb +9 -2
- data/lib/purecloudplatformclientv2/models/endpoint.rb +9 -2
- data/lib/purecloudplatformclientv2/models/extension.rb +9 -2
- data/lib/purecloudplatformclientv2/models/extension_pool.rb +9 -2
- data/lib/purecloudplatformclientv2/models/intraday_data_group.rb +2 -2
- data/lib/purecloudplatformclientv2/models/intraday_data_update_notification_intraday_data_group.rb +2 -2
- data/lib/purecloudplatformclientv2/models/intraday_data_update_notification_intraday_data_groupings.rb +2 -2
- data/lib/purecloudplatformclientv2/models/ivr.rb +9 -2
- data/lib/purecloudplatformclientv2/models/json_node.rb +72 -72
- data/lib/purecloudplatformclientv2/models/line.rb +9 -2
- data/lib/purecloudplatformclientv2/models/line_base.rb +9 -2
- data/lib/purecloudplatformclientv2/models/metabase.rb +8 -2
- data/lib/purecloudplatformclientv2/models/number_plan.rb +9 -2
- data/lib/purecloudplatformclientv2/models/outbound_route.rb +9 -2
- data/lib/purecloudplatformclientv2/models/outbound_route_base.rb +9 -2
- data/lib/purecloudplatformclientv2/models/outbound_settings.rb +383 -0
- data/lib/purecloudplatformclientv2/models/phone.rb +9 -2
- data/lib/purecloudplatformclientv2/models/phone_base.rb +9 -2
- data/lib/purecloudplatformclientv2/models/queue.rb +9 -2
- data/lib/purecloudplatformclientv2/models/recording.rb +2 -2
- data/lib/purecloudplatformclientv2/models/schedule.rb +15 -2
- data/lib/purecloudplatformclientv2/models/schedule_group.rb +15 -2
- data/lib/purecloudplatformclientv2/models/schema_category.rb +9 -2
- data/lib/purecloudplatformclientv2/models/site.rb +9 -2
- data/lib/purecloudplatformclientv2/models/trunk.rb +9 -2
- data/lib/purecloudplatformclientv2/models/trunk_base.rb +9 -2
- data/lib/purecloudplatformclientv2/models/user_device.rb +478 -0
- data/lib/purecloudplatformclientv2/models/user_queue.rb +9 -2
- data/lib/purecloudplatformclientv2/version.rb +1 -1
- metadata +19 -3
@@ -0,0 +1,348 @@
|
|
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 BillingUsageReport
|
21
|
+
# The globally unique identifier for the object.
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
# The period start date. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
|
27
|
+
attr_accessor :start_date
|
28
|
+
|
29
|
+
# The period end date. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
|
30
|
+
attr_accessor :end_date
|
31
|
+
|
32
|
+
# The usages for the given period.
|
33
|
+
attr_accessor :usages
|
34
|
+
|
35
|
+
# The URI for this object
|
36
|
+
attr_accessor :self_uri
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
|
42
|
+
:'id' => :'id',
|
43
|
+
|
44
|
+
:'name' => :'name',
|
45
|
+
|
46
|
+
:'start_date' => :'startDate',
|
47
|
+
|
48
|
+
:'end_date' => :'endDate',
|
49
|
+
|
50
|
+
:'usages' => :'usages',
|
51
|
+
|
52
|
+
:'self_uri' => :'selfUri'
|
53
|
+
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.swagger_types
|
59
|
+
{
|
60
|
+
|
61
|
+
:'id' => :'String',
|
62
|
+
|
63
|
+
:'name' => :'String',
|
64
|
+
|
65
|
+
:'start_date' => :'DateTime',
|
66
|
+
|
67
|
+
:'end_date' => :'DateTime',
|
68
|
+
|
69
|
+
:'usages' => :'Array<BillingUsage>',
|
70
|
+
|
71
|
+
:'self_uri' => :'String'
|
72
|
+
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# Initializes the object
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
78
|
+
def initialize(attributes = {})
|
79
|
+
return unless attributes.is_a?(Hash)
|
80
|
+
|
81
|
+
# convert string to symbol for hash key
|
82
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
83
|
+
|
84
|
+
|
85
|
+
if attributes.has_key?(:'id')
|
86
|
+
|
87
|
+
|
88
|
+
self.id = attributes[:'id']
|
89
|
+
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
|
94
|
+
if attributes.has_key?(:'name')
|
95
|
+
|
96
|
+
|
97
|
+
self.name = attributes[:'name']
|
98
|
+
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
if attributes.has_key?(:'startDate')
|
104
|
+
|
105
|
+
|
106
|
+
self.start_date = attributes[:'startDate']
|
107
|
+
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
|
112
|
+
if attributes.has_key?(:'endDate')
|
113
|
+
|
114
|
+
|
115
|
+
self.end_date = attributes[:'endDate']
|
116
|
+
|
117
|
+
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
if attributes.has_key?(:'usages')
|
122
|
+
|
123
|
+
if (value = attributes[:'usages']).is_a?(Array)
|
124
|
+
self.usages = value
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
if attributes.has_key?(:'selfUri')
|
133
|
+
|
134
|
+
|
135
|
+
self.self_uri = attributes[:'selfUri']
|
136
|
+
|
137
|
+
|
138
|
+
end
|
139
|
+
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
144
|
+
# @return Array for valid properies with the reasons
|
145
|
+
def list_invalid_properties
|
146
|
+
invalid_properties = Array.new
|
147
|
+
|
148
|
+
|
149
|
+
return invalid_properties
|
150
|
+
end
|
151
|
+
|
152
|
+
# Check to see if the all the properties in the model are valid
|
153
|
+
# @return true if the model is valid
|
154
|
+
def valid?
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
if @start_date.nil?
|
166
|
+
return false
|
167
|
+
end
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
if @end_date.nil?
|
175
|
+
return false
|
176
|
+
end
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
if @usages.nil?
|
184
|
+
return false
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
end
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
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
|
+
# Checks equality by comparing each attribute.
|
229
|
+
# @param [Object] Object to be compared
|
230
|
+
def ==(o)
|
231
|
+
return true if self.equal?(o)
|
232
|
+
self.class == o.class &&
|
233
|
+
id == o.id &&
|
234
|
+
name == o.name &&
|
235
|
+
start_date == o.start_date &&
|
236
|
+
end_date == o.end_date &&
|
237
|
+
usages == o.usages &&
|
238
|
+
self_uri == o.self_uri
|
239
|
+
end
|
240
|
+
|
241
|
+
# @see the `==` method
|
242
|
+
# @param [Object] Object to be compared
|
243
|
+
def eql?(o)
|
244
|
+
self == o
|
245
|
+
end
|
246
|
+
|
247
|
+
# Calculates hash code according to all attributes.
|
248
|
+
# @return [Fixnum] Hash code
|
249
|
+
def hash
|
250
|
+
[id, name, start_date, end_date, usages, self_uri].hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# build the object from hash
|
254
|
+
def build_from_hash(attributes)
|
255
|
+
return nil unless attributes.is_a?(Hash)
|
256
|
+
self.class.swagger_types.each_pair do |key, type|
|
257
|
+
if type =~ /^Array<(.*)>/i
|
258
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
259
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
260
|
+
else
|
261
|
+
#TODO show warning in debug mode
|
262
|
+
end
|
263
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
264
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
265
|
+
else
|
266
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
self
|
271
|
+
end
|
272
|
+
|
273
|
+
def _deserialize(type, value)
|
274
|
+
case type.to_sym
|
275
|
+
when :DateTime
|
276
|
+
DateTime.parse(value)
|
277
|
+
when :Date
|
278
|
+
Date.parse(value)
|
279
|
+
when :String
|
280
|
+
value.to_s
|
281
|
+
when :Integer
|
282
|
+
value.to_i
|
283
|
+
when :Float
|
284
|
+
value.to_f
|
285
|
+
when :BOOLEAN
|
286
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
287
|
+
true
|
288
|
+
else
|
289
|
+
false
|
290
|
+
end
|
291
|
+
when :Object
|
292
|
+
# generic object (usually a Hash), return directly
|
293
|
+
value
|
294
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
295
|
+
inner_type = Regexp.last_match[:inner_type]
|
296
|
+
value.map { |v| _deserialize(inner_type, v) }
|
297
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
298
|
+
k_type = Regexp.last_match[:k_type]
|
299
|
+
v_type = Regexp.last_match[:v_type]
|
300
|
+
{}.tap do |hash|
|
301
|
+
value.each do |k, v|
|
302
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
else # model
|
306
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
307
|
+
_model.build_from_hash(value)
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
def to_s
|
312
|
+
to_hash.to_s
|
313
|
+
end
|
314
|
+
|
315
|
+
# to_body is an alias to to_body (backward compatibility))
|
316
|
+
def to_body
|
317
|
+
to_hash
|
318
|
+
end
|
319
|
+
|
320
|
+
# return the object in the form of hash
|
321
|
+
def to_hash
|
322
|
+
hash = {}
|
323
|
+
self.class.attribute_map.each_pair do |attr, param|
|
324
|
+
value = self.send(attr)
|
325
|
+
next if value.nil?
|
326
|
+
hash[param] = _to_hash(value)
|
327
|
+
end
|
328
|
+
hash
|
329
|
+
end
|
330
|
+
|
331
|
+
# Method to output non-array value in the form of hash
|
332
|
+
# For object, use to_hash. Otherwise, just return the value
|
333
|
+
def _to_hash(value)
|
334
|
+
if value.is_a?(Array)
|
335
|
+
value.compact.map{ |v| _to_hash(v) }
|
336
|
+
elsif value.is_a?(Hash)
|
337
|
+
{}.tap do |hash|
|
338
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
339
|
+
end
|
340
|
+
elsif value.respond_to? :to_hash
|
341
|
+
value.to_hash
|
342
|
+
else
|
343
|
+
value
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
end
|
348
|
+
end
|
@@ -0,0 +1,238 @@
|
|
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 BillingUsageResource
|
21
|
+
# Identifies the resource (e.g. license user, device).
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# The date that the usage was first observed by the billing subsystem. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
|
25
|
+
attr_accessor :date
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
|
31
|
+
:'name' => :'name',
|
32
|
+
|
33
|
+
:'date' => :'date'
|
34
|
+
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
|
42
|
+
:'name' => :'String',
|
43
|
+
|
44
|
+
:'date' => :'DateTime'
|
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?(:'name')
|
59
|
+
|
60
|
+
|
61
|
+
self.name = attributes[:'name']
|
62
|
+
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
if attributes.has_key?(:'date')
|
68
|
+
|
69
|
+
|
70
|
+
self.date = attributes[:'date']
|
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
|
+
if @name.nil?
|
93
|
+
return false
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
if @date.nil?
|
102
|
+
return false
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
# Checks equality by comparing each attribute.
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def ==(o)
|
125
|
+
return true if self.equal?(o)
|
126
|
+
self.class == o.class &&
|
127
|
+
name == o.name &&
|
128
|
+
date == o.date
|
129
|
+
end
|
130
|
+
|
131
|
+
# @see the `==` method
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def eql?(o)
|
134
|
+
self == o
|
135
|
+
end
|
136
|
+
|
137
|
+
# Calculates hash code according to all attributes.
|
138
|
+
# @return [Fixnum] Hash code
|
139
|
+
def hash
|
140
|
+
[name, date].hash
|
141
|
+
end
|
142
|
+
|
143
|
+
# build the object from hash
|
144
|
+
def build_from_hash(attributes)
|
145
|
+
return nil unless attributes.is_a?(Hash)
|
146
|
+
self.class.swagger_types.each_pair do |key, type|
|
147
|
+
if type =~ /^Array<(.*)>/i
|
148
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
149
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
150
|
+
else
|
151
|
+
#TODO show warning in debug mode
|
152
|
+
end
|
153
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
155
|
+
else
|
156
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
self
|
161
|
+
end
|
162
|
+
|
163
|
+
def _deserialize(type, value)
|
164
|
+
case type.to_sym
|
165
|
+
when :DateTime
|
166
|
+
DateTime.parse(value)
|
167
|
+
when :Date
|
168
|
+
Date.parse(value)
|
169
|
+
when :String
|
170
|
+
value.to_s
|
171
|
+
when :Integer
|
172
|
+
value.to_i
|
173
|
+
when :Float
|
174
|
+
value.to_f
|
175
|
+
when :BOOLEAN
|
176
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
177
|
+
true
|
178
|
+
else
|
179
|
+
false
|
180
|
+
end
|
181
|
+
when :Object
|
182
|
+
# generic object (usually a Hash), return directly
|
183
|
+
value
|
184
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
185
|
+
inner_type = Regexp.last_match[:inner_type]
|
186
|
+
value.map { |v| _deserialize(inner_type, v) }
|
187
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
188
|
+
k_type = Regexp.last_match[:k_type]
|
189
|
+
v_type = Regexp.last_match[:v_type]
|
190
|
+
{}.tap do |hash|
|
191
|
+
value.each do |k, v|
|
192
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
else # model
|
196
|
+
_model = Object.const_get("PureCloud").const_get(type).new
|
197
|
+
_model.build_from_hash(value)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
def to_s
|
202
|
+
to_hash.to_s
|
203
|
+
end
|
204
|
+
|
205
|
+
# to_body is an alias to to_body (backward compatibility))
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# return the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
next if value.nil?
|
216
|
+
hash[param] = _to_hash(value)
|
217
|
+
end
|
218
|
+
hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Method to output non-array value in the form of hash
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map{ |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
end
|