purecloudplatformclientv2 22.0.0 → 23.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -17,11 +17,11 @@ Terms of Service: https://developer.mypurecloud.com/tos
17
17
  require 'date'
18
18
 
19
19
  module PureCloud
20
- class TrustUserCreate
21
- # Trustee User Id
20
+ class TrustMemberCreate
21
+ # Trustee User or Group Id
22
22
  attr_accessor :id
23
23
 
24
- # The list of trustor organization roles granting this user access.
24
+ # The list of trustor organization roles granting this user or group access.
25
25
  attr_accessor :role_ids
26
26
 
27
27
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -33,6 +33,9 @@ module PureCloud
33
33
  # The list of trustee users that are requesting access.
34
34
  attr_accessor :users
35
35
 
36
+ # The list of trustee groups that are requesting access.
37
+ attr_accessor :groups
38
+
36
39
  # The URI for this object
37
40
  attr_accessor :self_uri
38
41
 
@@ -50,6 +53,8 @@ module PureCloud
50
53
 
51
54
  :'users' => :'users',
52
55
 
56
+ :'groups' => :'groups',
57
+
53
58
  :'self_uri' => :'selfUri'
54
59
 
55
60
  }
@@ -69,6 +74,8 @@ module PureCloud
69
74
 
70
75
  :'users' => :'Array<OrgUser>',
71
76
 
77
+ :'groups' => :'Array<TrustGroup>',
78
+
72
79
  :'self_uri' => :'String'
73
80
 
74
81
  }
@@ -127,6 +134,17 @@ module PureCloud
127
134
 
128
135
 
129
136
 
137
+ end
138
+
139
+
140
+ if attributes.has_key?(:'groups')
141
+
142
+ if (value = attributes[:'groups']).is_a?(Array)
143
+ self.groups = value
144
+ end
145
+
146
+
147
+
130
148
  end
131
149
 
132
150
 
@@ -176,10 +194,9 @@ module PureCloud
176
194
 
177
195
 
178
196
 
179
- if @users.nil?
180
- return false
181
- end
182
-
197
+
198
+
199
+
183
200
 
184
201
 
185
202
 
@@ -215,6 +232,11 @@ module PureCloud
215
232
 
216
233
 
217
234
 
235
+
236
+
237
+
238
+
239
+
218
240
 
219
241
 
220
242
 
@@ -231,6 +253,7 @@ module PureCloud
231
253
  date_created == o.date_created &&
232
254
  trustee == o.trustee &&
233
255
  users == o.users &&
256
+ groups == o.groups &&
234
257
  self_uri == o.self_uri
235
258
  end
236
259
 
@@ -243,7 +266,7 @@ module PureCloud
243
266
  # Calculates hash code according to all attributes.
244
267
  # @return [Fixnum] Hash code
245
268
  def hash
246
- [id, created_by, date_created, trustee, users, self_uri].hash
269
+ [id, created_by, date_created, trustee, users, groups, self_uri].hash
247
270
  end
248
271
 
249
272
  # build the object from hash
@@ -18,14 +18,19 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class TrustRequestCreate
21
- # The list of trustee users that are requesting access.
21
+ # The list of trustee users that are requesting access. If no users are specified, at least one group is required.
22
22
  attr_accessor :user_ids
23
23
 
24
+ # The list of trustee groups that are requesting access. If no groups are specified, at least one user is required.
25
+ attr_accessor :group_ids
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
 
28
- :'user_ids' => :'userIds'
31
+ :'user_ids' => :'userIds',
32
+
33
+ :'group_ids' => :'groupIds'
29
34
 
30
35
  }
31
36
  end
@@ -34,7 +39,9 @@ module PureCloud
34
39
  def self.swagger_types
35
40
  {
36
41
 
37
- :'user_ids' => :'Array<String>'
42
+ :'user_ids' => :'Array<String>',
43
+
44
+ :'group_ids' => :'Array<String>'
38
45
 
39
46
  }
40
47
  end
@@ -59,6 +66,17 @@ module PureCloud
59
66
  end
60
67
 
61
68
 
69
+ if attributes.has_key?(:'groupIds')
70
+
71
+ if (value = attributes[:'groupIds']).is_a?(Array)
72
+ self.group_ids = value
73
+ end
74
+
75
+
76
+
77
+ end
78
+
79
+
62
80
  end
63
81
 
64
82
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -75,10 +93,9 @@ module PureCloud
75
93
  def valid?
76
94
 
77
95
 
78
- if @user_ids.nil?
79
- return false
80
- end
81
-
96
+
97
+
98
+
82
99
 
83
100
 
84
101
 
@@ -91,12 +108,18 @@ module PureCloud
91
108
 
92
109
 
93
110
 
111
+
112
+
113
+
114
+
115
+
94
116
  # Checks equality by comparing each attribute.
95
117
  # @param [Object] Object to be compared
96
118
  def ==(o)
97
119
  return true if self.equal?(o)
98
120
  self.class == o.class &&
99
- user_ids == o.user_ids
121
+ user_ids == o.user_ids &&
122
+ group_ids == o.group_ids
100
123
  end
101
124
 
102
125
  # @see the `==` method
@@ -108,7 +131,7 @@ module PureCloud
108
131
  # Calculates hash code according to all attributes.
109
132
  # @return [Fixnum] Hash code
110
133
  def hash
111
- [user_ids].hash
134
+ [user_ids, group_ids].hash
112
135
  end
113
136
 
114
137
  # build the object from hash
@@ -23,31 +23,34 @@ module PureCloud
23
23
 
24
24
  attr_accessor :name
25
25
 
26
- # The resource's description.
26
+ # The queue description.
27
27
  attr_accessor :description
28
28
 
29
- # The current version of the resource.
29
+ # The current version of the queue.
30
30
  attr_accessor :version
31
31
 
32
- # The date the resource was created. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
32
+ # The division to which this queue belongs.
33
+ attr_accessor :division
34
+
35
+ # The date the queue was created. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
33
36
  attr_accessor :date_created
34
37
 
35
- # The date of the last modification to the resource. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
38
+ # The date of the last modification to the queue. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
36
39
  attr_accessor :date_modified
37
40
 
38
- # The ID of the user that last modified the resource.
41
+ # The ID of the user that last modified the queue.
39
42
  attr_accessor :modified_by
40
43
 
41
- # The ID of the user that created the resource.
44
+ # The ID of the user that created the queue.
42
45
  attr_accessor :created_by
43
46
 
44
- # Indicates if the resource is active, inactive, or deleted.
47
+ # Indicates if the queue is active, inactive, or deleted.
45
48
  attr_accessor :state
46
49
 
47
- # The application that last modified the resource.
50
+ # The application that last modified the queue.
48
51
  attr_accessor :modified_by_app
49
52
 
50
- # The application that created the resource.
53
+ # The application that created the queue.
51
54
  attr_accessor :created_by_app
52
55
 
53
56
  # The media settings for the queue. Valid Key Values: CALL, CALLBACK, CHAT, EMAIL, SOCIAL_EXPRESSION
@@ -65,10 +68,10 @@ module PureCloud
65
68
  # The in-queue flow to use for conversations waiting in queue.
66
69
  attr_accessor :queue_flow
67
70
 
68
- # The prompt used for whisper audio on the queue, if configured.
71
+ # ID of the whisper configured for this queue, if any.
69
72
  attr_accessor :whisper
70
73
 
71
- # Specifies whether the configured whisper audio should play for all ACD calls, or only for those which are auto-answered.
74
+ # Specifies whether the configured whisper should play for all ACD calls, or only for those which are auto-answered.
72
75
  attr_accessor :auto_answer_only
73
76
 
74
77
  # The name to use for caller identification for outbound calls from this queue.
@@ -101,6 +104,8 @@ module PureCloud
101
104
 
102
105
  :'version' => :'version',
103
106
 
107
+ :'division' => :'division',
108
+
104
109
  :'date_created' => :'dateCreated',
105
110
 
106
111
  :'date_modified' => :'dateModified',
@@ -158,6 +163,8 @@ module PureCloud
158
163
 
159
164
  :'version' => :'Integer',
160
165
 
166
+ :'division' => :'UriReference',
167
+
161
168
  :'date_created' => :'DateTime',
162
169
 
163
170
  :'date_modified' => :'DateTime',
@@ -248,6 +255,15 @@ module PureCloud
248
255
  end
249
256
 
250
257
 
258
+ if attributes.has_key?(:'division')
259
+
260
+
261
+ self.division = attributes[:'division']
262
+
263
+
264
+ end
265
+
266
+
251
267
  if attributes.has_key?(:'dateCreated')
252
268
 
253
269
 
@@ -485,6 +501,10 @@ module PureCloud
485
501
 
486
502
 
487
503
 
504
+
505
+
506
+
507
+
488
508
 
489
509
 
490
510
 
@@ -619,6 +639,11 @@ module PureCloud
619
639
 
620
640
 
621
641
 
642
+
643
+
644
+
645
+
646
+
622
647
 
623
648
 
624
649
 
@@ -736,6 +761,7 @@ module PureCloud
736
761
  name == o.name &&
737
762
  description == o.description &&
738
763
  version == o.version &&
764
+ division == o.division &&
739
765
  date_created == o.date_created &&
740
766
  date_modified == o.date_modified &&
741
767
  modified_by == o.modified_by &&
@@ -768,7 +794,7 @@ module PureCloud
768
794
  # Calculates hash code according to all attributes.
769
795
  # @return [Fixnum] Hash code
770
796
  def hash
771
- [id, name, description, version, date_created, date_modified, modified_by, created_by, state, modified_by_app, created_by_app, media_settings, bullseye, acw_settings, skill_evaluation_method, queue_flow, whisper, auto_answer_only, calling_party_name, calling_party_number, default_scripts, outbound_email_address, joined, member_count, self_uri].hash
797
+ [id, name, description, version, division, date_created, date_modified, modified_by, created_by, state, modified_by_app, created_by_app, media_settings, bullseye, acw_settings, skill_evaluation_method, queue_flow, whisper, auto_answer_only, calling_party_name, calling_party_number, default_scripts, outbound_email_address, joined, member_count, self_uri].hash
772
798
  end
773
799
 
774
800
  # build the object from hash
@@ -0,0 +1,260 @@
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
+ # Metadata to associate with a given entity
21
+ class WfmVersionedEntityMetadata
22
+ # The version of the associated entity. Used to prevent conflicts on concurrent edits
23
+ attr_accessor :version
24
+
25
+ # The user who last modified the associated entity
26
+ attr_accessor :modified_by
27
+
28
+ # The date the associated entity was last modified. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
29
+ attr_accessor :date_modified
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+
35
+ :'version' => :'version',
36
+
37
+ :'modified_by' => :'modifiedBy',
38
+
39
+ :'date_modified' => :'dateModified'
40
+
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+
48
+ :'version' => :'Integer',
49
+
50
+ :'modified_by' => :'UserReference',
51
+
52
+ :'date_modified' => :'DateTime'
53
+
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
64
+
65
+
66
+ if attributes.has_key?(:'version')
67
+
68
+
69
+ self.version = attributes[:'version']
70
+
71
+
72
+ end
73
+
74
+
75
+ if attributes.has_key?(:'modifiedBy')
76
+
77
+
78
+ self.modified_by = attributes[:'modifiedBy']
79
+
80
+
81
+ end
82
+
83
+
84
+ if attributes.has_key?(:'dateModified')
85
+
86
+
87
+ self.date_modified = attributes[:'dateModified']
88
+
89
+
90
+ end
91
+
92
+
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properies with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+
100
+
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+
108
+
109
+ if @version.nil?
110
+ return false
111
+ end
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ end
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+ # Checks equality by comparing each attribute.
144
+ # @param [Object] Object to be compared
145
+ def ==(o)
146
+ return true if self.equal?(o)
147
+ self.class == o.class &&
148
+ version == o.version &&
149
+ modified_by == o.modified_by &&
150
+ date_modified == o.date_modified
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [version, modified_by, date_modified].hash
163
+ end
164
+
165
+ # build the object from hash
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.swagger_types.each_pair do |key, type|
169
+ if type =~ /^Array<(.*)>/i
170
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
171
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
172
+ else
173
+ #TODO show warning in debug mode
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ else
178
+ # data not found in attributes(hash), not an issue as the data can be optional
179
+ end
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :BOOLEAN
198
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ _model = Object.const_get("PureCloud").const_get(type).new
219
+ _model.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_body (backward compatibility))
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # return the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ next if value.nil?
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Method to output non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ def _to_hash(value)
246
+ if value.is_a?(Array)
247
+ value.compact.map{ |v| _to_hash(v) }
248
+ elsif value.is_a?(Hash)
249
+ {}.tap do |hash|
250
+ value.each { |k, v| hash[k] = _to_hash(v) }
251
+ end
252
+ elsif value.respond_to? :to_hash
253
+ value.to_hash
254
+ else
255
+ value
256
+ end
257
+ end
258
+
259
+ end
260
+ end