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
@@ -76,7 +76,7 @@ module PureCloud
76
76
  http_method = http_method.to_sym.downcase
77
77
 
78
78
  header_params = @default_headers.merge(opts[:header_params] || {})
79
- header_params['purecloud-sdk'] = '22.0.0'
79
+ header_params['purecloud-sdk'] = '23.0.0'
80
80
  query_params = opts[:query_params] || {}
81
81
  form_params = opts[:form_params] || {}
82
82
 
@@ -19,16 +19,19 @@ require 'date'
19
19
  module PureCloud
20
20
  # Activity code data
21
21
  class ActivityCode
22
- # The activity code's name
22
+ # The globally unique identifier for the object.
23
+ attr_accessor :id
24
+
25
+ # The name of the activity code. Default activity codes will be created with an empty name
23
26
  attr_accessor :name
24
27
 
25
- # Whether this activity code is active or only used for historical schedules
28
+ # Whether this activity code is active or has been deleted
26
29
  attr_accessor :is_active
27
30
 
28
31
  # Whether this is a default activity code
29
32
  attr_accessor :is_default
30
33
 
31
- # The activity code's category
34
+ # The activity code's category.
32
35
  attr_accessor :category
33
36
 
34
37
  # The default length of the activity in minutes
@@ -37,16 +40,24 @@ module PureCloud
37
40
  # Whether an agent is paid while performing this activity
38
41
  attr_accessor :counts_as_paid_time
39
42
 
40
- # Indicates whether or not the activity should be counted as work time
43
+ # Indicates whether or not the activity should be counted as contiguous work time for calculating daily constraints
41
44
  attr_accessor :counts_as_work_time
42
45
 
43
- # Whether an agent can select this activity code when creating or editing a time off request
44
- attr_accessor :is_agent_time_off_selectable
46
+ # Whether an agent can select this activity code when creating or editing a time off request. Null if the activity's category is not time off.
47
+ attr_accessor :agent_time_off_selectable
48
+
49
+ # Version metadata for the associated management unit's list of activity codes
50
+ attr_accessor :metadata
51
+
52
+ # The URI for this object
53
+ attr_accessor :self_uri
45
54
 
46
55
  # Attribute mapping from ruby-style variable name to JSON key.
47
56
  def self.attribute_map
48
57
  {
49
58
 
59
+ :'id' => :'id',
60
+
50
61
  :'name' => :'name',
51
62
 
52
63
  :'is_active' => :'isActive',
@@ -61,7 +72,11 @@ module PureCloud
61
72
 
62
73
  :'counts_as_work_time' => :'countsAsWorkTime',
63
74
 
64
- :'is_agent_time_off_selectable' => :'isAgentTimeOffSelectable'
75
+ :'agent_time_off_selectable' => :'agentTimeOffSelectable',
76
+
77
+ :'metadata' => :'metadata',
78
+
79
+ :'self_uri' => :'selfUri'
65
80
 
66
81
  }
67
82
  end
@@ -70,6 +85,8 @@ module PureCloud
70
85
  def self.swagger_types
71
86
  {
72
87
 
88
+ :'id' => :'String',
89
+
73
90
  :'name' => :'String',
74
91
 
75
92
  :'is_active' => :'BOOLEAN',
@@ -84,7 +101,11 @@ module PureCloud
84
101
 
85
102
  :'counts_as_work_time' => :'BOOLEAN',
86
103
 
87
- :'is_agent_time_off_selectable' => :'BOOLEAN'
104
+ :'agent_time_off_selectable' => :'BOOLEAN',
105
+
106
+ :'metadata' => :'WfmVersionedEntityMetadata',
107
+
108
+ :'self_uri' => :'String'
88
109
 
89
110
  }
90
111
  end
@@ -98,6 +119,15 @@ module PureCloud
98
119
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
99
120
 
100
121
 
122
+ if attributes.has_key?(:'id')
123
+
124
+
125
+ self.id = attributes[:'id']
126
+
127
+
128
+ end
129
+
130
+
101
131
  if attributes.has_key?(:'name')
102
132
 
103
133
 
@@ -161,10 +191,28 @@ module PureCloud
161
191
  end
162
192
 
163
193
 
164
- if attributes.has_key?(:'isAgentTimeOffSelectable')
194
+ if attributes.has_key?(:'agentTimeOffSelectable')
165
195
 
166
196
 
167
- self.is_agent_time_off_selectable = attributes[:'isAgentTimeOffSelectable']
197
+ self.agent_time_off_selectable = attributes[:'agentTimeOffSelectable']
198
+
199
+
200
+ end
201
+
202
+
203
+ if attributes.has_key?(:'metadata')
204
+
205
+
206
+ self.metadata = attributes[:'metadata']
207
+
208
+
209
+ end
210
+
211
+
212
+ if attributes.has_key?(:'selfUri')
213
+
214
+
215
+ self.self_uri = attributes[:'selfUri']
168
216
 
169
217
 
170
218
  end
@@ -199,6 +247,10 @@ module PureCloud
199
247
 
200
248
 
201
249
 
250
+
251
+
252
+
253
+
202
254
  allowed_values = ["OnQueueWork", "Break", "Meal", "Meeting", "OffQueueWork", "TimeOff", "Training", "Unavailable", "Unscheduled"]
203
255
  if @category && !allowed_values.include?(@category)
204
256
  return false
@@ -222,6 +274,19 @@ module PureCloud
222
274
 
223
275
 
224
276
 
277
+
278
+ if @metadata.nil?
279
+ return false
280
+ end
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
225
290
  end
226
291
 
227
292
 
@@ -238,6 +303,11 @@ module PureCloud
238
303
 
239
304
 
240
305
 
306
+
307
+
308
+
309
+
310
+
241
311
 
242
312
 
243
313
 
@@ -263,6 +333,16 @@ module PureCloud
263
333
 
264
334
 
265
335
 
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
266
346
 
267
347
 
268
348
 
@@ -279,6 +359,7 @@ module PureCloud
279
359
  def ==(o)
280
360
  return true if self.equal?(o)
281
361
  self.class == o.class &&
362
+ id == o.id &&
282
363
  name == o.name &&
283
364
  is_active == o.is_active &&
284
365
  is_default == o.is_default &&
@@ -286,7 +367,9 @@ module PureCloud
286
367
  length_in_minutes == o.length_in_minutes &&
287
368
  counts_as_paid_time == o.counts_as_paid_time &&
288
369
  counts_as_work_time == o.counts_as_work_time &&
289
- is_agent_time_off_selectable == o.is_agent_time_off_selectable
370
+ agent_time_off_selectable == o.agent_time_off_selectable &&
371
+ metadata == o.metadata &&
372
+ self_uri == o.self_uri
290
373
  end
291
374
 
292
375
  # @see the `==` method
@@ -298,7 +381,7 @@ module PureCloud
298
381
  # Calculates hash code according to all attributes.
299
382
  # @return [Fixnum] Hash code
300
383
  def hash
301
- [name, is_active, is_default, category, length_in_minutes, counts_as_paid_time, counts_as_work_time, is_agent_time_off_selectable].hash
384
+ [id, name, is_active, is_default, category, length_in_minutes, counts_as_paid_time, counts_as_work_time, agent_time_off_selectable, metadata, self_uri].hash
302
385
  end
303
386
 
304
387
  # build the object from hash
@@ -22,11 +22,16 @@ module PureCloud
22
22
  # Map of activity code id to activity code
23
23
  attr_accessor :activity_codes
24
24
 
25
+ # Version metadata for the associated management unit's list of activity codes
26
+ attr_accessor :metadata
27
+
25
28
  # Attribute mapping from ruby-style variable name to JSON key.
26
29
  def self.attribute_map
27
30
  {
28
31
 
29
- :'activity_codes' => :'activityCodes'
32
+ :'activity_codes' => :'activityCodes',
33
+
34
+ :'metadata' => :'metadata'
30
35
 
31
36
  }
32
37
  end
@@ -35,7 +40,9 @@ module PureCloud
35
40
  def self.swagger_types
36
41
  {
37
42
 
38
- :'activity_codes' => :'Hash<String, ActivityCode>'
43
+ :'activity_codes' => :'Hash<String, ActivityCode>',
44
+
45
+ :'metadata' => :'WfmVersionedEntityMetadata'
39
46
 
40
47
  }
41
48
  end
@@ -60,6 +67,15 @@ module PureCloud
60
67
  end
61
68
 
62
69
 
70
+ if attributes.has_key?(:'metadata')
71
+
72
+
73
+ self.metadata = attributes[:'metadata']
74
+
75
+
76
+ end
77
+
78
+
63
79
  end
64
80
 
65
81
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -79,6 +95,15 @@ module PureCloud
79
95
 
80
96
 
81
97
 
98
+
99
+ if @metadata.nil?
100
+ return false
101
+ end
102
+
103
+
104
+
105
+
106
+
82
107
  end
83
108
 
84
109
 
@@ -87,12 +112,18 @@ module PureCloud
87
112
 
88
113
 
89
114
 
115
+
116
+
117
+
118
+
119
+
90
120
  # Checks equality by comparing each attribute.
91
121
  # @param [Object] Object to be compared
92
122
  def ==(o)
93
123
  return true if self.equal?(o)
94
124
  self.class == o.class &&
95
- activity_codes == o.activity_codes
125
+ activity_codes == o.activity_codes &&
126
+ metadata == o.metadata
96
127
  end
97
128
 
98
129
  # @see the `==` method
@@ -104,7 +135,7 @@ module PureCloud
104
135
  # Calculates hash code according to all attributes.
105
136
  # @return [Fixnum] Hash code
106
137
  def hash
107
- [activity_codes].hash
138
+ [activity_codes, metadata].hash
108
139
  end
109
140
 
110
141
  # build the object from hash
@@ -70,7 +70,7 @@ module PureCloud
70
70
 
71
71
  :'track_on_queue_activity' => :'BOOLEAN',
72
72
 
73
- :'ignored_activity_categories' => :'Array<String>'
73
+ :'ignored_activity_categories' => :'IgnoredActivityCategories'
74
74
 
75
75
  }
76
76
  end
@@ -131,10 +131,8 @@ module PureCloud
131
131
 
132
132
  if attributes.has_key?(:'ignoredActivityCategories')
133
133
 
134
- if (value = attributes[:'ignoredActivityCategories']).is_a?(Array)
135
- self.ignored_activity_categories = value
136
- end
137
134
 
135
+ self.ignored_activity_categories = attributes[:'ignoredActivityCategories']
138
136
 
139
137
 
140
138
  end
@@ -0,0 +1,383 @@
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 BatchDownloadJobResult
21
+ # The globally unique identifier for the object.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :name
25
+
26
+ # Conversation id of the result
27
+ attr_accessor :conversation_id
28
+
29
+ # Recording id of the result
30
+ attr_accessor :recording_id
31
+
32
+ # URL of results... HTTP GET from this location to download results for this item
33
+ attr_accessor :result_url
34
+
35
+ # Content type of this result
36
+ attr_accessor :content_type
37
+
38
+ # An error message, in case of failed processing will indicate the cause of the failure
39
+ attr_accessor :error_msg
40
+
41
+ # The URI for this object
42
+ attr_accessor :self_uri
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+
48
+ :'id' => :'id',
49
+
50
+ :'name' => :'name',
51
+
52
+ :'conversation_id' => :'conversationId',
53
+
54
+ :'recording_id' => :'recordingId',
55
+
56
+ :'result_url' => :'resultUrl',
57
+
58
+ :'content_type' => :'contentType',
59
+
60
+ :'error_msg' => :'errorMsg',
61
+
62
+ :'self_uri' => :'selfUri'
63
+
64
+ }
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.swagger_types
69
+ {
70
+
71
+ :'id' => :'String',
72
+
73
+ :'name' => :'String',
74
+
75
+ :'conversation_id' => :'String',
76
+
77
+ :'recording_id' => :'String',
78
+
79
+ :'result_url' => :'String',
80
+
81
+ :'content_type' => :'String',
82
+
83
+ :'error_msg' => :'String',
84
+
85
+ :'self_uri' => :'String'
86
+
87
+ }
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ return unless attributes.is_a?(Hash)
94
+
95
+ # convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
97
+
98
+
99
+ if attributes.has_key?(:'id')
100
+
101
+
102
+ self.id = attributes[:'id']
103
+
104
+
105
+ end
106
+
107
+
108
+ if attributes.has_key?(:'name')
109
+
110
+
111
+ self.name = attributes[:'name']
112
+
113
+
114
+ end
115
+
116
+
117
+ if attributes.has_key?(:'conversationId')
118
+
119
+
120
+ self.conversation_id = attributes[:'conversationId']
121
+
122
+
123
+ end
124
+
125
+
126
+ if attributes.has_key?(:'recordingId')
127
+
128
+
129
+ self.recording_id = attributes[:'recordingId']
130
+
131
+
132
+ end
133
+
134
+
135
+ if attributes.has_key?(:'resultUrl')
136
+
137
+
138
+ self.result_url = attributes[:'resultUrl']
139
+
140
+
141
+ end
142
+
143
+
144
+ if attributes.has_key?(:'contentType')
145
+
146
+
147
+ self.content_type = attributes[:'contentType']
148
+
149
+
150
+ end
151
+
152
+
153
+ if attributes.has_key?(:'errorMsg')
154
+
155
+
156
+ self.error_msg = attributes[:'errorMsg']
157
+
158
+
159
+ end
160
+
161
+
162
+ if attributes.has_key?(:'selfUri')
163
+
164
+
165
+ self.self_uri = attributes[:'selfUri']
166
+
167
+
168
+ end
169
+
170
+
171
+ end
172
+
173
+ # Show invalid properties with the reasons. Usually used together with valid?
174
+ # @return Array for valid properies with the reasons
175
+ def list_invalid_properties
176
+ invalid_properties = Array.new
177
+
178
+
179
+ return invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
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
+ end
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+ # Checks equality by comparing each attribute.
262
+ # @param [Object] Object to be compared
263
+ def ==(o)
264
+ return true if self.equal?(o)
265
+ self.class == o.class &&
266
+ id == o.id &&
267
+ name == o.name &&
268
+ conversation_id == o.conversation_id &&
269
+ recording_id == o.recording_id &&
270
+ result_url == o.result_url &&
271
+ content_type == o.content_type &&
272
+ error_msg == o.error_msg &&
273
+ self_uri == o.self_uri
274
+ end
275
+
276
+ # @see the `==` method
277
+ # @param [Object] Object to be compared
278
+ def eql?(o)
279
+ self == o
280
+ end
281
+
282
+ # Calculates hash code according to all attributes.
283
+ # @return [Fixnum] Hash code
284
+ def hash
285
+ [id, name, conversation_id, recording_id, result_url, content_type, error_msg, self_uri].hash
286
+ end
287
+
288
+ # build the object from hash
289
+ def build_from_hash(attributes)
290
+ return nil unless attributes.is_a?(Hash)
291
+ self.class.swagger_types.each_pair do |key, type|
292
+ if type =~ /^Array<(.*)>/i
293
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
294
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
295
+ else
296
+ #TODO show warning in debug mode
297
+ end
298
+ elsif !attributes[self.class.attribute_map[key]].nil?
299
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
300
+ else
301
+ # data not found in attributes(hash), not an issue as the data can be optional
302
+ end
303
+ end
304
+
305
+ self
306
+ end
307
+
308
+ def _deserialize(type, value)
309
+ case type.to_sym
310
+ when :DateTime
311
+ DateTime.parse(value)
312
+ when :Date
313
+ Date.parse(value)
314
+ when :String
315
+ value.to_s
316
+ when :Integer
317
+ value.to_i
318
+ when :Float
319
+ value.to_f
320
+ when :BOOLEAN
321
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
322
+ true
323
+ else
324
+ false
325
+ end
326
+ when :Object
327
+ # generic object (usually a Hash), return directly
328
+ value
329
+ when /\AArray<(?<inner_type>.+)>\z/
330
+ inner_type = Regexp.last_match[:inner_type]
331
+ value.map { |v| _deserialize(inner_type, v) }
332
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
333
+ k_type = Regexp.last_match[:k_type]
334
+ v_type = Regexp.last_match[:v_type]
335
+ {}.tap do |hash|
336
+ value.each do |k, v|
337
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
338
+ end
339
+ end
340
+ else # model
341
+ _model = Object.const_get("PureCloud").const_get(type).new
342
+ _model.build_from_hash(value)
343
+ end
344
+ end
345
+
346
+ def to_s
347
+ to_hash.to_s
348
+ end
349
+
350
+ # to_body is an alias to to_body (backward compatibility))
351
+ def to_body
352
+ to_hash
353
+ end
354
+
355
+ # return the object in the form of hash
356
+ def to_hash
357
+ hash = {}
358
+ self.class.attribute_map.each_pair do |attr, param|
359
+ value = self.send(attr)
360
+ next if value.nil?
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ # Method to output non-array value in the form of hash
367
+ # For object, use to_hash. Otherwise, just return the value
368
+ def _to_hash(value)
369
+ if value.is_a?(Array)
370
+ value.compact.map{ |v| _to_hash(v) }
371
+ elsif value.is_a?(Hash)
372
+ {}.tap do |hash|
373
+ value.each { |k, v| hash[k] = _to_hash(v) }
374
+ end
375
+ elsif value.respond_to? :to_hash
376
+ value.to_hash
377
+ else
378
+ value
379
+ end
380
+ end
381
+
382
+ end
383
+ end