purecloudplatformclientv2 95.0.0 → 96.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/AnalyticsProposedAgent.md +14 -0
  4. data/docs/AnalyticsSession.md +2 -0
  5. data/docs/ArrayNode.md +4 -4
  6. data/docs/AuditApi.md +60 -0
  7. data/docs/BuAgentSchedulesQueryResponse.md +1 -0
  8. data/docs/CoachingApi.md +80 -2
  9. data/docs/CoachingAppointmentAggregateRequest.md +16 -0
  10. data/docs/CoachingAppointmentAggregateResponse.md +13 -0
  11. data/docs/CoachingAppointmentResponse.md +1 -0
  12. data/docs/ConversationMetrics.md +15 -0
  13. data/docs/ExternalOrganizationTrustorLink.md +1 -2
  14. data/docs/GenericSAML.md +1 -1
  15. data/docs/JsonNode.md +4 -4
  16. data/docs/OAuthClient.md +1 -0
  17. data/docs/OAuthClientListing.md +1 -0
  18. data/docs/OAuthClientRequest.md +1 -0
  19. data/docs/OrgOAuthClient.md +1 -0
  20. data/docs/Permissions.md +0 -2
  21. data/docs/QueryRequestClause.md +14 -0
  22. data/docs/QueryRequestFilter.md +14 -0
  23. data/docs/QueryRequestPredicate.md +14 -0
  24. data/docs/QueryResponseData.md +14 -0
  25. data/docs/QueryResponseGroupedData.md +14 -0
  26. data/docs/QueryResponseMetric.md +14 -0
  27. data/docs/QueryResponseStats.md +13 -0
  28. data/docs/ReportingDataExportTopicDataExportNotification.md +1 -0
  29. data/docs/ReportingExportJobResponse.md +1 -0
  30. data/docs/RoutingApi.md +1 -1
  31. data/docs/SearchApi.md +2 -1
  32. data/docs/SpeechTextAnalyticsApi.md +66 -0
  33. data/docs/StatEventFlowOutcomeTopicDatum.md +14 -0
  34. data/docs/StatEventFlowOutcomeTopicMetric.md +15 -0
  35. data/docs/StatEventFlowOutcomeTopicStatsNotification.md +14 -0
  36. data/docs/StatEventFlowTopicDatum.md +14 -0
  37. data/docs/StatEventFlowTopicMetric.md +15 -0
  38. data/docs/StatEventFlowTopicStatsNotification.md +14 -0
  39. data/docs/StatEventWrapUpCodeTopicDatum.md +14 -0
  40. data/docs/StatEventWrapUpCodeTopicMetric.md +15 -0
  41. data/docs/StatEventWrapUpCodeTopicStatsNotification.md +14 -0
  42. data/docs/UserScheduleAdherence.md +1 -0
  43. data/docs/UserSearchRequest.md +1 -0
  44. data/docs/UsersApi.md +2 -1
  45. data/docs/WemCoachingAppointmentTopicCoachingAppointmentNotification.md +1 -0
  46. data/docs/WfmBusinessUnitReference.md +1 -1
  47. data/docs/WfmScheduleReference.md +3 -3
  48. data/docs/WfmUserScheduleAdherenceUpdatedMuTopicUriReference.md +14 -0
  49. data/docs/WfmUserScheduleAdherenceUpdatedMuTopicUserScheduleAdherenceUpdate.md +1 -0
  50. data/docs/WfmUserScheduleAdherenceUpdatedTeamTopicQueueReference.md +13 -0
  51. data/docs/WfmUserScheduleAdherenceUpdatedTeamTopicUriReference.md +14 -0
  52. data/docs/WfmUserScheduleAdherenceUpdatedTeamTopicUserReference.md +13 -0
  53. data/docs/WfmUserScheduleAdherenceUpdatedTeamTopicUserScheduleAdherenceUpdate.md +28 -0
  54. data/docs/WfmUserScheduleAdherenceUpdatedTopicUriReference.md +14 -0
  55. data/docs/WfmUserScheduleAdherenceUpdatedTopicUserScheduleAdherenceUpdate.md +1 -0
  56. data/lib/purecloudplatformclientv2.rb +26 -0
  57. data/lib/purecloudplatformclientv2/api/audit_api.rb +55 -0
  58. data/lib/purecloudplatformclientv2/api/coaching_api.rb +127 -0
  59. data/lib/purecloudplatformclientv2/api/routing_api.rb +2 -2
  60. data/lib/purecloudplatformclientv2/api/speech_text_analytics_api.rb +65 -0
  61. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  62. data/lib/purecloudplatformclientv2/models/acw_settings.rb +2 -2
  63. data/lib/purecloudplatformclientv2/models/analytics_proposed_agent.rb +228 -0
  64. data/lib/purecloudplatformclientv2/models/analytics_session.rb +58 -4
  65. data/lib/purecloudplatformclientv2/models/array_node.rb +54 -54
  66. data/lib/purecloudplatformclientv2/models/audit_log_message.rb +6 -6
  67. data/lib/purecloudplatformclientv2/models/audit_query_entity.rb +2 -2
  68. data/lib/purecloudplatformclientv2/models/audit_query_execution_status_response.rb +2 -2
  69. data/lib/purecloudplatformclientv2/models/audit_query_request.rb +2 -2
  70. data/lib/purecloudplatformclientv2/models/audit_query_service.rb +2 -2
  71. data/lib/purecloudplatformclientv2/models/audit_realtime_query_request.rb +2 -2
  72. data/lib/purecloudplatformclientv2/models/bu_agent_schedules_query_response.rb +30 -4
  73. data/lib/purecloudplatformclientv2/models/coaching_appointment_aggregate_request.rb +294 -0
  74. data/lib/purecloudplatformclientv2/models/coaching_appointment_aggregate_response.rb +204 -0
  75. data/lib/purecloudplatformclientv2/models/coaching_appointment_response.rb +27 -1
  76. data/lib/purecloudplatformclientv2/models/conversation_aggregate_query_predicate.rb +2 -2
  77. data/lib/purecloudplatformclientv2/models/conversation_event_topic_message.rb +2 -2
  78. data/lib/purecloudplatformclientv2/models/conversation_message_event_topic_message_media_participant.rb +2 -2
  79. data/lib/purecloudplatformclientv2/models/conversation_metrics.rb +254 -0
  80. data/lib/purecloudplatformclientv2/models/create_outbound_messaging_conversation_request.rb +2 -2
  81. data/lib/purecloudplatformclientv2/models/event_message.rb +2 -2
  82. data/lib/purecloudplatformclientv2/models/external_organization_trustor_link.rb +8 -34
  83. data/lib/purecloudplatformclientv2/models/flow_aggregate_query_predicate.rb +2 -2
  84. data/lib/purecloudplatformclientv2/models/generic_saml.rb +12 -12
  85. data/lib/purecloudplatformclientv2/models/ip_address_range.rb +2 -2
  86. data/lib/purecloudplatformclientv2/models/journey_aggregate_query_predicate.rb +2 -2
  87. data/lib/purecloudplatformclientv2/models/json_node.rb +54 -54
  88. data/lib/purecloudplatformclientv2/models/message.rb +2 -2
  89. data/lib/purecloudplatformclientv2/models/message_data.rb +2 -2
  90. data/lib/purecloudplatformclientv2/models/message_media_participant.rb +2 -2
  91. data/lib/purecloudplatformclientv2/models/messaging_integration.rb +2 -2
  92. data/lib/purecloudplatformclientv2/models/messaging_sticker.rb +2 -2
  93. data/lib/purecloudplatformclientv2/models/o_auth_client.rb +27 -1
  94. data/lib/purecloudplatformclientv2/models/o_auth_client_listing.rb +27 -1
  95. data/lib/purecloudplatformclientv2/models/o_auth_client_request.rb +30 -4
  96. data/lib/purecloudplatformclientv2/models/org_o_auth_client.rb +27 -1
  97. data/lib/purecloudplatformclientv2/models/participant.rb +2 -2
  98. data/lib/purecloudplatformclientv2/models/participant_basic.rb +2 -2
  99. data/lib/purecloudplatformclientv2/models/permissions.rb +1 -52
  100. data/lib/purecloudplatformclientv2/models/query_request_clause.rb +254 -0
  101. data/lib/purecloudplatformclientv2/models/query_request_filter.rb +254 -0
  102. data/lib/purecloudplatformclientv2/models/query_request_predicate.rb +252 -0
  103. data/lib/purecloudplatformclientv2/models/query_response_data.rb +230 -0
  104. data/lib/purecloudplatformclientv2/models/query_response_grouped_data.rb +232 -0
  105. data/lib/purecloudplatformclientv2/models/query_response_metric.rb +242 -0
  106. data/lib/purecloudplatformclientv2/models/query_response_stats.rb +202 -0
  107. data/lib/purecloudplatformclientv2/models/queue_conversation_event_topic_message.rb +2 -2
  108. data/lib/purecloudplatformclientv2/models/queue_conversation_message_event_topic_message_media_participant.rb +2 -2
  109. data/lib/purecloudplatformclientv2/models/queue_conversation_social_expression_event_topic_message.rb +2 -2
  110. data/lib/purecloudplatformclientv2/models/queue_conversation_video_event_topic_message.rb +2 -2
  111. data/lib/purecloudplatformclientv2/models/recipient.rb +2 -2
  112. data/lib/purecloudplatformclientv2/models/reporting_data_export_topic_data_export_notification.rb +26 -1
  113. data/lib/purecloudplatformclientv2/models/reporting_export_job_response.rb +32 -1
  114. data/lib/purecloudplatformclientv2/models/segment_detail_query_predicate.rb +2 -2
  115. data/lib/purecloudplatformclientv2/models/send_agentless_outbound_message_request.rb +2 -2
  116. data/lib/purecloudplatformclientv2/models/send_agentless_outbound_message_response.rb +2 -2
  117. data/lib/purecloudplatformclientv2/models/stat_event_flow_outcome_topic_datum.rb +228 -0
  118. data/lib/purecloudplatformclientv2/models/stat_event_flow_outcome_topic_metric.rb +253 -0
  119. data/lib/purecloudplatformclientv2/models/stat_event_flow_outcome_topic_stats_notification.rb +230 -0
  120. data/lib/purecloudplatformclientv2/models/stat_event_flow_topic_datum.rb +228 -0
  121. data/lib/purecloudplatformclientv2/models/stat_event_flow_topic_metric.rb +253 -0
  122. data/lib/purecloudplatformclientv2/models/stat_event_flow_topic_stats_notification.rb +230 -0
  123. data/lib/purecloudplatformclientv2/models/stat_event_wrap_up_code_topic_datum.rb +228 -0
  124. data/lib/purecloudplatformclientv2/models/stat_event_wrap_up_code_topic_metric.rb +253 -0
  125. data/lib/purecloudplatformclientv2/models/stat_event_wrap_up_code_topic_stats_notification.rb +230 -0
  126. data/lib/purecloudplatformclientv2/models/user_schedule_adherence.rb +27 -1
  127. data/lib/purecloudplatformclientv2/models/user_search_request.rb +30 -4
  128. data/lib/purecloudplatformclientv2/models/wem_coaching_appointment_topic_coaching_appointment_notification.rb +29 -4
  129. data/lib/purecloudplatformclientv2/models/wfm_business_unit_reference.rb +6 -1
  130. data/lib/purecloudplatformclientv2/models/wfm_schedule_reference.rb +16 -1
  131. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_mu_topic_uri_reference.rb +226 -0
  132. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_mu_topic_user_schedule_adherence_update.rb +26 -1
  133. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_team_topic_queue_reference.rb +201 -0
  134. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_team_topic_uri_reference.rb +226 -0
  135. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_team_topic_user_reference.rb +201 -0
  136. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_team_topic_user_schedule_adherence_update.rb +606 -0
  137. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_topic_uri_reference.rb +226 -0
  138. data/lib/purecloudplatformclientv2/models/wfm_user_schedule_adherence_updated_topic_user_schedule_adherence_update.rb +26 -1
  139. data/lib/purecloudplatformclientv2/version.rb +1 -1
  140. metadata +55 -3
@@ -0,0 +1,252 @@
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: UNLICENSED
11
+ https://help.mypurecloud.com/articles/terms-and-conditions/
12
+
13
+ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class QueryRequestPredicate
21
+ # The dimension to be filtered
22
+ attr_accessor :dimension
23
+
24
+ # The value to filter by
25
+ attr_accessor :value
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'dimension' => :'dimension',
32
+
33
+ :'value' => :'value'
34
+
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+
42
+ :'dimension' => :'String',
43
+
44
+ :'value' => :'String'
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?(:'dimension')
59
+
60
+
61
+ self.dimension = attributes[:'dimension']
62
+
63
+
64
+ end
65
+
66
+
67
+ if attributes.has_key?(:'value')
68
+
69
+
70
+ self.value = attributes[:'value']
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 @dimension.nil?
93
+ return false
94
+ end
95
+
96
+
97
+
98
+ allowed_values = ["attendeeId", "facilitatorId", "status"]
99
+ if @dimension && !allowed_values.include?(@dimension)
100
+ return false
101
+ end
102
+
103
+
104
+
105
+
106
+ if @value.nil?
107
+ return false
108
+ end
109
+
110
+
111
+
112
+
113
+
114
+ end
115
+
116
+
117
+
118
+ # Custom attribute writer method checking allowed values (enum).
119
+ # @param [Object] dimension Object to be assigned
120
+ def dimension=(dimension)
121
+ allowed_values = ["attendeeId", "facilitatorId", "status"]
122
+ if dimension && !allowed_values.include?(dimension)
123
+ fail ArgumentError, "invalid value for 'dimension', must be one of #{allowed_values}."
124
+ end
125
+ @dimension = dimension
126
+ end
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ dimension == o.dimension &&
142
+ value == o.value
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Fixnum] Hash code
153
+ def hash
154
+ [dimension, value].hash
155
+ end
156
+
157
+ # build the object from hash
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ self.class.swagger_types.each_pair do |key, type|
161
+ if type =~ /^Array<(.*)>/i
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
164
+ else
165
+ #TODO show warning in debug mode
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ else
170
+ # data not found in attributes(hash), not an issue as the data can be optional
171
+ end
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :DateTime
180
+ DateTime.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :BOOLEAN
190
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ _model = Object.const_get("PureCloud").const_get(type).new
211
+ _model.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_body (backward compatibility))
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # return the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ next if value.nil?
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Method to output non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map{ |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+
251
+ end
252
+ end
@@ -0,0 +1,230 @@
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: UNLICENSED
11
+ https://help.mypurecloud.com/articles/terms-and-conditions/
12
+
13
+ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class QueryResponseData
21
+ # Interval with start and end represented as ISO-8601 string. i.e: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'/yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
22
+ attr_accessor :interval
23
+
24
+ # A list of aggregated metrics
25
+ attr_accessor :metrics
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'interval' => :'interval',
32
+
33
+ :'metrics' => :'metrics'
34
+
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+
42
+ :'interval' => :'String',
43
+
44
+ :'metrics' => :'Array<QueryResponseMetric>'
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?(:'interval')
59
+
60
+
61
+ self.interval = attributes[:'interval']
62
+
63
+
64
+ end
65
+
66
+
67
+ if attributes.has_key?(:'metrics')
68
+
69
+ if (value = attributes[:'metrics']).is_a?(Array)
70
+ self.metrics = value
71
+ end
72
+
73
+
74
+
75
+ end
76
+
77
+
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properies with the reasons
82
+ def list_invalid_properties
83
+ invalid_properties = Array.new
84
+
85
+
86
+ return invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ end
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ interval == o.interval &&
120
+ metrics == o.metrics
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Fixnum] Hash code
131
+ def hash
132
+ [interval, metrics].hash
133
+ end
134
+
135
+ # build the object from hash
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /^Array<(.*)>/i
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
142
+ else
143
+ #TODO show warning in debug mode
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ else
148
+ # data not found in attributes(hash), not an issue as the data can be optional
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :DateTime
158
+ DateTime.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :BOOLEAN
168
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ _model = Object.const_get("PureCloud").const_get(type).new
189
+ _model.build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_body (backward compatibility))
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # return the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ next if value.nil?
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Method to output non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map{ |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+ end