ultracart_api 4.1.51 → 4.1.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 +26 -2
  3. data/docs/ConversationApi.md +111 -0
  4. data/docs/ConversationPbxAgent.md +2 -0
  5. data/docs/ConversationPbxCall.md +60 -0
  6. data/docs/ConversationPbxCallAgent.md +34 -0
  7. data/docs/ConversationPbxCallAiCost.md +24 -0
  8. data/docs/ConversationPbxCallAiEngagement.md +36 -0
  9. data/docs/ConversationPbxCallAiToolCall.md +34 -0
  10. data/docs/ConversationPbxCallAiWhisper.md +24 -0
  11. data/docs/ConversationPbxCallCaller.md +26 -0
  12. data/docs/ConversationPbxCallFinancial.md +30 -0
  13. data/docs/ConversationPbxCallHold.md +24 -0
  14. data/docs/ConversationPbxCallQueue.md +28 -0
  15. data/docs/ConversationPbxCallRecording.md +30 -0
  16. data/docs/ConversationPbxCallResponse.md +26 -0
  17. data/docs/ConversationPbxCallRouting.md +22 -0
  18. data/docs/ConversationPbxCallSearchRequest.md +48 -0
  19. data/docs/ConversationPbxCallSearchResponse.md +26 -0
  20. data/docs/ConversationPbxCallTimeline.md +28 -0
  21. data/docs/ConversationPbxCallTranscript.md +30 -0
  22. data/docs/ConversationPbxCallTranscriptSegment.md +30 -0
  23. data/docs/ConversationPbxCallTransfer.md +26 -0
  24. data/docs/ConversationPbxPhoneNumber.md +2 -0
  25. data/lib/ultracart_api/api/conversation_api.rb +142 -0
  26. data/lib/ultracart_api/models/conversation_pbx_agent.rb +11 -1
  27. data/lib/ultracart_api/models/conversation_pbx_call.rb +438 -0
  28. data/lib/ultracart_api/models/conversation_pbx_call_agent.rb +300 -0
  29. data/lib/ultracart_api/models/conversation_pbx_call_ai_cost.rb +250 -0
  30. data/lib/ultracart_api/models/conversation_pbx_call_ai_engagement.rb +347 -0
  31. data/lib/ultracart_api/models/conversation_pbx_call_ai_tool_call.rb +300 -0
  32. data/lib/ultracart_api/models/conversation_pbx_call_ai_whisper.rb +250 -0
  33. data/lib/ultracart_api/models/conversation_pbx_call_caller.rb +260 -0
  34. data/lib/ultracart_api/models/conversation_pbx_call_financial.rb +280 -0
  35. data/lib/ultracart_api/models/conversation_pbx_call_hold.rb +250 -0
  36. data/lib/ultracart_api/models/conversation_pbx_call_queue.rb +270 -0
  37. data/lib/ultracart_api/models/conversation_pbx_call_recording.rb +279 -0
  38. data/lib/ultracart_api/models/conversation_pbx_call_response.rb +256 -0
  39. data/lib/ultracart_api/models/conversation_pbx_call_routing.rb +239 -0
  40. data/lib/ultracart_api/models/conversation_pbx_call_search_request.rb +376 -0
  41. data/lib/ultracart_api/models/conversation_pbx_call_search_response.rb +259 -0
  42. data/lib/ultracart_api/models/conversation_pbx_call_timeline.rb +270 -0
  43. data/lib/ultracart_api/models/conversation_pbx_call_transcript.rb +282 -0
  44. data/lib/ultracart_api/models/conversation_pbx_call_transcript_segment.rb +314 -0
  45. data/lib/ultracart_api/models/conversation_pbx_call_transfer.rb +260 -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
@@ -0,0 +1,438 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationPbxCall
18
+ # Twilio account SID
19
+ attr_accessor :account_sid
20
+
21
+ # List of agents who participated in this call
22
+ attr_accessor :agents
23
+
24
+ # List of AI agent engagements during the call
25
+ attr_accessor :ai_agent_engagements
26
+
27
+ # Twilio call SID for the primary (customer) call leg
28
+ attr_accessor :call_sid
29
+
30
+ # Unique identifier for this call record
31
+ attr_accessor :call_uuid
32
+
33
+ attr_accessor :caller
34
+
35
+ # Twilio conference SID if this call used conferencing
36
+ attr_accessor :conference_sid
37
+
38
+ # Timestamp when the call record was created
39
+ attr_accessor :created_at_dts
40
+
41
+ # Customer name associated with this call
42
+ attr_accessor :customer_name
43
+
44
+ # UltraCart customer profile OID if the caller was matched to a customer
45
+ attr_accessor :customer_profile_oid
46
+
47
+ # Call disposition describing how the call ended
48
+ attr_accessor :disposition
49
+
50
+ # Email address of the caller if known
51
+ attr_accessor :email
52
+
53
+ attr_accessor :financial
54
+
55
+ # List of hold events during the call
56
+ attr_accessor :holds
57
+
58
+ # Merchant identifier
59
+ attr_accessor :merchant_id
60
+
61
+ # List of all Twilio recording SIDs associated with this call
62
+ attr_accessor :recording_sids
63
+
64
+ # List of recordings made during the call
65
+ attr_accessor :recordings
66
+
67
+ attr_accessor :routing
68
+
69
+ # Final status of the call
70
+ attr_accessor :status
71
+
72
+ attr_accessor :timeline
73
+
74
+ # List of transfer events during the call
75
+ attr_accessor :transfers
76
+
77
+ # Timestamp when the call record was last updated
78
+ attr_accessor :updated_at_dts
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'account_sid' => :'account_sid',
84
+ :'agents' => :'agents',
85
+ :'ai_agent_engagements' => :'ai_agent_engagements',
86
+ :'call_sid' => :'call_sid',
87
+ :'call_uuid' => :'call_uuid',
88
+ :'caller' => :'caller',
89
+ :'conference_sid' => :'conference_sid',
90
+ :'created_at_dts' => :'created_at_dts',
91
+ :'customer_name' => :'customer_name',
92
+ :'customer_profile_oid' => :'customer_profile_oid',
93
+ :'disposition' => :'disposition',
94
+ :'email' => :'email',
95
+ :'financial' => :'financial',
96
+ :'holds' => :'holds',
97
+ :'merchant_id' => :'merchant_id',
98
+ :'recording_sids' => :'recording_sids',
99
+ :'recordings' => :'recordings',
100
+ :'routing' => :'routing',
101
+ :'status' => :'status',
102
+ :'timeline' => :'timeline',
103
+ :'transfers' => :'transfers',
104
+ :'updated_at_dts' => :'updated_at_dts'
105
+ }
106
+ end
107
+
108
+ # Returns all the JSON keys this model knows about
109
+ def self.acceptable_attributes
110
+ attribute_map.values
111
+ end
112
+
113
+ # Attribute type mapping.
114
+ def self.openapi_types
115
+ {
116
+ :'account_sid' => :'String',
117
+ :'agents' => :'Array<ConversationPbxCallAgent>',
118
+ :'ai_agent_engagements' => :'Array<ConversationPbxCallAiEngagement>',
119
+ :'call_sid' => :'String',
120
+ :'call_uuid' => :'String',
121
+ :'caller' => :'ConversationPbxCallCaller',
122
+ :'conference_sid' => :'String',
123
+ :'created_at_dts' => :'String',
124
+ :'customer_name' => :'String',
125
+ :'customer_profile_oid' => :'String',
126
+ :'disposition' => :'String',
127
+ :'email' => :'String',
128
+ :'financial' => :'ConversationPbxCallFinancial',
129
+ :'holds' => :'Array<ConversationPbxCallHold>',
130
+ :'merchant_id' => :'String',
131
+ :'recording_sids' => :'Array<String>',
132
+ :'recordings' => :'Array<ConversationPbxCallRecording>',
133
+ :'routing' => :'ConversationPbxCallRouting',
134
+ :'status' => :'String',
135
+ :'timeline' => :'ConversationPbxCallTimeline',
136
+ :'transfers' => :'Array<ConversationPbxCallTransfer>',
137
+ :'updated_at_dts' => :'String'
138
+ }
139
+ end
140
+
141
+ # List of attributes with nullable: true
142
+ def self.openapi_nullable
143
+ Set.new([
144
+ ])
145
+ end
146
+
147
+ # Initializes the object
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ def initialize(attributes = {})
150
+ if (!attributes.is_a?(Hash))
151
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCall` initialize method"
152
+ end
153
+
154
+ # check to see if the attribute exists and convert string to symbol for hash key
155
+ attributes = attributes.each_with_object({}) { |(k, v), h|
156
+ if (!self.class.attribute_map.key?(k.to_sym))
157
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCall`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
158
+ end
159
+ h[k.to_sym] = v
160
+ }
161
+
162
+ if attributes.key?(:'account_sid')
163
+ self.account_sid = attributes[:'account_sid']
164
+ end
165
+
166
+ if attributes.key?(:'agents')
167
+ if (value = attributes[:'agents']).is_a?(Array)
168
+ self.agents = value
169
+ end
170
+ end
171
+
172
+ if attributes.key?(:'ai_agent_engagements')
173
+ if (value = attributes[:'ai_agent_engagements']).is_a?(Array)
174
+ self.ai_agent_engagements = value
175
+ end
176
+ end
177
+
178
+ if attributes.key?(:'call_sid')
179
+ self.call_sid = attributes[:'call_sid']
180
+ end
181
+
182
+ if attributes.key?(:'call_uuid')
183
+ self.call_uuid = attributes[:'call_uuid']
184
+ end
185
+
186
+ if attributes.key?(:'caller')
187
+ self.caller = attributes[:'caller']
188
+ end
189
+
190
+ if attributes.key?(:'conference_sid')
191
+ self.conference_sid = attributes[:'conference_sid']
192
+ end
193
+
194
+ if attributes.key?(:'created_at_dts')
195
+ self.created_at_dts = attributes[:'created_at_dts']
196
+ end
197
+
198
+ if attributes.key?(:'customer_name')
199
+ self.customer_name = attributes[:'customer_name']
200
+ end
201
+
202
+ if attributes.key?(:'customer_profile_oid')
203
+ self.customer_profile_oid = attributes[:'customer_profile_oid']
204
+ end
205
+
206
+ if attributes.key?(:'disposition')
207
+ self.disposition = attributes[:'disposition']
208
+ end
209
+
210
+ if attributes.key?(:'email')
211
+ self.email = attributes[:'email']
212
+ end
213
+
214
+ if attributes.key?(:'financial')
215
+ self.financial = attributes[:'financial']
216
+ end
217
+
218
+ if attributes.key?(:'holds')
219
+ if (value = attributes[:'holds']).is_a?(Array)
220
+ self.holds = value
221
+ end
222
+ end
223
+
224
+ if attributes.key?(:'merchant_id')
225
+ self.merchant_id = attributes[:'merchant_id']
226
+ end
227
+
228
+ if attributes.key?(:'recording_sids')
229
+ if (value = attributes[:'recording_sids']).is_a?(Array)
230
+ self.recording_sids = value
231
+ end
232
+ end
233
+
234
+ if attributes.key?(:'recordings')
235
+ if (value = attributes[:'recordings']).is_a?(Array)
236
+ self.recordings = value
237
+ end
238
+ end
239
+
240
+ if attributes.key?(:'routing')
241
+ self.routing = attributes[:'routing']
242
+ end
243
+
244
+ if attributes.key?(:'status')
245
+ self.status = attributes[:'status']
246
+ end
247
+
248
+ if attributes.key?(:'timeline')
249
+ self.timeline = attributes[:'timeline']
250
+ end
251
+
252
+ if attributes.key?(:'transfers')
253
+ if (value = attributes[:'transfers']).is_a?(Array)
254
+ self.transfers = value
255
+ end
256
+ end
257
+
258
+ if attributes.key?(:'updated_at_dts')
259
+ self.updated_at_dts = attributes[:'updated_at_dts']
260
+ end
261
+ end
262
+
263
+ # Show invalid properties with the reasons. Usually used together with valid?
264
+ # @return Array for valid properties with the reasons
265
+ def list_invalid_properties
266
+ invalid_properties = Array.new
267
+ invalid_properties
268
+ end
269
+
270
+ # Check to see if the all the properties in the model are valid
271
+ # @return true if the model is valid
272
+ def valid?
273
+ true
274
+ end
275
+
276
+ # Checks equality by comparing each attribute.
277
+ # @param [Object] Object to be compared
278
+ def ==(o)
279
+ return true if self.equal?(o)
280
+ self.class == o.class &&
281
+ account_sid == o.account_sid &&
282
+ agents == o.agents &&
283
+ ai_agent_engagements == o.ai_agent_engagements &&
284
+ call_sid == o.call_sid &&
285
+ call_uuid == o.call_uuid &&
286
+ caller == o.caller &&
287
+ conference_sid == o.conference_sid &&
288
+ created_at_dts == o.created_at_dts &&
289
+ customer_name == o.customer_name &&
290
+ customer_profile_oid == o.customer_profile_oid &&
291
+ disposition == o.disposition &&
292
+ email == o.email &&
293
+ financial == o.financial &&
294
+ holds == o.holds &&
295
+ merchant_id == o.merchant_id &&
296
+ recording_sids == o.recording_sids &&
297
+ recordings == o.recordings &&
298
+ routing == o.routing &&
299
+ status == o.status &&
300
+ timeline == o.timeline &&
301
+ transfers == o.transfers &&
302
+ updated_at_dts == o.updated_at_dts
303
+ end
304
+
305
+ # @see the `==` method
306
+ # @param [Object] Object to be compared
307
+ def eql?(o)
308
+ self == o
309
+ end
310
+
311
+ # Calculates hash code according to all attributes.
312
+ # @return [Integer] Hash code
313
+ def hash
314
+ [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
315
+ end
316
+
317
+ # Builds the object from hash
318
+ # @param [Hash] attributes Model attributes in the form of hash
319
+ # @return [Object] Returns the model itself
320
+ def self.build_from_hash(attributes)
321
+ new.build_from_hash(attributes)
322
+ end
323
+
324
+ # Builds the object from hash
325
+ # @param [Hash] attributes Model attributes in the form of hash
326
+ # @return [Object] Returns the model itself
327
+ def build_from_hash(attributes)
328
+ return nil unless attributes.is_a?(Hash)
329
+ attributes = attributes.transform_keys(&:to_sym)
330
+ self.class.openapi_types.each_pair do |key, type|
331
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
332
+ self.send("#{key}=", nil)
333
+ elsif type =~ /\AArray<(.*)>/i
334
+ # check to ensure the input is an array given that the attribute
335
+ # is documented as an array but the input is not
336
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
337
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
338
+ end
339
+ elsif !attributes[self.class.attribute_map[key]].nil?
340
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
341
+ end
342
+ end
343
+
344
+ self
345
+ end
346
+
347
+ # Deserializes the data based on type
348
+ # @param string type Data type
349
+ # @param string value Value to be deserialized
350
+ # @return [Object] Deserialized data
351
+ def _deserialize(type, value)
352
+ case type.to_sym
353
+ when :Time
354
+ Time.parse(value)
355
+ when :Date
356
+ Date.parse(value)
357
+ when :String
358
+ value.to_s
359
+ when :Integer
360
+ value.to_i
361
+ when :Float
362
+ value.to_f
363
+ when :Boolean
364
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
365
+ true
366
+ else
367
+ false
368
+ end
369
+ when :Object
370
+ # generic object (usually a Hash), return directly
371
+ value
372
+ when /\AArray<(?<inner_type>.+)>\z/
373
+ inner_type = Regexp.last_match[:inner_type]
374
+ value.map { |v| _deserialize(inner_type, v) }
375
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
376
+ k_type = Regexp.last_match[:k_type]
377
+ v_type = Regexp.last_match[:v_type]
378
+ {}.tap do |hash|
379
+ value.each do |k, v|
380
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
381
+ end
382
+ end
383
+ else # model
384
+ # models (e.g. Pet) or oneOf
385
+ klass = UltracartClient.const_get(type)
386
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
387
+ end
388
+ end
389
+
390
+ # Returns the string representation of the object
391
+ # @return [String] String presentation of the object
392
+ def to_s
393
+ to_hash.to_s
394
+ end
395
+
396
+ # to_body is an alias to to_hash (backward compatibility)
397
+ # @return [Hash] Returns the object in the form of hash
398
+ def to_body
399
+ to_hash
400
+ end
401
+
402
+ # Returns the object in the form of hash
403
+ # @return [Hash] Returns the object in the form of hash
404
+ def to_hash
405
+ hash = {}
406
+ self.class.attribute_map.each_pair do |attr, param|
407
+ value = self.send(attr)
408
+ if value.nil?
409
+ is_nullable = self.class.openapi_nullable.include?(attr)
410
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
411
+ end
412
+
413
+ hash[param] = _to_hash(value)
414
+ end
415
+ hash
416
+ end
417
+
418
+ # Outputs non-array value in the form of hash
419
+ # For object, use to_hash. Otherwise, just return the value
420
+ # @param [Object] value Any valid value
421
+ # @return [Hash] Returns the value in the form of hash
422
+ def _to_hash(value)
423
+ if value.is_a?(Array)
424
+ value.compact.map { |v| _to_hash(v) }
425
+ elsif value.is_a?(Hash)
426
+ {}.tap do |hash|
427
+ value.each { |k, v| hash[k] = _to_hash(v) }
428
+ end
429
+ elsif value.respond_to? :to_hash
430
+ value.to_hash
431
+ else
432
+ value
433
+ end
434
+ end
435
+
436
+ end
437
+
438
+ end