purecloudplatformclientv2 22.0.0 → 23.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/ActivityCode.md +8 -5
  4. data/docs/ActivityCodeContainer.md +1 -0
  5. data/docs/AdherenceSettings.md +1 -1
  6. data/docs/ArchitectApi.md +14 -14
  7. data/docs/AuthorizationApi.md +3 -1
  8. data/docs/BatchDownloadJobResult.md +20 -0
  9. data/docs/BatchDownloadJobStatusResult.md +20 -0
  10. data/docs/BatchDownloadJobSubmission.md +13 -0
  11. data/docs/BatchDownloadJobSubmissionResult.md +15 -0
  12. data/docs/BatchDownloadRequest.md +14 -0
  13. data/docs/Call.md +2 -0
  14. data/docs/CallBasic.md +2 -0
  15. data/docs/CallForwardingNotification.md +17 -0
  16. data/docs/CallForwardingNotificationCall.md +13 -0
  17. data/docs/CallForwardingNotificationCalls.md +13 -0
  18. data/docs/CallForwardingNotificationTarget.md +14 -0
  19. data/docs/CallForwardingNotificationTargets.md +14 -0
  20. data/docs/CallForwardingNotificationUser.md +13 -0
  21. data/docs/CallRoute.md +0 -1
  22. data/docs/{SignedData.md → ContactColumnTimeZone.md} +2 -3
  23. data/docs/CreateActivityCodeRequest.md +18 -0
  24. data/docs/CreateQueueRequest.md +12 -11
  25. data/docs/ExternalContact.md +1 -0
  26. data/docs/IgnoredActivityCategories.md +13 -0
  27. data/docs/ManagementUnit.md +4 -3
  28. data/docs/ManagementUnitSettings.md +1 -3
  29. data/docs/MessageDetails.md +1 -0
  30. data/docs/MessageMedia.md +14 -0
  31. data/docs/MoveAgentResponse.md +14 -0
  32. data/docs/MoveAgentsRequest.md +14 -0
  33. data/docs/MoveAgentsResponse.md +15 -0
  34. data/docs/NTPSettings.md +13 -0
  35. data/docs/OrganizationAuthorizationApi.md +2 -2
  36. data/docs/OutOfOfficeNotification.md +1 -0
  37. data/docs/OutboundApi.md +63 -0
  38. data/docs/Queue.md +12 -11
  39. data/docs/Recording.md +1 -0
  40. data/docs/RecordingApi.md +120 -0
  41. data/docs/RecordingMessagingMessage.md +18 -0
  42. data/docs/RoutingApi.md +2 -2
  43. data/docs/SchedulingSettings.md +1 -0
  44. data/docs/ShrinkageOverride.md +14 -0
  45. data/docs/ShrinkageOverrides.md +14 -0
  46. data/docs/Site.md +1 -0
  47. data/docs/TrustCreate.md +2 -1
  48. data/docs/TrustGroup.md +26 -0
  49. data/docs/{TrustUserCreate.md → TrustMemberCreate.md} +4 -4
  50. data/docs/TrustRequest.md +2 -1
  51. data/docs/TrustRequestCreate.md +2 -1
  52. data/docs/UserQueue.md +12 -11
  53. data/docs/WfmVersionedEntityMetadata.md +15 -0
  54. data/docs/WorkforceManagementApi.md +128 -3
  55. data/docs/{Entity.md → WrapUpCodeReference.md} +2 -2
  56. data/lib/purecloudplatformclientv2.rb +26 -4
  57. data/lib/purecloudplatformclientv2/api/architect_api.rb +6 -6
  58. data/lib/purecloudplatformclientv2/api/authorization_api.rb +9 -0
  59. data/lib/purecloudplatformclientv2/api/outbound_api.rb +75 -0
  60. data/lib/purecloudplatformclientv2/api/recording_api.rb +130 -0
  61. data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +138 -2
  62. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  63. data/lib/purecloudplatformclientv2/models/activity_code.rb +95 -12
  64. data/lib/purecloudplatformclientv2/models/activity_code_container.rb +35 -4
  65. data/lib/purecloudplatformclientv2/models/adherence_settings.rb +2 -4
  66. data/lib/purecloudplatformclientv2/models/batch_download_job_result.rb +383 -0
  67. data/lib/purecloudplatformclientv2/models/batch_download_job_status_result.rb +385 -0
  68. data/lib/purecloudplatformclientv2/models/batch_download_job_submission.rb +209 -0
  69. data/lib/purecloudplatformclientv2/models/batch_download_job_submission_result.rb +253 -0
  70. data/lib/purecloudplatformclientv2/models/batch_download_request.rb +228 -0
  71. data/lib/purecloudplatformclientv2/models/call.rb +56 -4
  72. data/lib/purecloudplatformclientv2/models/call_basic.rb +56 -4
  73. data/lib/purecloudplatformclientv2/models/call_forwarding_notification.rb +303 -0
  74. data/lib/purecloudplatformclientv2/models/call_forwarding_notification_call.rb +203 -0
  75. data/lib/purecloudplatformclientv2/models/call_forwarding_notification_calls.rb +203 -0
  76. data/lib/purecloudplatformclientv2/models/call_forwarding_notification_target.rb +226 -0
  77. data/lib/purecloudplatformclientv2/models/call_forwarding_notification_targets.rb +226 -0
  78. data/lib/purecloudplatformclientv2/models/{signed_data.rb → call_forwarding_notification_user.rb} +8 -8
  79. data/lib/purecloudplatformclientv2/models/call_route.rb +4 -30
  80. data/lib/purecloudplatformclientv2/models/contact_column_time_zone.rb +176 -0
  81. data/lib/purecloudplatformclientv2/models/create_activity_code_request.rb +358 -0
  82. data/lib/purecloudplatformclientv2/models/create_queue_request.rb +38 -12
  83. data/lib/purecloudplatformclientv2/models/dependency.rb +2 -2
  84. data/lib/purecloudplatformclientv2/models/dependency_object.rb +2 -2
  85. data/lib/purecloudplatformclientv2/models/event_message.rb +2 -2
  86. data/lib/purecloudplatformclientv2/models/external_contact.rb +26 -1
  87. data/lib/purecloudplatformclientv2/models/ignored_activity_categories.rb +204 -0
  88. data/lib/purecloudplatformclientv2/models/management_unit.rb +36 -5
  89. data/lib/purecloudplatformclientv2/models/management_unit_settings.rb +9 -61
  90. data/lib/purecloudplatformclientv2/models/message_details.rb +32 -4
  91. data/lib/purecloudplatformclientv2/models/message_media.rb +228 -0
  92. data/lib/purecloudplatformclientv2/models/move_agent_response.rb +243 -0
  93. data/lib/purecloudplatformclientv2/models/move_agents_request.rb +236 -0
  94. data/lib/purecloudplatformclientv2/models/move_agents_response.rb +257 -0
  95. data/lib/purecloudplatformclientv2/models/ntp_settings.rb +204 -0
  96. data/lib/purecloudplatformclientv2/models/out_of_office_notification.rb +26 -1
  97. data/lib/purecloudplatformclientv2/models/prediction_results.rb +2 -2
  98. data/lib/purecloudplatformclientv2/models/queue.rb +38 -12
  99. data/lib/purecloudplatformclientv2/models/recording.rb +29 -1
  100. data/lib/purecloudplatformclientv2/models/recording_messaging_message.rb +327 -0
  101. data/lib/purecloudplatformclientv2/models/scheduling_settings.rb +30 -4
  102. data/lib/purecloudplatformclientv2/models/shrinkage_override.rb +233 -0
  103. data/lib/purecloudplatformclientv2/models/shrinkage_overrides.rb +230 -0
  104. data/lib/purecloudplatformclientv2/models/site.rb +27 -1
  105. data/lib/purecloudplatformclientv2/models/trust_create.rb +32 -9
  106. data/lib/purecloudplatformclientv2/models/trust_group.rb +603 -0
  107. data/lib/purecloudplatformclientv2/models/{trust_user_create.rb → trust_member_create.rb} +3 -3
  108. data/lib/purecloudplatformclientv2/models/trust_request.rb +28 -5
  109. data/lib/purecloudplatformclientv2/models/trust_request_create.rb +32 -9
  110. data/lib/purecloudplatformclientv2/models/user_queue.rb +38 -12
  111. data/lib/purecloudplatformclientv2/models/wfm_versioned_entity_metadata.rb +260 -0
  112. data/lib/purecloudplatformclientv2/models/{entity.rb → wrap_up_code_reference.rb} +1 -1
  113. data/lib/purecloudplatformclientv2/version.rb +1 -1
  114. metadata +54 -10
  115. data/docs/SignedDataApi.md +0 -73
  116. data/lib/purecloudplatformclientv2/api/signed_data_api.rb +0 -90
@@ -0,0 +1,327 @@
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 RecordingMessagingMessage
21
+ attr_accessor :from
22
+
23
+ attr_accessor :from_user
24
+
25
+ attr_accessor :from_external_contact
26
+
27
+ attr_accessor :to
28
+
29
+ # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
30
+ attr_accessor :timestamp
31
+
32
+ attr_accessor :message_text
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+
38
+ :'from' => :'from',
39
+
40
+ :'from_user' => :'fromUser',
41
+
42
+ :'from_external_contact' => :'fromExternalContact',
43
+
44
+ :'to' => :'to',
45
+
46
+ :'timestamp' => :'timestamp',
47
+
48
+ :'message_text' => :'messageText'
49
+
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+
57
+ :'from' => :'String',
58
+
59
+ :'from_user' => :'User',
60
+
61
+ :'from_external_contact' => :'ExternalContact',
62
+
63
+ :'to' => :'String',
64
+
65
+ :'timestamp' => :'DateTime',
66
+
67
+ :'message_text' => :'String'
68
+
69
+ }
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
79
+
80
+
81
+ if attributes.has_key?(:'from')
82
+
83
+
84
+ self.from = attributes[:'from']
85
+
86
+
87
+ end
88
+
89
+
90
+ if attributes.has_key?(:'fromUser')
91
+
92
+
93
+ self.from_user = attributes[:'fromUser']
94
+
95
+
96
+ end
97
+
98
+
99
+ if attributes.has_key?(:'fromExternalContact')
100
+
101
+
102
+ self.from_external_contact = attributes[:'fromExternalContact']
103
+
104
+
105
+ end
106
+
107
+
108
+ if attributes.has_key?(:'to')
109
+
110
+
111
+ self.to = attributes[:'to']
112
+
113
+
114
+ end
115
+
116
+
117
+ if attributes.has_key?(:'timestamp')
118
+
119
+
120
+ self.timestamp = attributes[:'timestamp']
121
+
122
+
123
+ end
124
+
125
+
126
+ if attributes.has_key?(:'messageText')
127
+
128
+
129
+ self.message_text = attributes[:'messageText']
130
+
131
+
132
+ end
133
+
134
+
135
+ end
136
+
137
+ # Show invalid properties with the reasons. Usually used together with valid?
138
+ # @return Array for valid properies with the reasons
139
+ def list_invalid_properties
140
+ invalid_properties = Array.new
141
+
142
+
143
+ return invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+ end
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
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ from == o.from &&
213
+ from_user == o.from_user &&
214
+ from_external_contact == o.from_external_contact &&
215
+ to == o.to &&
216
+ timestamp == o.timestamp &&
217
+ message_text == o.message_text
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Fixnum] Hash code
228
+ def hash
229
+ [from, from_user, from_external_contact, to, timestamp, message_text].hash
230
+ end
231
+
232
+ # build the object from hash
233
+ def build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ self.class.swagger_types.each_pair do |key, type|
236
+ if type =~ /^Array<(.*)>/i
237
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
238
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
239
+ else
240
+ #TODO show warning in debug mode
241
+ end
242
+ elsif !attributes[self.class.attribute_map[key]].nil?
243
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
244
+ else
245
+ # data not found in attributes(hash), not an issue as the data can be optional
246
+ end
247
+ end
248
+
249
+ self
250
+ end
251
+
252
+ def _deserialize(type, value)
253
+ case type.to_sym
254
+ when :DateTime
255
+ DateTime.parse(value)
256
+ when :Date
257
+ Date.parse(value)
258
+ when :String
259
+ value.to_s
260
+ when :Integer
261
+ value.to_i
262
+ when :Float
263
+ value.to_f
264
+ when :BOOLEAN
265
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
266
+ true
267
+ else
268
+ false
269
+ end
270
+ when :Object
271
+ # generic object (usually a Hash), return directly
272
+ value
273
+ when /\AArray<(?<inner_type>.+)>\z/
274
+ inner_type = Regexp.last_match[:inner_type]
275
+ value.map { |v| _deserialize(inner_type, v) }
276
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
277
+ k_type = Regexp.last_match[:k_type]
278
+ v_type = Regexp.last_match[:v_type]
279
+ {}.tap do |hash|
280
+ value.each do |k, v|
281
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
282
+ end
283
+ end
284
+ else # model
285
+ _model = Object.const_get("PureCloud").const_get(type).new
286
+ _model.build_from_hash(value)
287
+ end
288
+ end
289
+
290
+ def to_s
291
+ to_hash.to_s
292
+ end
293
+
294
+ # to_body is an alias to to_body (backward compatibility))
295
+ def to_body
296
+ to_hash
297
+ end
298
+
299
+ # return the object in the form of hash
300
+ def to_hash
301
+ hash = {}
302
+ self.class.attribute_map.each_pair do |attr, param|
303
+ value = self.send(attr)
304
+ next if value.nil?
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Method to output non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ def _to_hash(value)
313
+ if value.is_a?(Array)
314
+ value.compact.map{ |v| _to_hash(v) }
315
+ elsif value.is_a?(Hash)
316
+ {}.tap do |hash|
317
+ value.each { |k, v| hash[k] = _to_hash(v) }
318
+ end
319
+ elsif value.respond_to? :to_hash
320
+ value.to_hash
321
+ else
322
+ value
323
+ end
324
+ end
325
+
326
+ end
327
+ end
@@ -25,13 +25,18 @@ module PureCloud
25
25
  # Default shrinkage percent for scheduling
26
26
  attr_accessor :default_shrinkage_percent
27
27
 
28
+ # Shrinkage overrides for scheduling
29
+ attr_accessor :shrinkage_overrides
30
+
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
29
32
  def self.attribute_map
30
33
  {
31
34
 
32
35
  :'max_occupancy_percent_for_deferred_work' => :'maxOccupancyPercentForDeferredWork',
33
36
 
34
- :'default_shrinkage_percent' => :'defaultShrinkagePercent'
37
+ :'default_shrinkage_percent' => :'defaultShrinkagePercent',
38
+
39
+ :'shrinkage_overrides' => :'shrinkageOverrides'
35
40
 
36
41
  }
37
42
  end
@@ -42,7 +47,9 @@ module PureCloud
42
47
 
43
48
  :'max_occupancy_percent_for_deferred_work' => :'Integer',
44
49
 
45
- :'default_shrinkage_percent' => :'Float'
50
+ :'default_shrinkage_percent' => :'Float',
51
+
52
+ :'shrinkage_overrides' => :'ShrinkageOverrides'
46
53
 
47
54
  }
48
55
  end
@@ -74,6 +81,15 @@ module PureCloud
74
81
  end
75
82
 
76
83
 
84
+ if attributes.has_key?(:'shrinkageOverrides')
85
+
86
+
87
+ self.shrinkage_overrides = attributes[:'shrinkageOverrides']
88
+
89
+
90
+ end
91
+
92
+
77
93
  end
78
94
 
79
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -97,6 +113,10 @@ module PureCloud
97
113
 
98
114
 
99
115
 
116
+
117
+
118
+
119
+
100
120
  end
101
121
 
102
122
 
@@ -110,13 +130,19 @@ module PureCloud
110
130
 
111
131
 
112
132
 
133
+
134
+
135
+
136
+
137
+
113
138
  # Checks equality by comparing each attribute.
114
139
  # @param [Object] Object to be compared
115
140
  def ==(o)
116
141
  return true if self.equal?(o)
117
142
  self.class == o.class &&
118
143
  max_occupancy_percent_for_deferred_work == o.max_occupancy_percent_for_deferred_work &&
119
- default_shrinkage_percent == o.default_shrinkage_percent
144
+ default_shrinkage_percent == o.default_shrinkage_percent &&
145
+ shrinkage_overrides == o.shrinkage_overrides
120
146
  end
121
147
 
122
148
  # @see the `==` method
@@ -128,7 +154,7 @@ module PureCloud
128
154
  # Calculates hash code according to all attributes.
129
155
  # @return [Fixnum] Hash code
130
156
  def hash
131
- [max_occupancy_percent_for_deferred_work, default_shrinkage_percent].hash
157
+ [max_occupancy_percent_for_deferred_work, default_shrinkage_percent, shrinkage_overrides].hash
132
158
  end
133
159
 
134
160
  # build the object from hash
@@ -0,0 +1,233 @@
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 ShrinkageOverride
21
+ # Index of shrinkage override interval. Starting index is 0 and indexes are based on 15 minute intervals for a 7 day week
22
+ attr_accessor :interval_index
23
+
24
+ # Shrinkage override percent. Setting a null value will reset the interval to the default
25
+ attr_accessor :shrinkage_percent
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'interval_index' => :'intervalIndex',
32
+
33
+ :'shrinkage_percent' => :'shrinkagePercent'
34
+
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+
42
+ :'interval_index' => :'Integer',
43
+
44
+ :'shrinkage_percent' => :'Float'
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?(:'intervalIndex')
59
+
60
+
61
+ self.interval_index = attributes[:'intervalIndex']
62
+
63
+
64
+ end
65
+
66
+
67
+ if attributes.has_key?(:'shrinkagePercent')
68
+
69
+
70
+ self.shrinkage_percent = attributes[:'shrinkagePercent']
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 @interval_index.nil?
93
+ return false
94
+ end
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ end
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ interval_index == o.interval_index &&
123
+ shrinkage_percent == o.shrinkage_percent
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [interval_index, shrinkage_percent].hash
136
+ end
137
+
138
+ # build the object from hash
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.swagger_types.each_pair do |key, type|
142
+ if type =~ /^Array<(.*)>/i
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
145
+ else
146
+ #TODO show warning in debug mode
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ else
151
+ # data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :DateTime
161
+ DateTime.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :BOOLEAN
171
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ _model = Object.const_get("PureCloud").const_get(type).new
192
+ _model.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_body (backward compatibility))
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # return the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ next if value.nil?
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Method to output non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map{ |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+ end