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,232 @@
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 QueryResponseGroupedData
21
+ # The group values for this data
22
+ attr_accessor :group
23
+
24
+ # The metrics in this group
25
+ attr_accessor :data
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'group' => :'group',
32
+
33
+ :'data' => :'data'
34
+
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+
42
+ :'group' => :'Hash<String, String>',
43
+
44
+ :'data' => :'Array<QueryResponseData>'
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?(:'group')
59
+
60
+ if (value = attributes[:'group']).is_a?(Array)
61
+ self.group = value
62
+ end
63
+
64
+
65
+
66
+ end
67
+
68
+
69
+ if attributes.has_key?(:'data')
70
+
71
+ if (value = attributes[:'data']).is_a?(Array)
72
+ self.data = value
73
+ end
74
+
75
+
76
+
77
+ end
78
+
79
+
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properies with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+
87
+
88
+ return invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ end
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ group == o.group &&
122
+ data == o.data
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Fixnum] Hash code
133
+ def hash
134
+ [group, data].hash
135
+ end
136
+
137
+ # build the object from hash
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.swagger_types.each_pair do |key, type|
141
+ if type =~ /^Array<(.*)>/i
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
144
+ else
145
+ #TODO show warning in debug mode
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ else
150
+ # data not found in attributes(hash), not an issue as the data can be optional
151
+ end
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ _model = Object.const_get("PureCloud").const_get(type).new
191
+ _model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_body (backward compatibility))
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # return the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ next if value.nil?
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Method to output non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map{ |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ end
232
+ end
@@ -0,0 +1,242 @@
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 QueryResponseMetric
21
+ # The metric this applies to
22
+ attr_accessor :metric
23
+
24
+ # The aggregated values for this metric
25
+ attr_accessor :stats
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'metric' => :'metric',
32
+
33
+ :'stats' => :'stats'
34
+
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+
42
+ :'metric' => :'String',
43
+
44
+ :'stats' => :'QueryResponseStats'
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?(:'metric')
59
+
60
+
61
+ self.metric = attributes[:'metric']
62
+
63
+
64
+ end
65
+
66
+
67
+ if attributes.has_key?(:'stats')
68
+
69
+
70
+ self.stats = attributes[:'stats']
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
+
93
+ allowed_values = ["nActivities", "nPlannedActivities", "nInProgressActivities", "nCompleteActivities", "nOverdueActivities", "nInvalidScheduleActivities"]
94
+ if @metric && !allowed_values.include?(@metric)
95
+ return false
96
+ end
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ end
105
+
106
+
107
+
108
+ # Custom attribute writer method checking allowed values (enum).
109
+ # @param [Object] metric Object to be assigned
110
+ def metric=(metric)
111
+ allowed_values = ["nActivities", "nPlannedActivities", "nInProgressActivities", "nCompleteActivities", "nOverdueActivities", "nInvalidScheduleActivities"]
112
+ if metric && !allowed_values.include?(metric)
113
+ fail ArgumentError, "invalid value for 'metric', must be one of #{allowed_values}."
114
+ end
115
+ @metric = metric
116
+ end
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ # Checks equality by comparing each attribute.
127
+ # @param [Object] Object to be compared
128
+ def ==(o)
129
+ return true if self.equal?(o)
130
+ self.class == o.class &&
131
+ metric == o.metric &&
132
+ stats == o.stats
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Fixnum] Hash code
143
+ def hash
144
+ [metric, stats].hash
145
+ end
146
+
147
+ # build the object from hash
148
+ def build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ self.class.swagger_types.each_pair do |key, type|
151
+ if type =~ /^Array<(.*)>/i
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
154
+ else
155
+ #TODO show warning in debug mode
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ else
160
+ # data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :DateTime
170
+ DateTime.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :BOOLEAN
180
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ _model = Object.const_get("PureCloud").const_get(type).new
201
+ _model.build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_body (backward compatibility))
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # return the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ next if value.nil?
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Method to output non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map{ |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+ end