ultracart_api 4.1.72 → 4.1.74

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.
@@ -24,6 +24,8 @@ module UltracartClient
24
24
  # List of AI agent engagements during the call
25
25
  attr_accessor :ai_agent_engagements
26
26
 
27
+ attr_accessor :ai_summary
28
+
27
29
  # Twilio call SID for the primary (customer) call leg
28
30
  attr_accessor :call_sid
29
31
 
@@ -77,12 +79,19 @@ module UltracartClient
77
79
  # Timestamp when the call record was last updated
78
80
  attr_accessor :updated_at_dts
79
81
 
82
+ # Zoho Desk ticket ID if a ticket was created for this call
83
+ attr_accessor :zoho_desk_ticket_id
84
+
85
+ # URL to the Zoho Desk ticket if a ticket was created for this call
86
+ attr_accessor :zoho_desk_ticket_url
87
+
80
88
  # Attribute mapping from ruby-style variable name to JSON key.
81
89
  def self.attribute_map
82
90
  {
83
91
  :'account_sid' => :'account_sid',
84
92
  :'agents' => :'agents',
85
93
  :'ai_agent_engagements' => :'ai_agent_engagements',
94
+ :'ai_summary' => :'ai_summary',
86
95
  :'call_sid' => :'call_sid',
87
96
  :'call_uuid' => :'call_uuid',
88
97
  :'caller' => :'caller',
@@ -101,7 +110,9 @@ module UltracartClient
101
110
  :'status' => :'status',
102
111
  :'timeline' => :'timeline',
103
112
  :'transfers' => :'transfers',
104
- :'updated_at_dts' => :'updated_at_dts'
113
+ :'updated_at_dts' => :'updated_at_dts',
114
+ :'zoho_desk_ticket_id' => :'zoho_desk_ticket_id',
115
+ :'zoho_desk_ticket_url' => :'zoho_desk_ticket_url'
105
116
  }
106
117
  end
107
118
 
@@ -116,6 +127,7 @@ module UltracartClient
116
127
  :'account_sid' => :'String',
117
128
  :'agents' => :'Array<ConversationPbxCallAgent>',
118
129
  :'ai_agent_engagements' => :'Array<ConversationPbxCallAiEngagement>',
130
+ :'ai_summary' => :'ConversationPbxCallAiSummary',
119
131
  :'call_sid' => :'String',
120
132
  :'call_uuid' => :'String',
121
133
  :'caller' => :'ConversationPbxCallCaller',
@@ -134,7 +146,9 @@ module UltracartClient
134
146
  :'status' => :'String',
135
147
  :'timeline' => :'ConversationPbxCallTimeline',
136
148
  :'transfers' => :'Array<ConversationPbxCallTransfer>',
137
- :'updated_at_dts' => :'String'
149
+ :'updated_at_dts' => :'String',
150
+ :'zoho_desk_ticket_id' => :'String',
151
+ :'zoho_desk_ticket_url' => :'String'
138
152
  }
139
153
  end
140
154
 
@@ -175,6 +189,10 @@ module UltracartClient
175
189
  end
176
190
  end
177
191
 
192
+ if attributes.key?(:'ai_summary')
193
+ self.ai_summary = attributes[:'ai_summary']
194
+ end
195
+
178
196
  if attributes.key?(:'call_sid')
179
197
  self.call_sid = attributes[:'call_sid']
180
198
  end
@@ -258,6 +276,14 @@ module UltracartClient
258
276
  if attributes.key?(:'updated_at_dts')
259
277
  self.updated_at_dts = attributes[:'updated_at_dts']
260
278
  end
279
+
280
+ if attributes.key?(:'zoho_desk_ticket_id')
281
+ self.zoho_desk_ticket_id = attributes[:'zoho_desk_ticket_id']
282
+ end
283
+
284
+ if attributes.key?(:'zoho_desk_ticket_url')
285
+ self.zoho_desk_ticket_url = attributes[:'zoho_desk_ticket_url']
286
+ end
261
287
  end
262
288
 
263
289
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -281,6 +307,7 @@ module UltracartClient
281
307
  account_sid == o.account_sid &&
282
308
  agents == o.agents &&
283
309
  ai_agent_engagements == o.ai_agent_engagements &&
310
+ ai_summary == o.ai_summary &&
284
311
  call_sid == o.call_sid &&
285
312
  call_uuid == o.call_uuid &&
286
313
  caller == o.caller &&
@@ -299,7 +326,9 @@ module UltracartClient
299
326
  status == o.status &&
300
327
  timeline == o.timeline &&
301
328
  transfers == o.transfers &&
302
- updated_at_dts == o.updated_at_dts
329
+ updated_at_dts == o.updated_at_dts &&
330
+ zoho_desk_ticket_id == o.zoho_desk_ticket_id &&
331
+ zoho_desk_ticket_url == o.zoho_desk_ticket_url
303
332
  end
304
333
 
305
334
  # @see the `==` method
@@ -311,7 +340,7 @@ module UltracartClient
311
340
  # Calculates hash code according to all attributes.
312
341
  # @return [Integer] Hash code
313
342
  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
343
+ [account_sid, agents, ai_agent_engagements, ai_summary, 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, zoho_desk_ticket_id, zoho_desk_ticket_url].hash
315
344
  end
316
345
 
317
346
  # Builds the object from hash
@@ -0,0 +1,358 @@
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 ConversationPbxCallAiSummary
18
+ # Action items identified during the call
19
+ attr_accessor :action_items
20
+
21
+ # Category of the call (e.g. support, sales, billing)
22
+ attr_accessor :call_category
23
+
24
+ # Number of output tokens used to generate the summary
25
+ attr_accessor :completion_tokens
26
+
27
+ # Cost of generating the summary in the specified currency
28
+ attr_accessor :cost
29
+
30
+ # Currency code for the summary cost (always USD)
31
+ attr_accessor :cost_currency
32
+
33
+ # Timestamp when the summary was generated
34
+ attr_accessor :generated_at_dts
35
+
36
+ # Key topics discussed during the call
37
+ attr_accessor :key_topics
38
+
39
+ # AI model used to generate the summary (e.g. grok-4.1-fast)
40
+ attr_accessor :model
41
+
42
+ # Number of input tokens used to generate the summary
43
+ attr_accessor :prompt_tokens
44
+
45
+ # Overall sentiment of the call
46
+ attr_accessor :sentiment
47
+
48
+ # 2-3 sentence synopsis of the call
49
+ attr_accessor :summary
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'action_items' => :'action_items',
77
+ :'call_category' => :'call_category',
78
+ :'completion_tokens' => :'completion_tokens',
79
+ :'cost' => :'cost',
80
+ :'cost_currency' => :'cost_currency',
81
+ :'generated_at_dts' => :'generated_at_dts',
82
+ :'key_topics' => :'key_topics',
83
+ :'model' => :'model',
84
+ :'prompt_tokens' => :'prompt_tokens',
85
+ :'sentiment' => :'sentiment',
86
+ :'summary' => :'summary'
87
+ }
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'action_items' => :'Array<String>',
99
+ :'call_category' => :'String',
100
+ :'completion_tokens' => :'Integer',
101
+ :'cost' => :'Float',
102
+ :'cost_currency' => :'String',
103
+ :'generated_at_dts' => :'String',
104
+ :'key_topics' => :'Array<String>',
105
+ :'model' => :'String',
106
+ :'prompt_tokens' => :'Integer',
107
+ :'sentiment' => :'String',
108
+ :'summary' => :'String'
109
+ }
110
+ end
111
+
112
+ # List of attributes with nullable: true
113
+ def self.openapi_nullable
114
+ Set.new([
115
+ ])
116
+ end
117
+
118
+ # Initializes the object
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ def initialize(attributes = {})
121
+ if (!attributes.is_a?(Hash))
122
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxCallAiSummary` initialize method"
123
+ end
124
+
125
+ # check to see if the attribute exists and convert string to symbol for hash key
126
+ attributes = attributes.each_with_object({}) { |(k, v), h|
127
+ if (!self.class.attribute_map.key?(k.to_sym))
128
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxCallAiSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
129
+ end
130
+ h[k.to_sym] = v
131
+ }
132
+
133
+ if attributes.key?(:'action_items')
134
+ if (value = attributes[:'action_items']).is_a?(Array)
135
+ self.action_items = value
136
+ end
137
+ end
138
+
139
+ if attributes.key?(:'call_category')
140
+ self.call_category = attributes[:'call_category']
141
+ end
142
+
143
+ if attributes.key?(:'completion_tokens')
144
+ self.completion_tokens = attributes[:'completion_tokens']
145
+ end
146
+
147
+ if attributes.key?(:'cost')
148
+ self.cost = attributes[:'cost']
149
+ end
150
+
151
+ if attributes.key?(:'cost_currency')
152
+ self.cost_currency = attributes[:'cost_currency']
153
+ end
154
+
155
+ if attributes.key?(:'generated_at_dts')
156
+ self.generated_at_dts = attributes[:'generated_at_dts']
157
+ end
158
+
159
+ if attributes.key?(:'key_topics')
160
+ if (value = attributes[:'key_topics']).is_a?(Array)
161
+ self.key_topics = value
162
+ end
163
+ end
164
+
165
+ if attributes.key?(:'model')
166
+ self.model = attributes[:'model']
167
+ end
168
+
169
+ if attributes.key?(:'prompt_tokens')
170
+ self.prompt_tokens = attributes[:'prompt_tokens']
171
+ end
172
+
173
+ if attributes.key?(:'sentiment')
174
+ self.sentiment = attributes[:'sentiment']
175
+ end
176
+
177
+ if attributes.key?(:'summary')
178
+ self.summary = attributes[:'summary']
179
+ end
180
+ end
181
+
182
+ # Show invalid properties with the reasons. Usually used together with valid?
183
+ # @return Array for valid properties with the reasons
184
+ def list_invalid_properties
185
+ invalid_properties = Array.new
186
+ invalid_properties
187
+ end
188
+
189
+ # Check to see if the all the properties in the model are valid
190
+ # @return true if the model is valid
191
+ def valid?
192
+ sentiment_validator = EnumAttributeValidator.new('String', ["positive", "neutral", "negative"])
193
+ return false unless sentiment_validator.valid?(@sentiment)
194
+ true
195
+ end
196
+
197
+ # Custom attribute writer method checking allowed values (enum).
198
+ # @param [Object] sentiment Object to be assigned
199
+ def sentiment=(sentiment)
200
+ validator = EnumAttributeValidator.new('String', ["positive", "neutral", "negative"])
201
+ unless validator.valid?(sentiment)
202
+ fail ArgumentError, "invalid value for \"sentiment\", must be one of #{validator.allowable_values}."
203
+ end
204
+ @sentiment = sentiment
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] Object to be compared
209
+ def ==(o)
210
+ return true if self.equal?(o)
211
+ self.class == o.class &&
212
+ action_items == o.action_items &&
213
+ call_category == o.call_category &&
214
+ completion_tokens == o.completion_tokens &&
215
+ cost == o.cost &&
216
+ cost_currency == o.cost_currency &&
217
+ generated_at_dts == o.generated_at_dts &&
218
+ key_topics == o.key_topics &&
219
+ model == o.model &&
220
+ prompt_tokens == o.prompt_tokens &&
221
+ sentiment == o.sentiment &&
222
+ summary == o.summary
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [action_items, call_category, completion_tokens, cost, cost_currency, generated_at_dts, key_topics, model, prompt_tokens, sentiment, summary].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ new.build_from_hash(attributes)
242
+ end
243
+
244
+ # Builds the object from hash
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ # @return [Object] Returns the model itself
247
+ def build_from_hash(attributes)
248
+ return nil unless attributes.is_a?(Hash)
249
+ attributes = attributes.transform_keys(&:to_sym)
250
+ self.class.openapi_types.each_pair do |key, type|
251
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
252
+ self.send("#{key}=", nil)
253
+ elsif type =~ /\AArray<(.*)>/i
254
+ # check to ensure the input is an array given that the attribute
255
+ # is documented as an array but the input is not
256
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
257
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
258
+ end
259
+ elsif !attributes[self.class.attribute_map[key]].nil?
260
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
261
+ end
262
+ end
263
+
264
+ self
265
+ end
266
+
267
+ # Deserializes the data based on type
268
+ # @param string type Data type
269
+ # @param string value Value to be deserialized
270
+ # @return [Object] Deserialized data
271
+ def _deserialize(type, value)
272
+ case type.to_sym
273
+ when :Time
274
+ Time.parse(value)
275
+ when :Date
276
+ Date.parse(value)
277
+ when :String
278
+ value.to_s
279
+ when :Integer
280
+ value.to_i
281
+ when :Float
282
+ value.to_f
283
+ when :Boolean
284
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
285
+ true
286
+ else
287
+ false
288
+ end
289
+ when :Object
290
+ # generic object (usually a Hash), return directly
291
+ value
292
+ when /\AArray<(?<inner_type>.+)>\z/
293
+ inner_type = Regexp.last_match[:inner_type]
294
+ value.map { |v| _deserialize(inner_type, v) }
295
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
296
+ k_type = Regexp.last_match[:k_type]
297
+ v_type = Regexp.last_match[:v_type]
298
+ {}.tap do |hash|
299
+ value.each do |k, v|
300
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
301
+ end
302
+ end
303
+ else # model
304
+ # models (e.g. Pet) or oneOf
305
+ klass = UltracartClient.const_get(type)
306
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
307
+ end
308
+ end
309
+
310
+ # Returns the string representation of the object
311
+ # @return [String] String presentation of the object
312
+ def to_s
313
+ to_hash.to_s
314
+ end
315
+
316
+ # to_body is an alias to to_hash (backward compatibility)
317
+ # @return [Hash] Returns the object in the form of hash
318
+ def to_body
319
+ to_hash
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ if value.nil?
329
+ is_nullable = self.class.openapi_nullable.include?(attr)
330
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
+ end
332
+
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ # Outputs non-array value in the form of hash
339
+ # For object, use to_hash. Otherwise, just return the value
340
+ # @param [Object] value Any valid value
341
+ # @return [Hash] Returns the value in the form of hash
342
+ def _to_hash(value)
343
+ if value.is_a?(Array)
344
+ value.compact.map { |v| _to_hash(v) }
345
+ elsif value.is_a?(Hash)
346
+ {}.tap do |hash|
347
+ value.each { |k, v| hash[k] = _to_hash(v) }
348
+ end
349
+ elsif value.respond_to? :to_hash
350
+ value.to_hash
351
+ else
352
+ value
353
+ end
354
+ end
355
+
356
+ end
357
+
358
+ end
@@ -24,6 +24,9 @@ module UltracartClient
24
24
  # Currency for AI agent cost
25
25
  attr_accessor :ai_agent_cost_currency
26
26
 
27
+ # AI summary generation cost (LLM call made by pbx-transcript-formatter after the call ends)
28
+ attr_accessor :ai_summary_cost
29
+
27
30
  # Currency for call price (default USD)
28
31
  attr_accessor :call_currency
29
32
 
@@ -42,6 +45,7 @@ module UltracartClient
42
45
  :'ai_agent_billed_minutes' => :'ai_agent_billed_minutes',
43
46
  :'ai_agent_cost' => :'ai_agent_cost',
44
47
  :'ai_agent_cost_currency' => :'ai_agent_cost_currency',
48
+ :'ai_summary_cost' => :'ai_summary_cost',
45
49
  :'call_currency' => :'call_currency',
46
50
  :'call_price' => :'call_price',
47
51
  :'call_price_estimated' => :'call_price_estimated',
@@ -60,6 +64,7 @@ module UltracartClient
60
64
  :'ai_agent_billed_minutes' => :'Float',
61
65
  :'ai_agent_cost' => :'Float',
62
66
  :'ai_agent_cost_currency' => :'String',
67
+ :'ai_summary_cost' => :'Float',
63
68
  :'call_currency' => :'String',
64
69
  :'call_price' => :'Float',
65
70
  :'call_price_estimated' => :'Boolean',
@@ -100,6 +105,10 @@ module UltracartClient
100
105
  self.ai_agent_cost_currency = attributes[:'ai_agent_cost_currency']
101
106
  end
102
107
 
108
+ if attributes.key?(:'ai_summary_cost')
109
+ self.ai_summary_cost = attributes[:'ai_summary_cost']
110
+ end
111
+
103
112
  if attributes.key?(:'call_currency')
104
113
  self.call_currency = attributes[:'call_currency']
105
114
  end
@@ -138,6 +147,7 @@ module UltracartClient
138
147
  ai_agent_billed_minutes == o.ai_agent_billed_minutes &&
139
148
  ai_agent_cost == o.ai_agent_cost &&
140
149
  ai_agent_cost_currency == o.ai_agent_cost_currency &&
150
+ ai_summary_cost == o.ai_summary_cost &&
141
151
  call_currency == o.call_currency &&
142
152
  call_price == o.call_price &&
143
153
  call_price_estimated == o.call_price_estimated &&
@@ -153,7 +163,7 @@ module UltracartClient
153
163
  # Calculates hash code according to all attributes.
154
164
  # @return [Integer] Hash code
155
165
  def hash
156
- [ai_agent_billed_minutes, ai_agent_cost, ai_agent_cost_currency, call_currency, call_price, call_price_estimated, transcription_cost].hash
166
+ [ai_agent_billed_minutes, ai_agent_cost, ai_agent_cost_currency, ai_summary_cost, call_currency, call_price, call_price_estimated, transcription_cost].hash
157
167
  end
158
168
 
159
169
  # Builds the object from hash