ultracart_api 4.1.47 → 4.1.48

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.
@@ -0,0 +1,490 @@
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 ConversationPbxHardwarePhone
18
+ # Conversation Pbx Hardware Phone UUID
19
+ attr_accessor :conversation_pbx_hardware_phone_uuid
20
+
21
+ # Created At
22
+ attr_accessor :created_at
23
+
24
+ # Description
25
+ attr_accessor :description
26
+
27
+ # MAC Address
28
+ attr_accessor :mac_address
29
+
30
+ # Manufacturer
31
+ attr_accessor :manufacturer
32
+
33
+ # Merchant Id
34
+ attr_accessor :merchant_id
35
+
36
+ # Model
37
+ attr_accessor :model
38
+
39
+ # Name
40
+ attr_accessor :name
41
+
42
+ # Auto-provisioning URL for phone configuration
43
+ attr_accessor :provisioning_url
44
+
45
+ # SIP Domain
46
+ attr_accessor :sip_domain
47
+
48
+ # SIP Password
49
+ attr_accessor :sip_password
50
+
51
+ # SIP Username
52
+ attr_accessor :sip_username
53
+
54
+ # Updated At
55
+ attr_accessor :updated_at
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'conversation_pbx_hardware_phone_uuid' => :'conversation_pbx_hardware_phone_uuid',
61
+ :'created_at' => :'created_at',
62
+ :'description' => :'description',
63
+ :'mac_address' => :'mac_address',
64
+ :'manufacturer' => :'manufacturer',
65
+ :'merchant_id' => :'merchant_id',
66
+ :'model' => :'model',
67
+ :'name' => :'name',
68
+ :'provisioning_url' => :'provisioning_url',
69
+ :'sip_domain' => :'sip_domain',
70
+ :'sip_password' => :'sip_password',
71
+ :'sip_username' => :'sip_username',
72
+ :'updated_at' => :'updated_at'
73
+ }
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'conversation_pbx_hardware_phone_uuid' => :'String',
85
+ :'created_at' => :'Object',
86
+ :'description' => :'String',
87
+ :'mac_address' => :'String',
88
+ :'manufacturer' => :'String',
89
+ :'merchant_id' => :'String',
90
+ :'model' => :'String',
91
+ :'name' => :'String',
92
+ :'provisioning_url' => :'String',
93
+ :'sip_domain' => :'String',
94
+ :'sip_password' => :'String',
95
+ :'sip_username' => :'String',
96
+ :'updated_at' => :'Object'
97
+ }
98
+ end
99
+
100
+ # List of attributes with nullable: true
101
+ def self.openapi_nullable
102
+ Set.new([
103
+ ])
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ if (!attributes.is_a?(Hash))
110
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxHardwarePhone` initialize method"
111
+ end
112
+
113
+ # check to see if the attribute exists and convert string to symbol for hash key
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!self.class.attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxHardwarePhone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'conversation_pbx_hardware_phone_uuid')
122
+ self.conversation_pbx_hardware_phone_uuid = attributes[:'conversation_pbx_hardware_phone_uuid']
123
+ end
124
+
125
+ if attributes.key?(:'created_at')
126
+ self.created_at = attributes[:'created_at']
127
+ end
128
+
129
+ if attributes.key?(:'description')
130
+ self.description = attributes[:'description']
131
+ end
132
+
133
+ if attributes.key?(:'mac_address')
134
+ self.mac_address = attributes[:'mac_address']
135
+ end
136
+
137
+ if attributes.key?(:'manufacturer')
138
+ self.manufacturer = attributes[:'manufacturer']
139
+ end
140
+
141
+ if attributes.key?(:'merchant_id')
142
+ self.merchant_id = attributes[:'merchant_id']
143
+ end
144
+
145
+ if attributes.key?(:'model')
146
+ self.model = attributes[:'model']
147
+ end
148
+
149
+ if attributes.key?(:'name')
150
+ self.name = attributes[:'name']
151
+ end
152
+
153
+ if attributes.key?(:'provisioning_url')
154
+ self.provisioning_url = attributes[:'provisioning_url']
155
+ end
156
+
157
+ if attributes.key?(:'sip_domain')
158
+ self.sip_domain = attributes[:'sip_domain']
159
+ end
160
+
161
+ if attributes.key?(:'sip_password')
162
+ self.sip_password = attributes[:'sip_password']
163
+ end
164
+
165
+ if attributes.key?(:'sip_username')
166
+ self.sip_username = attributes[:'sip_username']
167
+ end
168
+
169
+ if attributes.key?(:'updated_at')
170
+ self.updated_at = attributes[:'updated_at']
171
+ end
172
+ end
173
+
174
+ # Show invalid properties with the reasons. Usually used together with valid?
175
+ # @return Array for valid properties with the reasons
176
+ def list_invalid_properties
177
+ invalid_properties = Array.new
178
+ if !@conversation_pbx_hardware_phone_uuid.nil? && @conversation_pbx_hardware_phone_uuid.to_s.length > 50
179
+ invalid_properties.push('invalid value for "conversation_pbx_hardware_phone_uuid", the character length must be smaller than or equal to 50.')
180
+ end
181
+
182
+ if !@description.nil? && @description.to_s.length > 500
183
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 500.')
184
+ end
185
+
186
+ if !@mac_address.nil? && @mac_address.to_s.length > 17
187
+ invalid_properties.push('invalid value for "mac_address", the character length must be smaller than or equal to 17.')
188
+ end
189
+
190
+ if !@manufacturer.nil? && @manufacturer.to_s.length > 100
191
+ invalid_properties.push('invalid value for "manufacturer", the character length must be smaller than or equal to 100.')
192
+ end
193
+
194
+ if !@merchant_id.nil? && @merchant_id.to_s.length > 5
195
+ invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
196
+ end
197
+
198
+ if !@model.nil? && @model.to_s.length > 100
199
+ invalid_properties.push('invalid value for "model", the character length must be smaller than or equal to 100.')
200
+ end
201
+
202
+ if !@name.nil? && @name.to_s.length > 100
203
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
204
+ end
205
+
206
+ if !@sip_domain.nil? && @sip_domain.to_s.length > 200
207
+ invalid_properties.push('invalid value for "sip_domain", the character length must be smaller than or equal to 200.')
208
+ end
209
+
210
+ if !@sip_password.nil? && @sip_password.to_s.length > 100
211
+ invalid_properties.push('invalid value for "sip_password", the character length must be smaller than or equal to 100.')
212
+ end
213
+
214
+ if !@sip_username.nil? && @sip_username.to_s.length > 100
215
+ invalid_properties.push('invalid value for "sip_username", the character length must be smaller than or equal to 100.')
216
+ end
217
+
218
+ invalid_properties
219
+ end
220
+
221
+ # Check to see if the all the properties in the model are valid
222
+ # @return true if the model is valid
223
+ def valid?
224
+ return false if !@conversation_pbx_hardware_phone_uuid.nil? && @conversation_pbx_hardware_phone_uuid.to_s.length > 50
225
+ return false if !@description.nil? && @description.to_s.length > 500
226
+ return false if !@mac_address.nil? && @mac_address.to_s.length > 17
227
+ return false if !@manufacturer.nil? && @manufacturer.to_s.length > 100
228
+ return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
229
+ return false if !@model.nil? && @model.to_s.length > 100
230
+ return false if !@name.nil? && @name.to_s.length > 100
231
+ return false if !@sip_domain.nil? && @sip_domain.to_s.length > 200
232
+ return false if !@sip_password.nil? && @sip_password.to_s.length > 100
233
+ return false if !@sip_username.nil? && @sip_username.to_s.length > 100
234
+ true
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] conversation_pbx_hardware_phone_uuid Value to be assigned
239
+ def conversation_pbx_hardware_phone_uuid=(conversation_pbx_hardware_phone_uuid)
240
+ if !conversation_pbx_hardware_phone_uuid.nil? && conversation_pbx_hardware_phone_uuid.to_s.length > 50
241
+ fail ArgumentError, 'invalid value for "conversation_pbx_hardware_phone_uuid", the character length must be smaller than or equal to 50.'
242
+ end
243
+
244
+ @conversation_pbx_hardware_phone_uuid = conversation_pbx_hardware_phone_uuid
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] description Value to be assigned
249
+ def description=(description)
250
+ if !description.nil? && description.to_s.length > 500
251
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 500.'
252
+ end
253
+
254
+ @description = description
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] mac_address Value to be assigned
259
+ def mac_address=(mac_address)
260
+ if !mac_address.nil? && mac_address.to_s.length > 17
261
+ fail ArgumentError, 'invalid value for "mac_address", the character length must be smaller than or equal to 17.'
262
+ end
263
+
264
+ @mac_address = mac_address
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] manufacturer Value to be assigned
269
+ def manufacturer=(manufacturer)
270
+ if !manufacturer.nil? && manufacturer.to_s.length > 100
271
+ fail ArgumentError, 'invalid value for "manufacturer", the character length must be smaller than or equal to 100.'
272
+ end
273
+
274
+ @manufacturer = manufacturer
275
+ end
276
+
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] merchant_id Value to be assigned
279
+ def merchant_id=(merchant_id)
280
+ if !merchant_id.nil? && merchant_id.to_s.length > 5
281
+ fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
282
+ end
283
+
284
+ @merchant_id = merchant_id
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] model Value to be assigned
289
+ def model=(model)
290
+ if !model.nil? && model.to_s.length > 100
291
+ fail ArgumentError, 'invalid value for "model", the character length must be smaller than or equal to 100.'
292
+ end
293
+
294
+ @model = model
295
+ end
296
+
297
+ # Custom attribute writer method with validation
298
+ # @param [Object] name Value to be assigned
299
+ def name=(name)
300
+ if !name.nil? && name.to_s.length > 100
301
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
302
+ end
303
+
304
+ @name = name
305
+ end
306
+
307
+ # Custom attribute writer method with validation
308
+ # @param [Object] sip_domain Value to be assigned
309
+ def sip_domain=(sip_domain)
310
+ if !sip_domain.nil? && sip_domain.to_s.length > 200
311
+ fail ArgumentError, 'invalid value for "sip_domain", the character length must be smaller than or equal to 200.'
312
+ end
313
+
314
+ @sip_domain = sip_domain
315
+ end
316
+
317
+ # Custom attribute writer method with validation
318
+ # @param [Object] sip_password Value to be assigned
319
+ def sip_password=(sip_password)
320
+ if !sip_password.nil? && sip_password.to_s.length > 100
321
+ fail ArgumentError, 'invalid value for "sip_password", the character length must be smaller than or equal to 100.'
322
+ end
323
+
324
+ @sip_password = sip_password
325
+ end
326
+
327
+ # Custom attribute writer method with validation
328
+ # @param [Object] sip_username Value to be assigned
329
+ def sip_username=(sip_username)
330
+ if !sip_username.nil? && sip_username.to_s.length > 100
331
+ fail ArgumentError, 'invalid value for "sip_username", the character length must be smaller than or equal to 100.'
332
+ end
333
+
334
+ @sip_username = sip_username
335
+ end
336
+
337
+ # Checks equality by comparing each attribute.
338
+ # @param [Object] Object to be compared
339
+ def ==(o)
340
+ return true if self.equal?(o)
341
+ self.class == o.class &&
342
+ conversation_pbx_hardware_phone_uuid == o.conversation_pbx_hardware_phone_uuid &&
343
+ created_at == o.created_at &&
344
+ description == o.description &&
345
+ mac_address == o.mac_address &&
346
+ manufacturer == o.manufacturer &&
347
+ merchant_id == o.merchant_id &&
348
+ model == o.model &&
349
+ name == o.name &&
350
+ provisioning_url == o.provisioning_url &&
351
+ sip_domain == o.sip_domain &&
352
+ sip_password == o.sip_password &&
353
+ sip_username == o.sip_username &&
354
+ updated_at == o.updated_at
355
+ end
356
+
357
+ # @see the `==` method
358
+ # @param [Object] Object to be compared
359
+ def eql?(o)
360
+ self == o
361
+ end
362
+
363
+ # Calculates hash code according to all attributes.
364
+ # @return [Integer] Hash code
365
+ def hash
366
+ [conversation_pbx_hardware_phone_uuid, created_at, description, mac_address, manufacturer, merchant_id, model, name, provisioning_url, sip_domain, sip_password, sip_username, updated_at].hash
367
+ end
368
+
369
+ # Builds the object from hash
370
+ # @param [Hash] attributes Model attributes in the form of hash
371
+ # @return [Object] Returns the model itself
372
+ def self.build_from_hash(attributes)
373
+ new.build_from_hash(attributes)
374
+ end
375
+
376
+ # Builds the object from hash
377
+ # @param [Hash] attributes Model attributes in the form of hash
378
+ # @return [Object] Returns the model itself
379
+ def build_from_hash(attributes)
380
+ return nil unless attributes.is_a?(Hash)
381
+ attributes = attributes.transform_keys(&:to_sym)
382
+ self.class.openapi_types.each_pair do |key, type|
383
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
384
+ self.send("#{key}=", nil)
385
+ elsif type =~ /\AArray<(.*)>/i
386
+ # check to ensure the input is an array given that the attribute
387
+ # is documented as an array but the input is not
388
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
389
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
390
+ end
391
+ elsif !attributes[self.class.attribute_map[key]].nil?
392
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
393
+ end
394
+ end
395
+
396
+ self
397
+ end
398
+
399
+ # Deserializes the data based on type
400
+ # @param string type Data type
401
+ # @param string value Value to be deserialized
402
+ # @return [Object] Deserialized data
403
+ def _deserialize(type, value)
404
+ case type.to_sym
405
+ when :Time
406
+ Time.parse(value)
407
+ when :Date
408
+ Date.parse(value)
409
+ when :String
410
+ value.to_s
411
+ when :Integer
412
+ value.to_i
413
+ when :Float
414
+ value.to_f
415
+ when :Boolean
416
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
417
+ true
418
+ else
419
+ false
420
+ end
421
+ when :Object
422
+ # generic object (usually a Hash), return directly
423
+ value
424
+ when /\AArray<(?<inner_type>.+)>\z/
425
+ inner_type = Regexp.last_match[:inner_type]
426
+ value.map { |v| _deserialize(inner_type, v) }
427
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
428
+ k_type = Regexp.last_match[:k_type]
429
+ v_type = Regexp.last_match[:v_type]
430
+ {}.tap do |hash|
431
+ value.each do |k, v|
432
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
433
+ end
434
+ end
435
+ else # model
436
+ # models (e.g. Pet) or oneOf
437
+ klass = UltracartClient.const_get(type)
438
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
439
+ end
440
+ end
441
+
442
+ # Returns the string representation of the object
443
+ # @return [String] String presentation of the object
444
+ def to_s
445
+ to_hash.to_s
446
+ end
447
+
448
+ # to_body is an alias to to_hash (backward compatibility)
449
+ # @return [Hash] Returns the object in the form of hash
450
+ def to_body
451
+ to_hash
452
+ end
453
+
454
+ # Returns the object in the form of hash
455
+ # @return [Hash] Returns the object in the form of hash
456
+ def to_hash
457
+ hash = {}
458
+ self.class.attribute_map.each_pair do |attr, param|
459
+ value = self.send(attr)
460
+ if value.nil?
461
+ is_nullable = self.class.openapi_nullable.include?(attr)
462
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
463
+ end
464
+
465
+ hash[param] = _to_hash(value)
466
+ end
467
+ hash
468
+ end
469
+
470
+ # Outputs non-array value in the form of hash
471
+ # For object, use to_hash. Otherwise, just return the value
472
+ # @param [Object] value Any valid value
473
+ # @return [Hash] Returns the value in the form of hash
474
+ def _to_hash(value)
475
+ if value.is_a?(Array)
476
+ value.compact.map { |v| _to_hash(v) }
477
+ elsif value.is_a?(Hash)
478
+ {}.tap do |hash|
479
+ value.each { |k, v| hash[k] = _to_hash(v) }
480
+ end
481
+ elsif value.respond_to? :to_hash
482
+ value.to_hash
483
+ else
484
+ value
485
+ end
486
+ end
487
+
488
+ end
489
+
490
+ end