purecloudplatformclientv2 44.0.0 → 45.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/ADFS.md +1 -1
  4. data/docs/AnalyticsEvaluation.md +1 -1
  5. data/docs/AnalyticsSurvey.md +2 -1
  6. data/docs/ArchitectApi.md +52 -127
  7. data/docs/ContactListDivisionView.md +20 -0
  8. data/docs/ContactListDivisionViewListing.md +22 -0
  9. data/docs/ContactListNotification.md +1 -0
  10. data/docs/ConversationQuery.md +1 -1
  11. data/docs/CreateOutboundMessagingConversationRequest.md +1 -1
  12. data/docs/CreateWorkPlan.md +2 -0
  13. data/docs/CustomerInteractionCenter.md +1 -1
  14. data/docs/DataExportNotificationNotification.md +1 -0
  15. data/docs/DncListNotification.md +1 -0
  16. data/docs/DncListNotificationUriReference.md +14 -0
  17. data/docs/GSuite.md +1 -1
  18. data/docs/HelpLink.md +15 -0
  19. data/docs/IdentityNow.md +1 -1
  20. data/docs/IntegrationType.md +8 -0
  21. data/docs/IntradayDataUpdateNotification.md +2 -2
  22. data/docs/Okta.md +1 -1
  23. data/docs/OneLogin.md +1 -1
  24. data/docs/OutboundApi.md +152 -0
  25. data/docs/PingIdentity.md +1 -1
  26. data/docs/QualityApi.md +66 -0
  27. data/docs/ReportingExportJobResponse.md +1 -0
  28. data/docs/RoutingApi.md +74 -0
  29. data/docs/Salesforce.md +1 -1
  30. data/docs/UserScheduleAdherenceUpdateNotification.md +2 -2
  31. data/docs/WfmAgentScheduleUpdateNotificationNotification.md +18 -0
  32. data/docs/WfmAgentScheduleUpdateNotificationNotificationActivities.md +18 -0
  33. data/docs/WfmAgentScheduleUpdateNotificationNotificationFullDayTimeOffMarkers.md +19 -0
  34. data/docs/WfmAgentScheduleUpdateNotificationNotificationShifts.md +15 -0
  35. data/docs/WfmAgentScheduleUpdateNotificationNotificationUpdates.md +14 -0
  36. data/docs/WfmAgentScheduleUpdateNotificationNotificationUserReference.md +13 -0
  37. data/docs/WfmAgentScheduleUpdateNotificationNotificationWfmAgentScheduleUpdate.md +14 -0
  38. data/docs/WfmAgentScheduleUpdateNotificationNotificationWfmFullDayTimeOffMarker.md +19 -0
  39. data/docs/WfmAgentScheduleUpdateNotificationNotificationWfmScheduleActivity.md +18 -0
  40. data/docs/WfmAgentScheduleUpdateNotificationNotificationWfmScheduleShift.md +15 -0
  41. data/docs/WfmScheduleNotificationNotification.md +1 -0
  42. data/docs/WorkPlan.md +2 -0
  43. data/docs/WorkPlanListItemResponse.md +16 -5
  44. data/docs/WorkforceManagementApi.md +2 -2
  45. data/lib/purecloudplatformclientv2.rb +14 -3
  46. data/lib/purecloudplatformclientv2/api/outbound_api.rb +230 -0
  47. data/lib/purecloudplatformclientv2/api/quality_api.rb +66 -0
  48. data/lib/purecloudplatformclientv2/api/routing_api.rb +100 -0
  49. data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +3 -7
  50. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  51. data/lib/purecloudplatformclientv2/models/adfs.rb +12 -12
  52. data/lib/purecloudplatformclientv2/models/aggregate_metric_data.rb +2 -2
  53. data/lib/purecloudplatformclientv2/models/analytics_evaluation.rb +2 -2
  54. data/lib/purecloudplatformclientv2/models/analytics_query_predicate.rb +4 -4
  55. data/lib/purecloudplatformclientv2/models/analytics_survey.rb +34 -8
  56. data/lib/purecloudplatformclientv2/models/contact_list_division_view.rb +397 -0
  57. data/lib/purecloudplatformclientv2/models/contact_list_division_view_listing.rb +428 -0
  58. data/lib/purecloudplatformclientv2/models/contact_list_notification.rb +26 -1
  59. data/lib/purecloudplatformclientv2/models/conversation_query.rb +1 -1
  60. data/lib/purecloudplatformclientv2/models/create_outbound_messaging_conversation_request.rb +1 -1
  61. data/lib/purecloudplatformclientv2/models/create_work_plan.rb +53 -1
  62. data/lib/purecloudplatformclientv2/models/customer_interaction_center.rb +12 -12
  63. data/lib/purecloudplatformclientv2/models/data_export_notification_notification.rb +31 -6
  64. data/lib/purecloudplatformclientv2/models/dnc_list_notification.rb +26 -1
  65. data/lib/purecloudplatformclientv2/models/dnc_list_notification_uri_reference.rb +226 -0
  66. data/lib/purecloudplatformclientv2/models/document_audit.rb +2 -2
  67. data/lib/purecloudplatformclientv2/models/g_suite.rb +12 -12
  68. data/lib/purecloudplatformclientv2/models/{intraday_data_update_notification_date_time.rb → help_link.rb} +24 -45
  69. data/lib/purecloudplatformclientv2/models/identity_now.rb +12 -12
  70. data/lib/purecloudplatformclientv2/models/integration_type.rb +211 -1
  71. data/lib/purecloudplatformclientv2/models/intraday_data_update_notification.rb +2 -2
  72. data/lib/purecloudplatformclientv2/models/message_data.rb +2 -2
  73. data/lib/purecloudplatformclientv2/models/message_details.rb +2 -2
  74. data/lib/purecloudplatformclientv2/models/okta.rb +12 -12
  75. data/lib/purecloudplatformclientv2/models/one_login.rb +12 -12
  76. data/lib/purecloudplatformclientv2/models/ping_identity.rb +12 -12
  77. data/lib/purecloudplatformclientv2/models/reporting_export_job_response.rb +34 -3
  78. data/lib/purecloudplatformclientv2/models/salesforce.rb +12 -12
  79. data/lib/purecloudplatformclientv2/models/user_schedule_adherence_update_notification.rb +2 -2
  80. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification.rb +332 -0
  81. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_activities.rb +326 -0
  82. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_full_day_time_off_markers.rb +351 -0
  83. data/lib/purecloudplatformclientv2/models/{intraday_data_update_notification_start_date.rb → wfm_agent_schedule_update_notification_notification_shifts.rb} +22 -45
  84. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_updates.rb +242 -0
  85. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_user_reference.rb +201 -0
  86. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_wfm_agent_schedule_update.rb +242 -0
  87. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_wfm_full_day_time_off_marker.rb +351 -0
  88. data/lib/purecloudplatformclientv2/models/wfm_agent_schedule_update_notification_notification_wfm_schedule_activity.rb +326 -0
  89. data/lib/purecloudplatformclientv2/models/{user_schedule_adherence_update_notification_date_time.rb → wfm_agent_schedule_update_notification_notification_wfm_schedule_shift.rb} +22 -45
  90. data/lib/purecloudplatformclientv2/models/wfm_schedule_notification_notification.rb +28 -3
  91. data/lib/purecloudplatformclientv2/models/work_plan.rb +53 -1
  92. data/lib/purecloudplatformclientv2/models/work_plan_list_item_response.rb +313 -18
  93. data/lib/purecloudplatformclientv2/version.rb +1 -1
  94. metadata +30 -8
  95. data/docs/IntradayDataUpdateNotificationDateTime.md +0 -16
  96. data/docs/IntradayDataUpdateNotificationStartDate.md +0 -16
  97. data/docs/UserScheduleAdherenceUpdateNotificationDateTime.md +0 -16
@@ -0,0 +1,326 @@
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 WfmAgentScheduleUpdateNotificationNotificationActivities
21
+ attr_accessor :activity_code_id
22
+
23
+ attr_accessor :start_date
24
+
25
+ attr_accessor :counts_as_paid_time
26
+
27
+ attr_accessor :length_in_minutes
28
+
29
+ attr_accessor :time_off_request_id
30
+
31
+ attr_accessor :description
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+
37
+ :'activity_code_id' => :'activityCodeId',
38
+
39
+ :'start_date' => :'startDate',
40
+
41
+ :'counts_as_paid_time' => :'countsAsPaidTime',
42
+
43
+ :'length_in_minutes' => :'lengthInMinutes',
44
+
45
+ :'time_off_request_id' => :'timeOffRequestId',
46
+
47
+ :'description' => :'description'
48
+
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+
56
+ :'activity_code_id' => :'String',
57
+
58
+ :'start_date' => :'DateTime',
59
+
60
+ :'counts_as_paid_time' => :'BOOLEAN',
61
+
62
+ :'length_in_minutes' => :'Integer',
63
+
64
+ :'time_off_request_id' => :'String',
65
+
66
+ :'description' => :'String'
67
+
68
+ }
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ return unless attributes.is_a?(Hash)
75
+
76
+ # convert string to symbol for hash key
77
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
78
+
79
+
80
+ if attributes.has_key?(:'activityCodeId')
81
+
82
+
83
+ self.activity_code_id = attributes[:'activityCodeId']
84
+
85
+
86
+ end
87
+
88
+
89
+ if attributes.has_key?(:'startDate')
90
+
91
+
92
+ self.start_date = attributes[:'startDate']
93
+
94
+
95
+ end
96
+
97
+
98
+ if attributes.has_key?(:'countsAsPaidTime')
99
+
100
+
101
+ self.counts_as_paid_time = attributes[:'countsAsPaidTime']
102
+
103
+
104
+ end
105
+
106
+
107
+ if attributes.has_key?(:'lengthInMinutes')
108
+
109
+
110
+ self.length_in_minutes = attributes[:'lengthInMinutes']
111
+
112
+
113
+ end
114
+
115
+
116
+ if attributes.has_key?(:'timeOffRequestId')
117
+
118
+
119
+ self.time_off_request_id = attributes[:'timeOffRequestId']
120
+
121
+
122
+ end
123
+
124
+
125
+ if attributes.has_key?(:'description')
126
+
127
+
128
+ self.description = attributes[:'description']
129
+
130
+
131
+ end
132
+
133
+
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properies with the reasons
138
+ def list_invalid_properties
139
+ invalid_properties = Array.new
140
+
141
+
142
+ return invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+
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
+ end
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
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+ # Checks equality by comparing each attribute.
207
+ # @param [Object] Object to be compared
208
+ def ==(o)
209
+ return true if self.equal?(o)
210
+ self.class == o.class &&
211
+ activity_code_id == o.activity_code_id &&
212
+ start_date == o.start_date &&
213
+ counts_as_paid_time == o.counts_as_paid_time &&
214
+ length_in_minutes == o.length_in_minutes &&
215
+ time_off_request_id == o.time_off_request_id &&
216
+ description == o.description
217
+ end
218
+
219
+ # @see the `==` method
220
+ # @param [Object] Object to be compared
221
+ def eql?(o)
222
+ self == o
223
+ end
224
+
225
+ # Calculates hash code according to all attributes.
226
+ # @return [Fixnum] Hash code
227
+ def hash
228
+ [activity_code_id, start_date, counts_as_paid_time, length_in_minutes, time_off_request_id, description].hash
229
+ end
230
+
231
+ # build the object from hash
232
+ def build_from_hash(attributes)
233
+ return nil unless attributes.is_a?(Hash)
234
+ self.class.swagger_types.each_pair do |key, type|
235
+ if type =~ /^Array<(.*)>/i
236
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
237
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
238
+ else
239
+ #TODO show warning in debug mode
240
+ end
241
+ elsif !attributes[self.class.attribute_map[key]].nil?
242
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
243
+ else
244
+ # data not found in attributes(hash), not an issue as the data can be optional
245
+ end
246
+ end
247
+
248
+ self
249
+ end
250
+
251
+ def _deserialize(type, value)
252
+ case type.to_sym
253
+ when :DateTime
254
+ DateTime.parse(value)
255
+ when :Date
256
+ Date.parse(value)
257
+ when :String
258
+ value.to_s
259
+ when :Integer
260
+ value.to_i
261
+ when :Float
262
+ value.to_f
263
+ when :BOOLEAN
264
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
265
+ true
266
+ else
267
+ false
268
+ end
269
+ when :Object
270
+ # generic object (usually a Hash), return directly
271
+ value
272
+ when /\AArray<(?<inner_type>.+)>\z/
273
+ inner_type = Regexp.last_match[:inner_type]
274
+ value.map { |v| _deserialize(inner_type, v) }
275
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
276
+ k_type = Regexp.last_match[:k_type]
277
+ v_type = Regexp.last_match[:v_type]
278
+ {}.tap do |hash|
279
+ value.each do |k, v|
280
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
281
+ end
282
+ end
283
+ else # model
284
+ _model = Object.const_get("PureCloud").const_get(type).new
285
+ _model.build_from_hash(value)
286
+ end
287
+ end
288
+
289
+ def to_s
290
+ to_hash.to_s
291
+ end
292
+
293
+ # to_body is an alias to to_body (backward compatibility))
294
+ def to_body
295
+ to_hash
296
+ end
297
+
298
+ # return the object in the form of hash
299
+ def to_hash
300
+ hash = {}
301
+ self.class.attribute_map.each_pair do |attr, param|
302
+ value = self.send(attr)
303
+ next if value.nil?
304
+ hash[param] = _to_hash(value)
305
+ end
306
+ hash
307
+ end
308
+
309
+ # Method to output non-array value in the form of hash
310
+ # For object, use to_hash. Otherwise, just return the value
311
+ def _to_hash(value)
312
+ if value.is_a?(Array)
313
+ value.compact.map{ |v| _to_hash(v) }
314
+ elsif value.is_a?(Hash)
315
+ {}.tap do |hash|
316
+ value.each { |k, v| hash[k] = _to_hash(v) }
317
+ end
318
+ elsif value.respond_to? :to_hash
319
+ value.to_hash
320
+ else
321
+ value
322
+ end
323
+ end
324
+
325
+ end
326
+ end
@@ -0,0 +1,351 @@
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 WfmAgentScheduleUpdateNotificationNotificationFullDayTimeOffMarkers
21
+ attr_accessor :time_off_request_id
22
+
23
+ attr_accessor :management_unit_date
24
+
25
+ attr_accessor :activity_code_id
26
+
27
+ attr_accessor :is_paid
28
+
29
+ attr_accessor :length_in_minutes
30
+
31
+ attr_accessor :description
32
+
33
+ attr_accessor :paid
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+
39
+ :'time_off_request_id' => :'timeOffRequestId',
40
+
41
+ :'management_unit_date' => :'managementUnitDate',
42
+
43
+ :'activity_code_id' => :'activityCodeId',
44
+
45
+ :'is_paid' => :'isPaid',
46
+
47
+ :'length_in_minutes' => :'lengthInMinutes',
48
+
49
+ :'description' => :'description',
50
+
51
+ :'paid' => :'paid'
52
+
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+
60
+ :'time_off_request_id' => :'String',
61
+
62
+ :'management_unit_date' => :'String',
63
+
64
+ :'activity_code_id' => :'String',
65
+
66
+ :'is_paid' => :'BOOLEAN',
67
+
68
+ :'length_in_minutes' => :'Integer',
69
+
70
+ :'description' => :'String',
71
+
72
+ :'paid' => :'BOOLEAN'
73
+
74
+ }
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
84
+
85
+
86
+ if attributes.has_key?(:'timeOffRequestId')
87
+
88
+
89
+ self.time_off_request_id = attributes[:'timeOffRequestId']
90
+
91
+
92
+ end
93
+
94
+
95
+ if attributes.has_key?(:'managementUnitDate')
96
+
97
+
98
+ self.management_unit_date = attributes[:'managementUnitDate']
99
+
100
+
101
+ end
102
+
103
+
104
+ if attributes.has_key?(:'activityCodeId')
105
+
106
+
107
+ self.activity_code_id = attributes[:'activityCodeId']
108
+
109
+
110
+ end
111
+
112
+
113
+ if attributes.has_key?(:'isPaid')
114
+
115
+
116
+ self.is_paid = attributes[:'isPaid']
117
+
118
+
119
+ end
120
+
121
+
122
+ if attributes.has_key?(:'lengthInMinutes')
123
+
124
+
125
+ self.length_in_minutes = attributes[:'lengthInMinutes']
126
+
127
+
128
+ end
129
+
130
+
131
+ if attributes.has_key?(:'description')
132
+
133
+
134
+ self.description = attributes[:'description']
135
+
136
+
137
+ end
138
+
139
+
140
+ if attributes.has_key?(:'paid')
141
+
142
+
143
+ self.paid = attributes[:'paid']
144
+
145
+
146
+ end
147
+
148
+
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properies with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+
156
+
157
+ return invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+ end
193
+
194
+
195
+
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
+
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ time_off_request_id == o.time_off_request_id &&
236
+ management_unit_date == o.management_unit_date &&
237
+ activity_code_id == o.activity_code_id &&
238
+ is_paid == o.is_paid &&
239
+ length_in_minutes == o.length_in_minutes &&
240
+ description == o.description &&
241
+ paid == o.paid
242
+ end
243
+
244
+ # @see the `==` method
245
+ # @param [Object] Object to be compared
246
+ def eql?(o)
247
+ self == o
248
+ end
249
+
250
+ # Calculates hash code according to all attributes.
251
+ # @return [Fixnum] Hash code
252
+ def hash
253
+ [time_off_request_id, management_unit_date, activity_code_id, is_paid, length_in_minutes, description, paid].hash
254
+ end
255
+
256
+ # build the object from hash
257
+ def build_from_hash(attributes)
258
+ return nil unless attributes.is_a?(Hash)
259
+ self.class.swagger_types.each_pair do |key, type|
260
+ if type =~ /^Array<(.*)>/i
261
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
262
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
263
+ else
264
+ #TODO show warning in debug mode
265
+ end
266
+ elsif !attributes[self.class.attribute_map[key]].nil?
267
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
268
+ else
269
+ # data not found in attributes(hash), not an issue as the data can be optional
270
+ end
271
+ end
272
+
273
+ self
274
+ end
275
+
276
+ def _deserialize(type, value)
277
+ case type.to_sym
278
+ when :DateTime
279
+ DateTime.parse(value)
280
+ when :Date
281
+ Date.parse(value)
282
+ when :String
283
+ value.to_s
284
+ when :Integer
285
+ value.to_i
286
+ when :Float
287
+ value.to_f
288
+ when :BOOLEAN
289
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
290
+ true
291
+ else
292
+ false
293
+ end
294
+ when :Object
295
+ # generic object (usually a Hash), return directly
296
+ value
297
+ when /\AArray<(?<inner_type>.+)>\z/
298
+ inner_type = Regexp.last_match[:inner_type]
299
+ value.map { |v| _deserialize(inner_type, v) }
300
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
301
+ k_type = Regexp.last_match[:k_type]
302
+ v_type = Regexp.last_match[:v_type]
303
+ {}.tap do |hash|
304
+ value.each do |k, v|
305
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
306
+ end
307
+ end
308
+ else # model
309
+ _model = Object.const_get("PureCloud").const_get(type).new
310
+ _model.build_from_hash(value)
311
+ end
312
+ end
313
+
314
+ def to_s
315
+ to_hash.to_s
316
+ end
317
+
318
+ # to_body is an alias to to_body (backward compatibility))
319
+ def to_body
320
+ to_hash
321
+ end
322
+
323
+ # return the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ next if value.nil?
329
+ hash[param] = _to_hash(value)
330
+ end
331
+ hash
332
+ end
333
+
334
+ # Method to output non-array value in the form of hash
335
+ # For object, use to_hash. Otherwise, just return the value
336
+ def _to_hash(value)
337
+ if value.is_a?(Array)
338
+ value.compact.map{ |v| _to_hash(v) }
339
+ elsif value.is_a?(Hash)
340
+ {}.tap do |hash|
341
+ value.each { |k, v| hash[k] = _to_hash(v) }
342
+ end
343
+ elsif value.respond_to? :to_hash
344
+ value.to_hash
345
+ else
346
+ value
347
+ end
348
+ end
349
+
350
+ end
351
+ end