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
@@ -0,0 +1,312 @@
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 ConversationPbxCallAiEngagement
17
+ # Display name of the AI agent
18
+ attr_accessor :agent_name
19
+
20
+ # UUID of the AI agent configuration used
21
+ attr_accessor :agent_uuid
22
+
23
+ attr_accessor :cost
24
+
25
+ # Timestamp when the AI engagement ended
26
+ attr_accessor :ended_at_dts
27
+
28
+ # Type of AI engagement
29
+ attr_accessor :engagement_type
30
+
31
+ # Unique identifier for this AI engagement session
32
+ attr_accessor :session_uuid
33
+
34
+ # Timestamp when the AI engagement started
35
+ attr_accessor :started_at_dts
36
+
37
+ # Status of the AI engagement
38
+ attr_accessor :status
39
+
40
+ # List of tool calls made by the AI agent during this engagement
41
+ attr_accessor :tool_calls
42
+
43
+ # List of coaching whispers sent during this engagement
44
+ attr_accessor :whispers
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'agent_name' => :'agent_name',
72
+ :'agent_uuid' => :'agent_uuid',
73
+ :'cost' => :'cost',
74
+ :'ended_at_dts' => :'ended_at_dts',
75
+ :'engagement_type' => :'engagement_type',
76
+ :'session_uuid' => :'session_uuid',
77
+ :'started_at_dts' => :'started_at_dts',
78
+ :'status' => :'status',
79
+ :'tool_calls' => :'tool_calls',
80
+ :'whispers' => :'whispers'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.swagger_types
86
+ {
87
+ :'agent_name' => :'String',
88
+ :'agent_uuid' => :'String',
89
+ :'cost' => :'ConversationPbxCallAiCost',
90
+ :'ended_at_dts' => :'String',
91
+ :'engagement_type' => :'String',
92
+ :'session_uuid' => :'String',
93
+ :'started_at_dts' => :'String',
94
+ :'status' => :'String',
95
+ :'tool_calls' => :'Array<ConversationPbxCallAiToolCall>',
96
+ :'whispers' => :'Array<ConversationPbxCallAiWhisper>'
97
+ }
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ return unless attributes.is_a?(Hash)
104
+
105
+ # convert string to symbol for hash key
106
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
107
+
108
+ if attributes.has_key?(:'agent_name')
109
+ self.agent_name = attributes[:'agent_name']
110
+ end
111
+
112
+ if attributes.has_key?(:'agent_uuid')
113
+ self.agent_uuid = attributes[:'agent_uuid']
114
+ end
115
+
116
+ if attributes.has_key?(:'cost')
117
+ self.cost = attributes[:'cost']
118
+ end
119
+
120
+ if attributes.has_key?(:'ended_at_dts')
121
+ self.ended_at_dts = attributes[:'ended_at_dts']
122
+ end
123
+
124
+ if attributes.has_key?(:'engagement_type')
125
+ self.engagement_type = attributes[:'engagement_type']
126
+ end
127
+
128
+ if attributes.has_key?(:'session_uuid')
129
+ self.session_uuid = attributes[:'session_uuid']
130
+ end
131
+
132
+ if attributes.has_key?(:'started_at_dts')
133
+ self.started_at_dts = attributes[:'started_at_dts']
134
+ end
135
+
136
+ if attributes.has_key?(:'status')
137
+ self.status = attributes[:'status']
138
+ end
139
+
140
+ if attributes.has_key?(:'tool_calls')
141
+ if (value = attributes[:'tool_calls']).is_a?(Array)
142
+ self.tool_calls = value
143
+ end
144
+ end
145
+
146
+ if attributes.has_key?(:'whispers')
147
+ if (value = attributes[:'whispers']).is_a?(Array)
148
+ self.whispers = value
149
+ end
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ invalid_properties = Array.new
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ engagement_type_validator = EnumAttributeValidator.new('String', ['ai_agent', 'ai_coach'])
164
+ return false unless engagement_type_validator.valid?(@engagement_type)
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] engagement_type Object to be assigned
170
+ def engagement_type=(engagement_type)
171
+ validator = EnumAttributeValidator.new('String', ['ai_agent', 'ai_coach'])
172
+ unless validator.valid?(engagement_type)
173
+ fail ArgumentError, 'invalid value for "engagement_type", must be one of #{validator.allowable_values}.'
174
+ end
175
+ @engagement_type = engagement_type
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ agent_name == o.agent_name &&
184
+ agent_uuid == o.agent_uuid &&
185
+ cost == o.cost &&
186
+ ended_at_dts == o.ended_at_dts &&
187
+ engagement_type == o.engagement_type &&
188
+ session_uuid == o.session_uuid &&
189
+ started_at_dts == o.started_at_dts &&
190
+ status == o.status &&
191
+ tool_calls == o.tool_calls &&
192
+ whispers == o.whispers
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Fixnum] Hash code
203
+ def hash
204
+ [agent_name, agent_uuid, cost, ended_at_dts, engagement_type, session_uuid, started_at_dts, status, tool_calls, whispers].hash
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def build_from_hash(attributes)
211
+ return nil unless attributes.is_a?(Hash)
212
+ self.class.swagger_types.each_pair do |key, type|
213
+ if type =~ /\AArray<(.*)>/i
214
+ # check to ensure the input is an array given that the attribute
215
+ # is documented as an array but the input is not
216
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
217
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
218
+ end
219
+ elsif !attributes[self.class.attribute_map[key]].nil?
220
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
221
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
222
+ end
223
+
224
+ self
225
+ end
226
+
227
+ # Deserializes the data based on type
228
+ # @param string type Data type
229
+ # @param string value Value to be deserialized
230
+ # @return [Object] Deserialized data
231
+ def _deserialize(type, value)
232
+ case type.to_sym
233
+ when :DateTime
234
+ DateTime.parse(value)
235
+ when :Date
236
+ Date.parse(value)
237
+ when :String
238
+ value.to_s
239
+ when :Integer
240
+ value.to_i
241
+ when :Float
242
+ value.to_f
243
+ when :BOOLEAN
244
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
245
+ true
246
+ else
247
+ false
248
+ end
249
+ when :Object
250
+ # generic object (usually a Hash), return directly
251
+ value
252
+ when /\AArray<(?<inner_type>.+)>\z/
253
+ inner_type = Regexp.last_match[:inner_type]
254
+ value.map { |v| _deserialize(inner_type, v) }
255
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
256
+ k_type = Regexp.last_match[:k_type]
257
+ v_type = Regexp.last_match[:v_type]
258
+ {}.tap do |hash|
259
+ value.each do |k, v|
260
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
261
+ end
262
+ end
263
+ else # model
264
+ temp_model = UltracartClient.const_get(type).new
265
+ temp_model.build_from_hash(value)
266
+ end
267
+ end
268
+
269
+ # Returns the string representation of the object
270
+ # @return [String] String presentation of the object
271
+ def to_s
272
+ to_hash.to_s
273
+ end
274
+
275
+ # to_body is an alias to to_hash (backward compatibility)
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_body
278
+ to_hash
279
+ end
280
+
281
+ # Returns the object in the form of hash
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_hash
284
+ hash = {}
285
+ self.class.attribute_map.each_pair do |attr, param|
286
+ value = self.send(attr)
287
+ next if value.nil?
288
+ hash[param] = _to_hash(value)
289
+ end
290
+ hash
291
+ end
292
+
293
+ # Outputs non-array value in the form of hash
294
+ # For object, use to_hash. Otherwise, just return the value
295
+ # @param [Object] value Any valid value
296
+ # @return [Hash] Returns the value in the form of hash
297
+ def _to_hash(value)
298
+ if value.is_a?(Array)
299
+ value.compact.map { |v| _to_hash(v) }
300
+ elsif value.is_a?(Hash)
301
+ {}.tap do |hash|
302
+ value.each { |k, v| hash[k] = _to_hash(v) }
303
+ end
304
+ elsif value.respond_to? :to_hash
305
+ value.to_hash
306
+ else
307
+ value
308
+ end
309
+ end
310
+
311
+ end
312
+ end
@@ -0,0 +1,265 @@
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 ConversationPbxCallAiToolCall
17
+ # Timestamp when the tool was called
18
+ attr_accessor :called_at_dts
19
+
20
+ # Timestamp when the tool call completed
21
+ attr_accessor :completed_at_dts
22
+
23
+ # Duration of the tool call in milliseconds
24
+ attr_accessor :duration_ms
25
+
26
+ # Error message if the tool call failed
27
+ attr_accessor :error_message
28
+
29
+ # Parameters passed to the tool (structure varies by tool)
30
+ attr_accessor :parameters
31
+
32
+ # Result returned by the tool (structure varies by tool)
33
+ attr_accessor :result
34
+
35
+ # Whether the tool call succeeded
36
+ attr_accessor :success
37
+
38
+ # Unique identifier for this tool call
39
+ attr_accessor :tool_call_uuid
40
+
41
+ # Name of the tool that was called
42
+ attr_accessor :tool_name
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'called_at_dts' => :'called_at_dts',
48
+ :'completed_at_dts' => :'completed_at_dts',
49
+ :'duration_ms' => :'duration_ms',
50
+ :'error_message' => :'error_message',
51
+ :'parameters' => :'parameters',
52
+ :'result' => :'result',
53
+ :'success' => :'success',
54
+ :'tool_call_uuid' => :'tool_call_uuid',
55
+ :'tool_name' => :'tool_name'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ :'called_at_dts' => :'String',
63
+ :'completed_at_dts' => :'String',
64
+ :'duration_ms' => :'Integer',
65
+ :'error_message' => :'String',
66
+ :'parameters' => :'Object',
67
+ :'result' => :'Object',
68
+ :'success' => :'BOOLEAN',
69
+ :'tool_call_uuid' => :'String',
70
+ :'tool_name' => :'String'
71
+ }
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ if attributes.has_key?(:'called_at_dts')
83
+ self.called_at_dts = attributes[:'called_at_dts']
84
+ end
85
+
86
+ if attributes.has_key?(:'completed_at_dts')
87
+ self.completed_at_dts = attributes[:'completed_at_dts']
88
+ end
89
+
90
+ if attributes.has_key?(:'duration_ms')
91
+ self.duration_ms = attributes[:'duration_ms']
92
+ end
93
+
94
+ if attributes.has_key?(:'error_message')
95
+ self.error_message = attributes[:'error_message']
96
+ end
97
+
98
+ if attributes.has_key?(:'parameters')
99
+ self.parameters = attributes[:'parameters']
100
+ end
101
+
102
+ if attributes.has_key?(:'result')
103
+ self.result = attributes[:'result']
104
+ end
105
+
106
+ if attributes.has_key?(:'success')
107
+ self.success = attributes[:'success']
108
+ end
109
+
110
+ if attributes.has_key?(:'tool_call_uuid')
111
+ self.tool_call_uuid = attributes[:'tool_call_uuid']
112
+ end
113
+
114
+ if attributes.has_key?(:'tool_name')
115
+ self.tool_name = attributes[:'tool_name']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ true
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ called_at_dts == o.called_at_dts &&
138
+ completed_at_dts == o.completed_at_dts &&
139
+ duration_ms == o.duration_ms &&
140
+ error_message == o.error_message &&
141
+ parameters == o.parameters &&
142
+ result == o.result &&
143
+ success == o.success &&
144
+ tool_call_uuid == o.tool_call_uuid &&
145
+ tool_name == o.tool_name
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Fixnum] Hash code
156
+ def hash
157
+ [called_at_dts, completed_at_dts, duration_ms, error_message, parameters, result, success, tool_call_uuid, tool_name].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ self.class.swagger_types.each_pair do |key, type|
166
+ if type =~ /\AArray<(.*)>/i
167
+ # check to ensure the input is an array given that the attribute
168
+ # is documented as an array but the input is not
169
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
170
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
171
+ end
172
+ elsif !attributes[self.class.attribute_map[key]].nil?
173
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
174
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
175
+ end
176
+
177
+ self
178
+ end
179
+
180
+ # Deserializes the data based on type
181
+ # @param string type Data type
182
+ # @param string value Value to be deserialized
183
+ # @return [Object] Deserialized data
184
+ def _deserialize(type, value)
185
+ case type.to_sym
186
+ when :DateTime
187
+ DateTime.parse(value)
188
+ when :Date
189
+ Date.parse(value)
190
+ when :String
191
+ value.to_s
192
+ when :Integer
193
+ value.to_i
194
+ when :Float
195
+ value.to_f
196
+ when :BOOLEAN
197
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
198
+ true
199
+ else
200
+ false
201
+ end
202
+ when :Object
203
+ # generic object (usually a Hash), return directly
204
+ value
205
+ when /\AArray<(?<inner_type>.+)>\z/
206
+ inner_type = Regexp.last_match[:inner_type]
207
+ value.map { |v| _deserialize(inner_type, v) }
208
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
209
+ k_type = Regexp.last_match[:k_type]
210
+ v_type = Regexp.last_match[:v_type]
211
+ {}.tap do |hash|
212
+ value.each do |k, v|
213
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
+ end
215
+ end
216
+ else # model
217
+ temp_model = UltracartClient.const_get(type).new
218
+ temp_model.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ next if value.nil?
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+ end