ultracart_api 4.1.39 → 4.1.41

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,9 @@ module UltracartClient
24
24
  # Conversation Pbx Phone Number UUID
25
25
  attr_accessor :conversation_pbx_phone_number_uuid
26
26
 
27
+ # If true, this phone number cannot be deleted through the API. It must be deleted via the Twilio console.
28
+ attr_accessor :deletion_protected
29
+
27
30
  # Merchant Id
28
31
  attr_accessor :merchant_id
29
32
 
@@ -58,6 +61,7 @@ module UltracartClient
58
61
  :'action' => :'action',
59
62
  :'action_target' => :'action_target',
60
63
  :'conversation_pbx_phone_number_uuid' => :'conversation_pbx_phone_number_uuid',
64
+ :'deletion_protected' => :'deletion_protected',
61
65
  :'merchant_id' => :'merchant_id',
62
66
  :'phone_number' => :'phone_number'
63
67
  }
@@ -74,6 +78,7 @@ module UltracartClient
74
78
  :'action' => :'String',
75
79
  :'action_target' => :'String',
76
80
  :'conversation_pbx_phone_number_uuid' => :'String',
81
+ :'deletion_protected' => :'Boolean',
77
82
  :'merchant_id' => :'String',
78
83
  :'phone_number' => :'String'
79
84
  }
@@ -112,6 +117,10 @@ module UltracartClient
112
117
  self.conversation_pbx_phone_number_uuid = attributes[:'conversation_pbx_phone_number_uuid']
113
118
  end
114
119
 
120
+ if attributes.key?(:'deletion_protected')
121
+ self.deletion_protected = attributes[:'deletion_protected']
122
+ end
123
+
115
124
  if attributes.key?(:'merchant_id')
116
125
  self.merchant_id = attributes[:'merchant_id']
117
126
  end
@@ -219,6 +228,7 @@ module UltracartClient
219
228
  action == o.action &&
220
229
  action_target == o.action_target &&
221
230
  conversation_pbx_phone_number_uuid == o.conversation_pbx_phone_number_uuid &&
231
+ deletion_protected == o.deletion_protected &&
222
232
  merchant_id == o.merchant_id &&
223
233
  phone_number == o.phone_number
224
234
  end
@@ -232,7 +242,7 @@ module UltracartClient
232
242
  # Calculates hash code according to all attributes.
233
243
  # @return [Integer] Hash code
234
244
  def hash
235
- [action, action_target, conversation_pbx_phone_number_uuid, merchant_id, phone_number].hash
245
+ [action, action_target, conversation_pbx_phone_number_uuid, deletion_protected, merchant_id, phone_number].hash
236
246
  end
237
247
 
238
248
  # Builds the object from hash
@@ -0,0 +1,359 @@
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 ConversationPbxPhoneNumberPurchaseRequest
18
+ # Initial action for incoming calls
19
+ attr_accessor :action
20
+
21
+ # Initial action target UUID
22
+ attr_accessor :action_target
23
+
24
+ # Address SID if required for regulatory compliance
25
+ attr_accessor :address_sid
26
+
27
+ # Friendly name for the phone number
28
+ attr_accessor :friendly_name
29
+
30
+ # Phone number to purchase in E.164 format (from search results)
31
+ attr_accessor :phone_number
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'action' => :'action',
59
+ :'action_target' => :'action_target',
60
+ :'address_sid' => :'address_sid',
61
+ :'friendly_name' => :'friendly_name',
62
+ :'phone_number' => :'phone_number'
63
+ }
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'action' => :'String',
75
+ :'action_target' => :'String',
76
+ :'address_sid' => :'String',
77
+ :'friendly_name' => :'String',
78
+ :'phone_number' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxPhoneNumberPurchaseRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!self.class.attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxPhoneNumberPurchaseRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'action')
104
+ self.action = attributes[:'action']
105
+ end
106
+
107
+ if attributes.key?(:'action_target')
108
+ self.action_target = attributes[:'action_target']
109
+ end
110
+
111
+ if attributes.key?(:'address_sid')
112
+ self.address_sid = attributes[:'address_sid']
113
+ end
114
+
115
+ if attributes.key?(:'friendly_name')
116
+ self.friendly_name = attributes[:'friendly_name']
117
+ end
118
+
119
+ if attributes.key?(:'phone_number')
120
+ self.phone_number = attributes[:'phone_number']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ if !@action.nil? && @action.to_s.length > 30
129
+ invalid_properties.push('invalid value for "action", the character length must be smaller than or equal to 30.')
130
+ end
131
+
132
+ if !@action_target.nil? && @action_target.to_s.length > 50
133
+ invalid_properties.push('invalid value for "action_target", the character length must be smaller than or equal to 50.')
134
+ end
135
+
136
+ if !@address_sid.nil? && @address_sid.to_s.length > 50
137
+ invalid_properties.push('invalid value for "address_sid", the character length must be smaller than or equal to 50.')
138
+ end
139
+
140
+ if !@friendly_name.nil? && @friendly_name.to_s.length > 64
141
+ invalid_properties.push('invalid value for "friendly_name", the character length must be smaller than or equal to 64.')
142
+ end
143
+
144
+ if !@phone_number.nil? && @phone_number.to_s.length > 50
145
+ invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 50.')
146
+ end
147
+
148
+ invalid_properties
149
+ end
150
+
151
+ # Check to see if the all the properties in the model are valid
152
+ # @return true if the model is valid
153
+ def valid?
154
+ action_validator = EnumAttributeValidator.new('String', ["time based", "menu", "queue", "voicemail", "agent"])
155
+ return false unless action_validator.valid?(@action)
156
+ return false if !@action.nil? && @action.to_s.length > 30
157
+ return false if !@action_target.nil? && @action_target.to_s.length > 50
158
+ return false if !@address_sid.nil? && @address_sid.to_s.length > 50
159
+ return false if !@friendly_name.nil? && @friendly_name.to_s.length > 64
160
+ return false if !@phone_number.nil? && @phone_number.to_s.length > 50
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method checking allowed values (enum).
165
+ # @param [Object] action Object to be assigned
166
+ def action=(action)
167
+ validator = EnumAttributeValidator.new('String', ["time based", "menu", "queue", "voicemail", "agent"])
168
+ unless validator.valid?(action)
169
+ fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
170
+ end
171
+ @action = action
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] action_target Value to be assigned
176
+ def action_target=(action_target)
177
+ if !action_target.nil? && action_target.to_s.length > 50
178
+ fail ArgumentError, 'invalid value for "action_target", the character length must be smaller than or equal to 50.'
179
+ end
180
+
181
+ @action_target = action_target
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] address_sid Value to be assigned
186
+ def address_sid=(address_sid)
187
+ if !address_sid.nil? && address_sid.to_s.length > 50
188
+ fail ArgumentError, 'invalid value for "address_sid", the character length must be smaller than or equal to 50.'
189
+ end
190
+
191
+ @address_sid = address_sid
192
+ end
193
+
194
+ # Custom attribute writer method with validation
195
+ # @param [Object] friendly_name Value to be assigned
196
+ def friendly_name=(friendly_name)
197
+ if !friendly_name.nil? && friendly_name.to_s.length > 64
198
+ fail ArgumentError, 'invalid value for "friendly_name", the character length must be smaller than or equal to 64.'
199
+ end
200
+
201
+ @friendly_name = friendly_name
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] phone_number Value to be assigned
206
+ def phone_number=(phone_number)
207
+ if !phone_number.nil? && phone_number.to_s.length > 50
208
+ fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 50.'
209
+ end
210
+
211
+ @phone_number = phone_number
212
+ end
213
+
214
+ # Checks equality by comparing each attribute.
215
+ # @param [Object] Object to be compared
216
+ def ==(o)
217
+ return true if self.equal?(o)
218
+ self.class == o.class &&
219
+ action == o.action &&
220
+ action_target == o.action_target &&
221
+ address_sid == o.address_sid &&
222
+ friendly_name == o.friendly_name &&
223
+ phone_number == o.phone_number
224
+ end
225
+
226
+ # @see the `==` method
227
+ # @param [Object] Object to be compared
228
+ def eql?(o)
229
+ self == o
230
+ end
231
+
232
+ # Calculates hash code according to all attributes.
233
+ # @return [Integer] Hash code
234
+ def hash
235
+ [action, action_target, address_sid, friendly_name, phone_number].hash
236
+ end
237
+
238
+ # Builds the object from hash
239
+ # @param [Hash] attributes Model attributes in the form of hash
240
+ # @return [Object] Returns the model itself
241
+ def self.build_from_hash(attributes)
242
+ new.build_from_hash(attributes)
243
+ end
244
+
245
+ # Builds the object from hash
246
+ # @param [Hash] attributes Model attributes in the form of hash
247
+ # @return [Object] Returns the model itself
248
+ def build_from_hash(attributes)
249
+ return nil unless attributes.is_a?(Hash)
250
+ attributes = attributes.transform_keys(&:to_sym)
251
+ self.class.openapi_types.each_pair do |key, type|
252
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
253
+ self.send("#{key}=", nil)
254
+ elsif type =~ /\AArray<(.*)>/i
255
+ # check to ensure the input is an array given that the attribute
256
+ # is documented as an array but the input is not
257
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
258
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
259
+ end
260
+ elsif !attributes[self.class.attribute_map[key]].nil?
261
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
262
+ end
263
+ end
264
+
265
+ self
266
+ end
267
+
268
+ # Deserializes the data based on type
269
+ # @param string type Data type
270
+ # @param string value Value to be deserialized
271
+ # @return [Object] Deserialized data
272
+ def _deserialize(type, value)
273
+ case type.to_sym
274
+ when :Time
275
+ Time.parse(value)
276
+ when :Date
277
+ Date.parse(value)
278
+ when :String
279
+ value.to_s
280
+ when :Integer
281
+ value.to_i
282
+ when :Float
283
+ value.to_f
284
+ when :Boolean
285
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
286
+ true
287
+ else
288
+ false
289
+ end
290
+ when :Object
291
+ # generic object (usually a Hash), return directly
292
+ value
293
+ when /\AArray<(?<inner_type>.+)>\z/
294
+ inner_type = Regexp.last_match[:inner_type]
295
+ value.map { |v| _deserialize(inner_type, v) }
296
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
297
+ k_type = Regexp.last_match[:k_type]
298
+ v_type = Regexp.last_match[:v_type]
299
+ {}.tap do |hash|
300
+ value.each do |k, v|
301
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
302
+ end
303
+ end
304
+ else # model
305
+ # models (e.g. Pet) or oneOf
306
+ klass = UltracartClient.const_get(type)
307
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
308
+ end
309
+ end
310
+
311
+ # Returns the string representation of the object
312
+ # @return [String] String presentation of the object
313
+ def to_s
314
+ to_hash.to_s
315
+ end
316
+
317
+ # to_body is an alias to to_hash (backward compatibility)
318
+ # @return [Hash] Returns the object in the form of hash
319
+ def to_body
320
+ to_hash
321
+ end
322
+
323
+ # Returns the object in the form of hash
324
+ # @return [Hash] Returns the object in the form of hash
325
+ def to_hash
326
+ hash = {}
327
+ self.class.attribute_map.each_pair do |attr, param|
328
+ value = self.send(attr)
329
+ if value.nil?
330
+ is_nullable = self.class.openapi_nullable.include?(attr)
331
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
332
+ end
333
+
334
+ hash[param] = _to_hash(value)
335
+ end
336
+ hash
337
+ end
338
+
339
+ # Outputs non-array value in the form of hash
340
+ # For object, use to_hash. Otherwise, just return the value
341
+ # @param [Object] value Any valid value
342
+ # @return [Hash] Returns the value in the form of hash
343
+ def _to_hash(value)
344
+ if value.is_a?(Array)
345
+ value.compact.map { |v| _to_hash(v) }
346
+ elsif value.is_a?(Hash)
347
+ {}.tap do |hash|
348
+ value.each { |k, v| hash[k] = _to_hash(v) }
349
+ end
350
+ elsif value.respond_to? :to_hash
351
+ value.to_hash
352
+ else
353
+ value
354
+ end
355
+ end
356
+
357
+ end
358
+
359
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.1.39'
14
+ VERSION = '4.1.41'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -197,6 +197,9 @@ require 'ultracart_api/models/conversation_messages_response'
197
197
  require 'ultracart_api/models/conversation_multimedia_upload_url'
198
198
  require 'ultracart_api/models/conversation_multimedia_upload_url_response'
199
199
  require 'ultracart_api/models/conversation_participant'
200
+ require 'ultracart_api/models/conversation_pbx_address'
201
+ require 'ultracart_api/models/conversation_pbx_address_response'
202
+ require 'ultracart_api/models/conversation_pbx_addresses_response'
200
203
  require 'ultracart_api/models/conversation_pbx_agent'
201
204
  require 'ultracart_api/models/conversation_pbx_agent_response'
202
205
  require 'ultracart_api/models/conversation_pbx_agents_response'
@@ -206,6 +209,8 @@ require 'ultracart_api/models/conversation_pbx_audio_upload_url'
206
209
  require 'ultracart_api/models/conversation_pbx_audio_upload_url_response'
207
210
  require 'ultracart_api/models/conversation_pbx_audio_usage_response'
208
211
  require 'ultracart_api/models/conversation_pbx_audios_response'
212
+ require 'ultracart_api/models/conversation_pbx_available_phone_number'
213
+ require 'ultracart_api/models/conversation_pbx_available_phone_numbers_response'
209
214
  require 'ultracart_api/models/conversation_pbx_customer_snapshot_request'
210
215
  require 'ultracart_api/models/conversation_pbx_customer_snapshot_response'
211
216
  require 'ultracart_api/models/conversation_pbx_menu'
@@ -213,6 +218,7 @@ require 'ultracart_api/models/conversation_pbx_menu_mapping'
213
218
  require 'ultracart_api/models/conversation_pbx_menu_response'
214
219
  require 'ultracart_api/models/conversation_pbx_menus_response'
215
220
  require 'ultracart_api/models/conversation_pbx_phone_number'
221
+ require 'ultracart_api/models/conversation_pbx_phone_number_purchase_request'
216
222
  require 'ultracart_api/models/conversation_pbx_phone_number_response'
217
223
  require 'ultracart_api/models/conversation_pbx_phone_numbers_response'
218
224
  require 'ultracart_api/models/conversation_pbx_queue'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.39
4
+ version: 4.1.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-31 00:00:00.000000000 Z
11
+ date: 2026-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -246,6 +246,9 @@ files:
246
246
  - docs/ConversationMultimediaUploadUrl.md
247
247
  - docs/ConversationMultimediaUploadUrlResponse.md
248
248
  - docs/ConversationParticipant.md
249
+ - docs/ConversationPbxAddress.md
250
+ - docs/ConversationPbxAddressResponse.md
251
+ - docs/ConversationPbxAddressesResponse.md
249
252
  - docs/ConversationPbxAgent.md
250
253
  - docs/ConversationPbxAgentResponse.md
251
254
  - docs/ConversationPbxAgentsResponse.md
@@ -255,6 +258,8 @@ files:
255
258
  - docs/ConversationPbxAudioUploadUrlResponse.md
256
259
  - docs/ConversationPbxAudioUsageResponse.md
257
260
  - docs/ConversationPbxAudiosResponse.md
261
+ - docs/ConversationPbxAvailablePhoneNumber.md
262
+ - docs/ConversationPbxAvailablePhoneNumbersResponse.md
258
263
  - docs/ConversationPbxCustomerSnapshotRequest.md
259
264
  - docs/ConversationPbxCustomerSnapshotResponse.md
260
265
  - docs/ConversationPbxMenu.md
@@ -262,6 +267,7 @@ files:
262
267
  - docs/ConversationPbxMenuResponse.md
263
268
  - docs/ConversationPbxMenusResponse.md
264
269
  - docs/ConversationPbxPhoneNumber.md
270
+ - docs/ConversationPbxPhoneNumberPurchaseRequest.md
265
271
  - docs/ConversationPbxPhoneNumberResponse.md
266
272
  - docs/ConversationPbxPhoneNumbersResponse.md
267
273
  - docs/ConversationPbxQueue.md
@@ -1192,6 +1198,9 @@ files:
1192
1198
  - lib/ultracart_api/models/conversation_multimedia_upload_url.rb
1193
1199
  - lib/ultracart_api/models/conversation_multimedia_upload_url_response.rb
1194
1200
  - lib/ultracart_api/models/conversation_participant.rb
1201
+ - lib/ultracart_api/models/conversation_pbx_address.rb
1202
+ - lib/ultracart_api/models/conversation_pbx_address_response.rb
1203
+ - lib/ultracart_api/models/conversation_pbx_addresses_response.rb
1195
1204
  - lib/ultracart_api/models/conversation_pbx_agent.rb
1196
1205
  - lib/ultracart_api/models/conversation_pbx_agent_response.rb
1197
1206
  - lib/ultracart_api/models/conversation_pbx_agents_response.rb
@@ -1201,6 +1210,8 @@ files:
1201
1210
  - lib/ultracart_api/models/conversation_pbx_audio_upload_url_response.rb
1202
1211
  - lib/ultracart_api/models/conversation_pbx_audio_usage_response.rb
1203
1212
  - lib/ultracart_api/models/conversation_pbx_audios_response.rb
1213
+ - lib/ultracart_api/models/conversation_pbx_available_phone_number.rb
1214
+ - lib/ultracart_api/models/conversation_pbx_available_phone_numbers_response.rb
1204
1215
  - lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb
1205
1216
  - lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb
1206
1217
  - lib/ultracart_api/models/conversation_pbx_menu.rb
@@ -1208,6 +1219,7 @@ files:
1208
1219
  - lib/ultracart_api/models/conversation_pbx_menu_response.rb
1209
1220
  - lib/ultracart_api/models/conversation_pbx_menus_response.rb
1210
1221
  - lib/ultracart_api/models/conversation_pbx_phone_number.rb
1222
+ - lib/ultracart_api/models/conversation_pbx_phone_number_purchase_request.rb
1211
1223
  - lib/ultracart_api/models/conversation_pbx_phone_number_response.rb
1212
1224
  - lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb
1213
1225
  - lib/ultracart_api/models/conversation_pbx_queue.rb