ultracart_api 3.11.51 → 3.11.54

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -4
  3. data/docs/ConversationApi.md +110 -0
  4. data/docs/ConversationPbxAgent.md +1 -0
  5. data/docs/ConversationPbxCall.md +29 -0
  6. data/docs/ConversationPbxCallAgent.md +16 -0
  7. data/docs/ConversationPbxCallAiCost.md +11 -0
  8. data/docs/ConversationPbxCallAiEngagement.md +17 -0
  9. data/docs/ConversationPbxCallAiToolCall.md +16 -0
  10. data/docs/ConversationPbxCallAiWhisper.md +11 -0
  11. data/docs/ConversationPbxCallCaller.md +12 -0
  12. data/docs/ConversationPbxCallFinancial.md +14 -0
  13. data/docs/ConversationPbxCallHold.md +11 -0
  14. data/docs/ConversationPbxCallQueue.md +13 -0
  15. data/docs/ConversationPbxCallRecording.md +14 -0
  16. data/docs/ConversationPbxCallResponse.md +12 -0
  17. data/docs/ConversationPbxCallRouting.md +10 -0
  18. data/docs/ConversationPbxCallSearchRequest.md +23 -0
  19. data/docs/ConversationPbxCallSearchResponse.md +12 -0
  20. data/docs/ConversationPbxCallTimeline.md +13 -0
  21. data/docs/ConversationPbxCallTranscript.md +14 -0
  22. data/docs/ConversationPbxCallTranscriptSegment.md +14 -0
  23. data/docs/ConversationPbxCallTransfer.md +12 -0
  24. data/docs/ConversationPbxPhoneNumber.md +1 -0
  25. data/lib/ultracart_api/api/conversation_api.rb +119 -0
  26. data/lib/ultracart_api/models/conversation_pbx_agent.rb +11 -1
  27. data/lib/ultracart_api/models/conversation_pbx_call.rb +403 -0
  28. data/lib/ultracart_api/models/conversation_pbx_call_agent.rb +265 -0
  29. data/lib/ultracart_api/models/conversation_pbx_call_ai_cost.rb +215 -0
  30. data/lib/ultracart_api/models/conversation_pbx_call_ai_engagement.rb +312 -0
  31. data/lib/ultracart_api/models/conversation_pbx_call_ai_tool_call.rb +265 -0
  32. data/lib/ultracart_api/models/conversation_pbx_call_ai_whisper.rb +215 -0
  33. data/lib/ultracart_api/models/conversation_pbx_call_caller.rb +225 -0
  34. data/lib/ultracart_api/models/conversation_pbx_call_financial.rb +245 -0
  35. data/lib/ultracart_api/models/conversation_pbx_call_hold.rb +215 -0
  36. data/lib/ultracart_api/models/conversation_pbx_call_queue.rb +235 -0
  37. data/lib/ultracart_api/models/conversation_pbx_call_recording.rb +244 -0
  38. data/lib/ultracart_api/models/conversation_pbx_call_response.rb +221 -0
  39. data/lib/ultracart_api/models/conversation_pbx_call_routing.rb +204 -0
  40. data/lib/ultracart_api/models/conversation_pbx_call_search_request.rb +341 -0
  41. data/lib/ultracart_api/models/conversation_pbx_call_search_response.rb +224 -0
  42. data/lib/ultracart_api/models/conversation_pbx_call_timeline.rb +235 -0
  43. data/lib/ultracart_api/models/conversation_pbx_call_transcript.rb +247 -0
  44. data/lib/ultracart_api/models/conversation_pbx_call_transcript_segment.rb +279 -0
  45. data/lib/ultracart_api/models/conversation_pbx_call_transfer.rb +225 -0
  46. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +11 -1
  47. data/lib/ultracart_api/version.rb +1 -1
  48. data/lib/ultracart_api.rb +19 -0
  49. metadata +40 -2
@@ -2793,6 +2793,61 @@ module UltracartClient
2793
2793
  end
2794
2794
  return data, status_code, headers
2795
2795
  end
2796
+ # Get pbx call record
2797
+ # Retrieve a single PBX call record with full details
2798
+ # @param call_uuid
2799
+ # @param [Hash] opts the optional parameters
2800
+ # @return [ConversationPbxCallResponse]
2801
+ def get_pbx_call(call_uuid, opts = {})
2802
+ data, _status_code, _headers = get_pbx_call_with_http_info(call_uuid, opts)
2803
+ data
2804
+ end
2805
+
2806
+ # Get pbx call record
2807
+ # Retrieve a single PBX call record with full details
2808
+ # @param call_uuid
2809
+ # @param [Hash] opts the optional parameters
2810
+ # @return [Array<(ConversationPbxCallResponse, Fixnum, Hash)>] ConversationPbxCallResponse data, response status code and response headers
2811
+ def get_pbx_call_with_http_info(call_uuid, opts = {})
2812
+ if @api_client.config.debugging
2813
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_pbx_call ...'
2814
+ end
2815
+ # verify the required parameter 'call_uuid' is set
2816
+ if @api_client.config.client_side_validation && call_uuid.nil?
2817
+ fail ArgumentError, "Missing the required parameter 'call_uuid' when calling ConversationApi.get_pbx_call"
2818
+ end
2819
+ # resource path
2820
+ local_var_path = '/conversation/pbx/call/{callUuid}'.sub('{' + 'callUuid' + '}', call_uuid.to_s)
2821
+
2822
+ # query parameters
2823
+ query_params = {}
2824
+
2825
+ # header parameters
2826
+ header_params = {}
2827
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
2828
+ # HTTP header 'Accept' (if needed)
2829
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2830
+ # HTTP header 'Content-Type'
2831
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2832
+
2833
+ # form parameters
2834
+ form_params = {}
2835
+
2836
+ # http body (model)
2837
+ post_body = nil
2838
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
2839
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
2840
+ :header_params => header_params,
2841
+ :query_params => query_params,
2842
+ :form_params => form_params,
2843
+ :body => post_body,
2844
+ :auth_names => auth_names,
2845
+ :return_type => 'ConversationPbxCallResponse')
2846
+ if @api_client.config.debugging
2847
+ @api_client.config.logger.debug "API called: ConversationApi#get_pbx_call\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2848
+ end
2849
+ return data, status_code, headers
2850
+ end
2796
2851
  # Get pbx hardware phone
2797
2852
  # Retrieve a pbx hardware phone
2798
2853
  # @param conversation_pbx_hardware_phone_uuid
@@ -5143,6 +5198,70 @@ module UltracartClient
5143
5198
  end
5144
5199
  return data, status_code, headers
5145
5200
  end
5201
+ # Search pbx call records
5202
+ # Search and list PBX call records with filtering, sorting, and pagination
5203
+ # @param search_request Search Request
5204
+ # @param [Hash] opts the optional parameters
5205
+ # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Maximum 200) (default to 100)
5206
+ # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index. (default to 0)
5207
+ # @option opts [String] :_sort The sort order of the calls.
5208
+ # @return [ConversationPbxCallSearchResponse]
5209
+ def search_pbx_calls(search_request, opts = {})
5210
+ data, _status_code, _headers = search_pbx_calls_with_http_info(search_request, opts)
5211
+ data
5212
+ end
5213
+
5214
+ # Search pbx call records
5215
+ # Search and list PBX call records with filtering, sorting, and pagination
5216
+ # @param search_request Search Request
5217
+ # @param [Hash] opts the optional parameters
5218
+ # @option opts [Integer] :_limit The maximum number of records to return on this one API call. (Maximum 200)
5219
+ # @option opts [Integer] :_offset Pagination of the record set. Offset is a zero based index.
5220
+ # @option opts [String] :_sort The sort order of the calls.
5221
+ # @return [Array<(ConversationPbxCallSearchResponse, Fixnum, Hash)>] ConversationPbxCallSearchResponse data, response status code and response headers
5222
+ def search_pbx_calls_with_http_info(search_request, opts = {})
5223
+ if @api_client.config.debugging
5224
+ @api_client.config.logger.debug 'Calling API: ConversationApi.search_pbx_calls ...'
5225
+ end
5226
+ # verify the required parameter 'search_request' is set
5227
+ if @api_client.config.client_side_validation && search_request.nil?
5228
+ fail ArgumentError, "Missing the required parameter 'search_request' when calling ConversationApi.search_pbx_calls"
5229
+ end
5230
+ # resource path
5231
+ local_var_path = '/conversation/pbx/call/search'
5232
+
5233
+ # query parameters
5234
+ query_params = {}
5235
+ query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?
5236
+ query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?
5237
+ query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?
5238
+
5239
+ # header parameters
5240
+ header_params = {}
5241
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
5242
+ # HTTP header 'Accept' (if needed)
5243
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5244
+ # HTTP header 'Content-Type'
5245
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5246
+
5247
+ # form parameters
5248
+ form_params = {}
5249
+
5250
+ # http body (model)
5251
+ post_body = @api_client.object_to_http_body(search_request)
5252
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
5253
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
5254
+ :header_params => header_params,
5255
+ :query_params => query_params,
5256
+ :form_params => form_params,
5257
+ :body => post_body,
5258
+ :auth_names => auth_names,
5259
+ :return_type => 'ConversationPbxCallSearchResponse')
5260
+ if @api_client.config.debugging
5261
+ @api_client.config.logger.debug "API called: ConversationApi#search_pbx_calls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5262
+ end
5263
+ return data, status_code, headers
5264
+ end
5146
5265
  # Unsubscribe any SMS participants in this conversation
5147
5266
  # Unsubscribe any SMS participants in this conversation
5148
5267
  # @param conversation_uuid
@@ -26,6 +26,9 @@ module UltracartClient
26
26
  # Conversation Pbx Agent unique identifier
27
27
  attr_accessor :conversation_pbx_agent_uuid
28
28
 
29
+ # The default phone number that this agent should dial out to the PSTN with.
30
+ attr_accessor :default_phone_number_uuid
31
+
29
32
  # Extension
30
33
  attr_accessor :extension
31
34
 
@@ -100,6 +103,7 @@ module UltracartClient
100
103
  :'call_routing_preference' => :'call_routing_preference',
101
104
  :'cellphone' => :'cellphone',
102
105
  :'conversation_pbx_agent_uuid' => :'conversation_pbx_agent_uuid',
106
+ :'default_phone_number_uuid' => :'default_phone_number_uuid',
103
107
  :'extension' => :'extension',
104
108
  :'full_name' => :'full_name',
105
109
  :'hardware_phone_uuids' => :'hardware_phone_uuids',
@@ -125,6 +129,7 @@ module UltracartClient
125
129
  :'call_routing_preference' => :'String',
126
130
  :'cellphone' => :'String',
127
131
  :'conversation_pbx_agent_uuid' => :'String',
132
+ :'default_phone_number_uuid' => :'String',
128
133
  :'extension' => :'Integer',
129
134
  :'full_name' => :'String',
130
135
  :'hardware_phone_uuids' => :'Array<String>',
@@ -167,6 +172,10 @@ module UltracartClient
167
172
  self.conversation_pbx_agent_uuid = attributes[:'conversation_pbx_agent_uuid']
168
173
  end
169
174
 
175
+ if attributes.has_key?(:'default_phone_number_uuid')
176
+ self.default_phone_number_uuid = attributes[:'default_phone_number_uuid']
177
+ end
178
+
170
179
  if attributes.has_key?(:'extension')
171
180
  self.extension = attributes[:'extension']
172
181
  end
@@ -369,6 +378,7 @@ module UltracartClient
369
378
  call_routing_preference == o.call_routing_preference &&
370
379
  cellphone == o.cellphone &&
371
380
  conversation_pbx_agent_uuid == o.conversation_pbx_agent_uuid &&
381
+ default_phone_number_uuid == o.default_phone_number_uuid &&
372
382
  extension == o.extension &&
373
383
  full_name == o.full_name &&
374
384
  hardware_phone_uuids == o.hardware_phone_uuids &&
@@ -395,7 +405,7 @@ module UltracartClient
395
405
  # Calculates hash code according to all attributes.
396
406
  # @return [Fixnum] Hash code
397
407
  def hash
398
- [ai, call_routing_preference, cellphone, conversation_pbx_agent_uuid, extension, full_name, hardware_phone_uuids, login, merchant_id, personal_conversation_pbx_voicemail_mailbox_uuid, preferred_hardware_phone_uuid, record_outgoing_automatically, shared_conversation_pbx_voicemail_mailbox_uuid, twilio_taskrouter_worker_id, unavailable_play_audio_uuid, unavailable_say, unavailable_say_voice, user_id, voicemail].hash
408
+ [ai, call_routing_preference, cellphone, conversation_pbx_agent_uuid, default_phone_number_uuid, extension, full_name, hardware_phone_uuids, login, merchant_id, personal_conversation_pbx_voicemail_mailbox_uuid, preferred_hardware_phone_uuid, record_outgoing_automatically, shared_conversation_pbx_voicemail_mailbox_uuid, twilio_taskrouter_worker_id, unavailable_play_audio_uuid, unavailable_say, unavailable_say_voice, user_id, voicemail].hash
399
409
  end
400
410
 
401
411
  # Builds the object from hash
@@ -0,0 +1,403 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationPbxCall
17
+ # Twilio account SID
18
+ attr_accessor :account_sid
19
+
20
+ # List of agents who participated in this call
21
+ attr_accessor :agents
22
+
23
+ # List of AI agent engagements during the call
24
+ attr_accessor :ai_agent_engagements
25
+
26
+ # Twilio call SID for the primary (customer) call leg
27
+ attr_accessor :call_sid
28
+
29
+ # Unique identifier for this call record
30
+ attr_accessor :call_uuid
31
+
32
+ attr_accessor :caller
33
+
34
+ # Twilio conference SID if this call used conferencing
35
+ attr_accessor :conference_sid
36
+
37
+ # Timestamp when the call record was created
38
+ attr_accessor :created_at_dts
39
+
40
+ # Customer name associated with this call
41
+ attr_accessor :customer_name
42
+
43
+ # UltraCart customer profile OID if the caller was matched to a customer
44
+ attr_accessor :customer_profile_oid
45
+
46
+ # Call disposition describing how the call ended
47
+ attr_accessor :disposition
48
+
49
+ # Email address of the caller if known
50
+ attr_accessor :email
51
+
52
+ attr_accessor :financial
53
+
54
+ # List of hold events during the call
55
+ attr_accessor :holds
56
+
57
+ # Merchant identifier
58
+ attr_accessor :merchant_id
59
+
60
+ # List of all Twilio recording SIDs associated with this call
61
+ attr_accessor :recording_sids
62
+
63
+ # List of recordings made during the call
64
+ attr_accessor :recordings
65
+
66
+ attr_accessor :routing
67
+
68
+ # Final status of the call
69
+ attr_accessor :status
70
+
71
+ attr_accessor :timeline
72
+
73
+ # List of transfer events during the call
74
+ attr_accessor :transfers
75
+
76
+ # Timestamp when the call record was last updated
77
+ attr_accessor :updated_at_dts
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'account_sid' => :'account_sid',
83
+ :'agents' => :'agents',
84
+ :'ai_agent_engagements' => :'ai_agent_engagements',
85
+ :'call_sid' => :'call_sid',
86
+ :'call_uuid' => :'call_uuid',
87
+ :'caller' => :'caller',
88
+ :'conference_sid' => :'conference_sid',
89
+ :'created_at_dts' => :'created_at_dts',
90
+ :'customer_name' => :'customer_name',
91
+ :'customer_profile_oid' => :'customer_profile_oid',
92
+ :'disposition' => :'disposition',
93
+ :'email' => :'email',
94
+ :'financial' => :'financial',
95
+ :'holds' => :'holds',
96
+ :'merchant_id' => :'merchant_id',
97
+ :'recording_sids' => :'recording_sids',
98
+ :'recordings' => :'recordings',
99
+ :'routing' => :'routing',
100
+ :'status' => :'status',
101
+ :'timeline' => :'timeline',
102
+ :'transfers' => :'transfers',
103
+ :'updated_at_dts' => :'updated_at_dts'
104
+ }
105
+ end
106
+
107
+ # Attribute type mapping.
108
+ def self.swagger_types
109
+ {
110
+ :'account_sid' => :'String',
111
+ :'agents' => :'Array<ConversationPbxCallAgent>',
112
+ :'ai_agent_engagements' => :'Array<ConversationPbxCallAiEngagement>',
113
+ :'call_sid' => :'String',
114
+ :'call_uuid' => :'String',
115
+ :'caller' => :'ConversationPbxCallCaller',
116
+ :'conference_sid' => :'String',
117
+ :'created_at_dts' => :'String',
118
+ :'customer_name' => :'String',
119
+ :'customer_profile_oid' => :'String',
120
+ :'disposition' => :'String',
121
+ :'email' => :'String',
122
+ :'financial' => :'ConversationPbxCallFinancial',
123
+ :'holds' => :'Array<ConversationPbxCallHold>',
124
+ :'merchant_id' => :'String',
125
+ :'recording_sids' => :'Array<String>',
126
+ :'recordings' => :'Array<ConversationPbxCallRecording>',
127
+ :'routing' => :'ConversationPbxCallRouting',
128
+ :'status' => :'String',
129
+ :'timeline' => :'ConversationPbxCallTimeline',
130
+ :'transfers' => :'Array<ConversationPbxCallTransfer>',
131
+ :'updated_at_dts' => :'String'
132
+ }
133
+ end
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ return unless attributes.is_a?(Hash)
139
+
140
+ # convert string to symbol for hash key
141
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
142
+
143
+ if attributes.has_key?(:'account_sid')
144
+ self.account_sid = attributes[:'account_sid']
145
+ end
146
+
147
+ if attributes.has_key?(:'agents')
148
+ if (value = attributes[:'agents']).is_a?(Array)
149
+ self.agents = value
150
+ end
151
+ end
152
+
153
+ if attributes.has_key?(:'ai_agent_engagements')
154
+ if (value = attributes[:'ai_agent_engagements']).is_a?(Array)
155
+ self.ai_agent_engagements = value
156
+ end
157
+ end
158
+
159
+ if attributes.has_key?(:'call_sid')
160
+ self.call_sid = attributes[:'call_sid']
161
+ end
162
+
163
+ if attributes.has_key?(:'call_uuid')
164
+ self.call_uuid = attributes[:'call_uuid']
165
+ end
166
+
167
+ if attributes.has_key?(:'caller')
168
+ self.caller = attributes[:'caller']
169
+ end
170
+
171
+ if attributes.has_key?(:'conference_sid')
172
+ self.conference_sid = attributes[:'conference_sid']
173
+ end
174
+
175
+ if attributes.has_key?(:'created_at_dts')
176
+ self.created_at_dts = attributes[:'created_at_dts']
177
+ end
178
+
179
+ if attributes.has_key?(:'customer_name')
180
+ self.customer_name = attributes[:'customer_name']
181
+ end
182
+
183
+ if attributes.has_key?(:'customer_profile_oid')
184
+ self.customer_profile_oid = attributes[:'customer_profile_oid']
185
+ end
186
+
187
+ if attributes.has_key?(:'disposition')
188
+ self.disposition = attributes[:'disposition']
189
+ end
190
+
191
+ if attributes.has_key?(:'email')
192
+ self.email = attributes[:'email']
193
+ end
194
+
195
+ if attributes.has_key?(:'financial')
196
+ self.financial = attributes[:'financial']
197
+ end
198
+
199
+ if attributes.has_key?(:'holds')
200
+ if (value = attributes[:'holds']).is_a?(Array)
201
+ self.holds = value
202
+ end
203
+ end
204
+
205
+ if attributes.has_key?(:'merchant_id')
206
+ self.merchant_id = attributes[:'merchant_id']
207
+ end
208
+
209
+ if attributes.has_key?(:'recording_sids')
210
+ if (value = attributes[:'recording_sids']).is_a?(Array)
211
+ self.recording_sids = value
212
+ end
213
+ end
214
+
215
+ if attributes.has_key?(:'recordings')
216
+ if (value = attributes[:'recordings']).is_a?(Array)
217
+ self.recordings = value
218
+ end
219
+ end
220
+
221
+ if attributes.has_key?(:'routing')
222
+ self.routing = attributes[:'routing']
223
+ end
224
+
225
+ if attributes.has_key?(:'status')
226
+ self.status = attributes[:'status']
227
+ end
228
+
229
+ if attributes.has_key?(:'timeline')
230
+ self.timeline = attributes[:'timeline']
231
+ end
232
+
233
+ if attributes.has_key?(:'transfers')
234
+ if (value = attributes[:'transfers']).is_a?(Array)
235
+ self.transfers = value
236
+ end
237
+ end
238
+
239
+ if attributes.has_key?(:'updated_at_dts')
240
+ self.updated_at_dts = attributes[:'updated_at_dts']
241
+ end
242
+ end
243
+
244
+ # Show invalid properties with the reasons. Usually used together with valid?
245
+ # @return Array for valid properties with the reasons
246
+ def list_invalid_properties
247
+ invalid_properties = Array.new
248
+ invalid_properties
249
+ end
250
+
251
+ # Check to see if the all the properties in the model are valid
252
+ # @return true if the model is valid
253
+ def valid?
254
+ true
255
+ end
256
+
257
+ # Checks equality by comparing each attribute.
258
+ # @param [Object] Object to be compared
259
+ def ==(o)
260
+ return true if self.equal?(o)
261
+ self.class == o.class &&
262
+ account_sid == o.account_sid &&
263
+ agents == o.agents &&
264
+ ai_agent_engagements == o.ai_agent_engagements &&
265
+ call_sid == o.call_sid &&
266
+ call_uuid == o.call_uuid &&
267
+ caller == o.caller &&
268
+ conference_sid == o.conference_sid &&
269
+ created_at_dts == o.created_at_dts &&
270
+ customer_name == o.customer_name &&
271
+ customer_profile_oid == o.customer_profile_oid &&
272
+ disposition == o.disposition &&
273
+ email == o.email &&
274
+ financial == o.financial &&
275
+ holds == o.holds &&
276
+ merchant_id == o.merchant_id &&
277
+ recording_sids == o.recording_sids &&
278
+ recordings == o.recordings &&
279
+ routing == o.routing &&
280
+ status == o.status &&
281
+ timeline == o.timeline &&
282
+ transfers == o.transfers &&
283
+ updated_at_dts == o.updated_at_dts
284
+ end
285
+
286
+ # @see the `==` method
287
+ # @param [Object] Object to be compared
288
+ def eql?(o)
289
+ self == o
290
+ end
291
+
292
+ # Calculates hash code according to all attributes.
293
+ # @return [Fixnum] Hash code
294
+ def hash
295
+ [account_sid, agents, ai_agent_engagements, call_sid, call_uuid, caller, conference_sid, created_at_dts, customer_name, customer_profile_oid, disposition, email, financial, holds, merchant_id, recording_sids, recordings, routing, status, timeline, transfers, updated_at_dts].hash
296
+ end
297
+
298
+ # Builds the object from hash
299
+ # @param [Hash] attributes Model attributes in the form of hash
300
+ # @return [Object] Returns the model itself
301
+ def build_from_hash(attributes)
302
+ return nil unless attributes.is_a?(Hash)
303
+ self.class.swagger_types.each_pair do |key, type|
304
+ if type =~ /\AArray<(.*)>/i
305
+ # check to ensure the input is an array given that the attribute
306
+ # is documented as an array but the input is not
307
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
308
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
309
+ end
310
+ elsif !attributes[self.class.attribute_map[key]].nil?
311
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
312
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
313
+ end
314
+
315
+ self
316
+ end
317
+
318
+ # Deserializes the data based on type
319
+ # @param string type Data type
320
+ # @param string value Value to be deserialized
321
+ # @return [Object] Deserialized data
322
+ def _deserialize(type, value)
323
+ case type.to_sym
324
+ when :DateTime
325
+ DateTime.parse(value)
326
+ when :Date
327
+ Date.parse(value)
328
+ when :String
329
+ value.to_s
330
+ when :Integer
331
+ value.to_i
332
+ when :Float
333
+ value.to_f
334
+ when :BOOLEAN
335
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
336
+ true
337
+ else
338
+ false
339
+ end
340
+ when :Object
341
+ # generic object (usually a Hash), return directly
342
+ value
343
+ when /\AArray<(?<inner_type>.+)>\z/
344
+ inner_type = Regexp.last_match[:inner_type]
345
+ value.map { |v| _deserialize(inner_type, v) }
346
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
347
+ k_type = Regexp.last_match[:k_type]
348
+ v_type = Regexp.last_match[:v_type]
349
+ {}.tap do |hash|
350
+ value.each do |k, v|
351
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
352
+ end
353
+ end
354
+ else # model
355
+ temp_model = UltracartClient.const_get(type).new
356
+ temp_model.build_from_hash(value)
357
+ end
358
+ end
359
+
360
+ # Returns the string representation of the object
361
+ # @return [String] String presentation of the object
362
+ def to_s
363
+ to_hash.to_s
364
+ end
365
+
366
+ # to_body is an alias to to_hash (backward compatibility)
367
+ # @return [Hash] Returns the object in the form of hash
368
+ def to_body
369
+ to_hash
370
+ end
371
+
372
+ # Returns the object in the form of hash
373
+ # @return [Hash] Returns the object in the form of hash
374
+ def to_hash
375
+ hash = {}
376
+ self.class.attribute_map.each_pair do |attr, param|
377
+ value = self.send(attr)
378
+ next if value.nil?
379
+ hash[param] = _to_hash(value)
380
+ end
381
+ hash
382
+ end
383
+
384
+ # Outputs non-array value in the form of hash
385
+ # For object, use to_hash. Otherwise, just return the value
386
+ # @param [Object] value Any valid value
387
+ # @return [Hash] Returns the value in the form of hash
388
+ def _to_hash(value)
389
+ if value.is_a?(Array)
390
+ value.compact.map { |v| _to_hash(v) }
391
+ elsif value.is_a?(Hash)
392
+ {}.tap do |hash|
393
+ value.each { |k, v| hash[k] = _to_hash(v) }
394
+ end
395
+ elsif value.respond_to? :to_hash
396
+ value.to_hash
397
+ else
398
+ value
399
+ end
400
+ end
401
+
402
+ end
403
+ end