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,300 @@
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 ConversationPbxCallAgent
18
+ # Agent's phone extension
19
+ attr_accessor :agent_extension
20
+
21
+ # Unique identifier for the agent
22
+ attr_accessor :agent_id
23
+
24
+ # Display name of the agent
25
+ attr_accessor :agent_name
26
+
27
+ # Whether the agent answered the call
28
+ attr_accessor :answered
29
+
30
+ # Twilio call SID for the agent's call leg
31
+ attr_accessor :call_sid
32
+
33
+ # Timestamp when the agent joined the call
34
+ attr_accessor :joined_at_dts
35
+
36
+ # Timestamp when the agent left the call
37
+ attr_accessor :left_at_dts
38
+
39
+ # Role of the agent in the call
40
+ attr_accessor :role
41
+
42
+ # Twilio TaskRouter worker SID
43
+ attr_accessor :worker_sid
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'agent_extension' => :'agent_extension',
49
+ :'agent_id' => :'agent_id',
50
+ :'agent_name' => :'agent_name',
51
+ :'answered' => :'answered',
52
+ :'call_sid' => :'call_sid',
53
+ :'joined_at_dts' => :'joined_at_dts',
54
+ :'left_at_dts' => :'left_at_dts',
55
+ :'role' => :'role',
56
+ :'worker_sid' => :'worker_sid'
57
+ }
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'agent_extension' => :'String',
69
+ :'agent_id' => :'String',
70
+ :'agent_name' => :'String',
71
+ :'answered' => :'Boolean',
72
+ :'call_sid' => :'String',
73
+ :'joined_at_dts' => :'String',
74
+ :'left_at_dts' => :'String',
75
+ :'role' => :'String',
76
+ :'worker_sid' => :'String'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCallAgent` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!self.class.attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCallAgent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'agent_extension')
102
+ self.agent_extension = attributes[:'agent_extension']
103
+ end
104
+
105
+ if attributes.key?(:'agent_id')
106
+ self.agent_id = attributes[:'agent_id']
107
+ end
108
+
109
+ if attributes.key?(:'agent_name')
110
+ self.agent_name = attributes[:'agent_name']
111
+ end
112
+
113
+ if attributes.key?(:'answered')
114
+ self.answered = attributes[:'answered']
115
+ end
116
+
117
+ if attributes.key?(:'call_sid')
118
+ self.call_sid = attributes[:'call_sid']
119
+ end
120
+
121
+ if attributes.key?(:'joined_at_dts')
122
+ self.joined_at_dts = attributes[:'joined_at_dts']
123
+ end
124
+
125
+ if attributes.key?(:'left_at_dts')
126
+ self.left_at_dts = attributes[:'left_at_dts']
127
+ end
128
+
129
+ if attributes.key?(:'role')
130
+ self.role = attributes[:'role']
131
+ end
132
+
133
+ if attributes.key?(:'worker_sid')
134
+ self.worker_sid = attributes[:'worker_sid']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ invalid_properties = Array.new
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ true
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ agent_extension == o.agent_extension &&
157
+ agent_id == o.agent_id &&
158
+ agent_name == o.agent_name &&
159
+ answered == o.answered &&
160
+ call_sid == o.call_sid &&
161
+ joined_at_dts == o.joined_at_dts &&
162
+ left_at_dts == o.left_at_dts &&
163
+ role == o.role &&
164
+ worker_sid == o.worker_sid
165
+ end
166
+
167
+ # @see the `==` method
168
+ # @param [Object] Object to be compared
169
+ def eql?(o)
170
+ self == o
171
+ end
172
+
173
+ # Calculates hash code according to all attributes.
174
+ # @return [Integer] Hash code
175
+ def hash
176
+ [agent_extension, agent_id, agent_name, answered, call_sid, joined_at_dts, left_at_dts, role, worker_sid].hash
177
+ end
178
+
179
+ # Builds the object from hash
180
+ # @param [Hash] attributes Model attributes in the form of hash
181
+ # @return [Object] Returns the model itself
182
+ def self.build_from_hash(attributes)
183
+ new.build_from_hash(attributes)
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ attributes = attributes.transform_keys(&:to_sym)
192
+ self.class.openapi_types.each_pair do |key, type|
193
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
194
+ self.send("#{key}=", nil)
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
199
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
200
+ end
201
+ elsif !attributes[self.class.attribute_map[key]].nil?
202
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
203
+ end
204
+ end
205
+
206
+ self
207
+ end
208
+
209
+ # Deserializes the data based on type
210
+ # @param string type Data type
211
+ # @param string value Value to be deserialized
212
+ # @return [Object] Deserialized data
213
+ def _deserialize(type, value)
214
+ case type.to_sym
215
+ when :Time
216
+ Time.parse(value)
217
+ when :Date
218
+ Date.parse(value)
219
+ when :String
220
+ value.to_s
221
+ when :Integer
222
+ value.to_i
223
+ when :Float
224
+ value.to_f
225
+ when :Boolean
226
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
227
+ true
228
+ else
229
+ false
230
+ end
231
+ when :Object
232
+ # generic object (usually a Hash), return directly
233
+ value
234
+ when /\AArray<(?<inner_type>.+)>\z/
235
+ inner_type = Regexp.last_match[:inner_type]
236
+ value.map { |v| _deserialize(inner_type, v) }
237
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
238
+ k_type = Regexp.last_match[:k_type]
239
+ v_type = Regexp.last_match[:v_type]
240
+ {}.tap do |hash|
241
+ value.each do |k, v|
242
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
243
+ end
244
+ end
245
+ else # model
246
+ # models (e.g. Pet) or oneOf
247
+ klass = UltracartClient.const_get(type)
248
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
249
+ end
250
+ end
251
+
252
+ # Returns the string representation of the object
253
+ # @return [String] String presentation of the object
254
+ def to_s
255
+ to_hash.to_s
256
+ end
257
+
258
+ # to_body is an alias to to_hash (backward compatibility)
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_body
261
+ to_hash
262
+ end
263
+
264
+ # Returns the object in the form of hash
265
+ # @return [Hash] Returns the object in the form of hash
266
+ def to_hash
267
+ hash = {}
268
+ self.class.attribute_map.each_pair do |attr, param|
269
+ value = self.send(attr)
270
+ if value.nil?
271
+ is_nullable = self.class.openapi_nullable.include?(attr)
272
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
273
+ end
274
+
275
+ hash[param] = _to_hash(value)
276
+ end
277
+ hash
278
+ end
279
+
280
+ # Outputs non-array value in the form of hash
281
+ # For object, use to_hash. Otherwise, just return the value
282
+ # @param [Object] value Any valid value
283
+ # @return [Hash] Returns the value in the form of hash
284
+ def _to_hash(value)
285
+ if value.is_a?(Array)
286
+ value.compact.map { |v| _to_hash(v) }
287
+ elsif value.is_a?(Hash)
288
+ {}.tap do |hash|
289
+ value.each { |k, v| hash[k] = _to_hash(v) }
290
+ end
291
+ elsif value.respond_to? :to_hash
292
+ value.to_hash
293
+ else
294
+ value
295
+ end
296
+ end
297
+
298
+ end
299
+
300
+ end
@@ -0,0 +1,250 @@
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 ConversationPbxCallAiCost
18
+ # Total cost amount in the specified currency
19
+ attr_accessor :amount
20
+
21
+ # Number of minutes billed for AI usage
22
+ attr_accessor :billed_minutes
23
+
24
+ # Cost per minute for AI usage
25
+ attr_accessor :cost_per_minute
26
+
27
+ # Currency code (always USD)
28
+ attr_accessor :currency
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'amount' => :'amount',
34
+ :'billed_minutes' => :'billed_minutes',
35
+ :'cost_per_minute' => :'cost_per_minute',
36
+ :'currency' => :'currency'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'amount' => :'Float',
49
+ :'billed_minutes' => :'Float',
50
+ :'cost_per_minute' => :'Float',
51
+ :'currency' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCallAiCost` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCallAiCost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'amount')
77
+ self.amount = attributes[:'amount']
78
+ end
79
+
80
+ if attributes.key?(:'billed_minutes')
81
+ self.billed_minutes = attributes[:'billed_minutes']
82
+ end
83
+
84
+ if attributes.key?(:'cost_per_minute')
85
+ self.cost_per_minute = attributes[:'cost_per_minute']
86
+ end
87
+
88
+ if attributes.key?(:'currency')
89
+ self.currency = attributes[:'currency']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ amount == o.amount &&
112
+ billed_minutes == o.billed_minutes &&
113
+ cost_per_minute == o.cost_per_minute &&
114
+ currency == o.currency
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [amount, billed_minutes, cost_per_minute, currency].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = UltracartClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end