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