ultracart_api 4.0.54.rc → 4.0.57.rc

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,6 +24,12 @@ module UltracartClient
24
24
  # CC emails. Multiple allowed, but total length of all emails can not exceed 100 characters.
25
25
  attr_accessor :cc_emails
26
26
 
27
+ # Cell phone
28
+ attr_accessor :cell_phone
29
+
30
+ # Cell phone (E164 format)
31
+ attr_accessor :cell_phone_e164
32
+
27
33
  # City
28
34
  attr_accessor :city
29
35
 
@@ -69,6 +75,8 @@ module UltracartClient
69
75
  :'address1' => :'address1',
70
76
  :'address2' => :'address2',
71
77
  :'cc_emails' => :'cc_emails',
78
+ :'cell_phone' => :'cell_phone',
79
+ :'cell_phone_e164' => :'cell_phone_e164',
72
80
  :'city' => :'city',
73
81
  :'company' => :'company',
74
82
  :'country_code' => :'country_code',
@@ -96,6 +104,8 @@ module UltracartClient
96
104
  :'address1' => :'String',
97
105
  :'address2' => :'String',
98
106
  :'cc_emails' => :'Array<String>',
107
+ :'cell_phone' => :'String',
108
+ :'cell_phone_e164' => :'String',
99
109
  :'city' => :'String',
100
110
  :'company' => :'String',
101
111
  :'country_code' => :'String',
@@ -147,6 +157,14 @@ module UltracartClient
147
157
  end
148
158
  end
149
159
 
160
+ if attributes.key?(:'cell_phone')
161
+ self.cell_phone = attributes[:'cell_phone']
162
+ end
163
+
164
+ if attributes.key?(:'cell_phone_e164')
165
+ self.cell_phone_e164 = attributes[:'cell_phone_e164']
166
+ end
167
+
150
168
  if attributes.key?(:'city')
151
169
  self.city = attributes[:'city']
152
170
  end
@@ -212,6 +230,14 @@ module UltracartClient
212
230
  invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 50.')
213
231
  end
214
232
 
233
+ if !@cell_phone.nil? && @cell_phone.to_s.length > 25
234
+ invalid_properties.push('invalid value for "cell_phone", the character length must be smaller than or equal to 25.')
235
+ end
236
+
237
+ if !@cell_phone_e164.nil? && @cell_phone_e164.to_s.length > 25
238
+ invalid_properties.push('invalid value for "cell_phone_e164", the character length must be smaller than or equal to 25.')
239
+ end
240
+
215
241
  if !@city.nil? && @city.to_s.length > 32
216
242
  invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 32.')
217
243
  end
@@ -272,6 +298,8 @@ module UltracartClient
272
298
  def valid?
273
299
  return false if !@address1.nil? && @address1.to_s.length > 50
274
300
  return false if !@address2.nil? && @address2.to_s.length > 50
301
+ return false if !@cell_phone.nil? && @cell_phone.to_s.length > 25
302
+ return false if !@cell_phone_e164.nil? && @cell_phone_e164.to_s.length > 25
275
303
  return false if !@city.nil? && @city.to_s.length > 32
276
304
  return false if !@company.nil? && @company.to_s.length > 50
277
305
  return false if !@country_code.nil? && @country_code.to_s.length > 2
@@ -308,6 +336,26 @@ module UltracartClient
308
336
  @address2 = address2
309
337
  end
310
338
 
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] cell_phone Value to be assigned
341
+ def cell_phone=(cell_phone)
342
+ if !cell_phone.nil? && cell_phone.to_s.length > 25
343
+ fail ArgumentError, 'invalid value for "cell_phone", the character length must be smaller than or equal to 25.'
344
+ end
345
+
346
+ @cell_phone = cell_phone
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] cell_phone_e164 Value to be assigned
351
+ def cell_phone_e164=(cell_phone_e164)
352
+ if !cell_phone_e164.nil? && cell_phone_e164.to_s.length > 25
353
+ fail ArgumentError, 'invalid value for "cell_phone_e164", the character length must be smaller than or equal to 25.'
354
+ end
355
+
356
+ @cell_phone_e164 = cell_phone_e164
357
+ end
358
+
311
359
  # Custom attribute writer method with validation
312
360
  # @param [Object] city Value to be assigned
313
361
  def city=(city)
@@ -446,6 +494,8 @@ module UltracartClient
446
494
  address1 == o.address1 &&
447
495
  address2 == o.address2 &&
448
496
  cc_emails == o.cc_emails &&
497
+ cell_phone == o.cell_phone &&
498
+ cell_phone_e164 == o.cell_phone_e164 &&
449
499
  city == o.city &&
450
500
  company == o.company &&
451
501
  country_code == o.country_code &&
@@ -470,7 +520,7 @@ module UltracartClient
470
520
  # Calculates hash code according to all attributes.
471
521
  # @return [Integer] Hash code
472
522
  def hash
473
- [address1, address2, cc_emails, city, company, country_code, day_phone, day_phone_e164, email, evening_phone, evening_phone_e164, first_name, last_name, postal_code, state_region, title].hash
523
+ [address1, address2, cc_emails, cell_phone, cell_phone_e164, city, company, country_code, day_phone, day_phone_e164, email, evening_phone, evening_phone_e164, first_name, last_name, postal_code, state_region, title].hash
474
524
  end
475
525
 
476
526
  # Builds the object from hash
@@ -18,6 +18,9 @@ module UltracartClient
18
18
  # Advertising source
19
19
  attr_accessor :advertising_source
20
20
 
21
+ # True if the customer has opted into SMS marketing
22
+ attr_accessor :cell_phone_opt_in
23
+
21
24
  # True if the customer has opted into mailing list subscription
22
25
  attr_accessor :mailing_list
23
26
 
@@ -28,6 +31,7 @@ module UltracartClient
28
31
  def self.attribute_map
29
32
  {
30
33
  :'advertising_source' => :'advertising_source',
34
+ :'cell_phone_opt_in' => :'cell_phone_opt_in',
31
35
  :'mailing_list' => :'mailing_list',
32
36
  :'referral_code' => :'referral_code'
33
37
  }
@@ -42,6 +46,7 @@ module UltracartClient
42
46
  def self.openapi_types
43
47
  {
44
48
  :'advertising_source' => :'String',
49
+ :'cell_phone_opt_in' => :'Boolean',
45
50
  :'mailing_list' => :'Boolean',
46
51
  :'referral_code' => :'String'
47
52
  }
@@ -72,6 +77,10 @@ module UltracartClient
72
77
  self.advertising_source = attributes[:'advertising_source']
73
78
  end
74
79
 
80
+ if attributes.key?(:'cell_phone_opt_in')
81
+ self.cell_phone_opt_in = attributes[:'cell_phone_opt_in']
82
+ end
83
+
75
84
  if attributes.key?(:'mailing_list')
76
85
  self.mailing_list = attributes[:'mailing_list']
77
86
  end
@@ -130,6 +139,7 @@ module UltracartClient
130
139
  return true if self.equal?(o)
131
140
  self.class == o.class &&
132
141
  advertising_source == o.advertising_source &&
142
+ cell_phone_opt_in == o.cell_phone_opt_in &&
133
143
  mailing_list == o.mailing_list &&
134
144
  referral_code == o.referral_code
135
145
  end
@@ -143,7 +153,7 @@ module UltracartClient
143
153
  # Calculates hash code according to all attributes.
144
154
  # @return [Integer] Hash code
145
155
  def hash
146
- [advertising_source, mailing_list, referral_code].hash
156
+ [advertising_source, cell_phone_opt_in, mailing_list, referral_code].hash
147
157
  end
148
158
 
149
159
  # Builds the object from hash
@@ -0,0 +1,309 @@
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 StoreFront
18
+ attr_accessor :host_alias1
19
+
20
+ attr_accessor :host_alias2
21
+
22
+ attr_accessor :host_alias3
23
+
24
+ attr_accessor :host_alias4
25
+
26
+ attr_accessor :host_alias5
27
+
28
+ attr_accessor :host_name
29
+
30
+ attr_accessor :locked
31
+
32
+ attr_accessor :merchant_id
33
+
34
+ attr_accessor :redirect_aliases
35
+
36
+ attr_accessor :storefront_oid
37
+
38
+ attr_accessor :unlock_password
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'host_alias1' => :'host_alias1',
44
+ :'host_alias2' => :'host_alias2',
45
+ :'host_alias3' => :'host_alias3',
46
+ :'host_alias4' => :'host_alias4',
47
+ :'host_alias5' => :'host_alias5',
48
+ :'host_name' => :'host_name',
49
+ :'locked' => :'locked',
50
+ :'merchant_id' => :'merchant_id',
51
+ :'redirect_aliases' => :'redirect_aliases',
52
+ :'storefront_oid' => :'storefront_oid',
53
+ :'unlock_password' => :'unlock_password'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'host_alias1' => :'String',
66
+ :'host_alias2' => :'String',
67
+ :'host_alias3' => :'String',
68
+ :'host_alias4' => :'String',
69
+ :'host_alias5' => :'String',
70
+ :'host_name' => :'String',
71
+ :'locked' => :'Boolean',
72
+ :'merchant_id' => :'String',
73
+ :'redirect_aliases' => :'Boolean',
74
+ :'storefront_oid' => :'Integer',
75
+ :'unlock_password' => :'String'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::StoreFront` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::StoreFront`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'host_alias1')
101
+ self.host_alias1 = attributes[:'host_alias1']
102
+ end
103
+
104
+ if attributes.key?(:'host_alias2')
105
+ self.host_alias2 = attributes[:'host_alias2']
106
+ end
107
+
108
+ if attributes.key?(:'host_alias3')
109
+ self.host_alias3 = attributes[:'host_alias3']
110
+ end
111
+
112
+ if attributes.key?(:'host_alias4')
113
+ self.host_alias4 = attributes[:'host_alias4']
114
+ end
115
+
116
+ if attributes.key?(:'host_alias5')
117
+ self.host_alias5 = attributes[:'host_alias5']
118
+ end
119
+
120
+ if attributes.key?(:'host_name')
121
+ self.host_name = attributes[:'host_name']
122
+ end
123
+
124
+ if attributes.key?(:'locked')
125
+ self.locked = attributes[:'locked']
126
+ end
127
+
128
+ if attributes.key?(:'merchant_id')
129
+ self.merchant_id = attributes[:'merchant_id']
130
+ end
131
+
132
+ if attributes.key?(:'redirect_aliases')
133
+ self.redirect_aliases = attributes[:'redirect_aliases']
134
+ end
135
+
136
+ if attributes.key?(:'storefront_oid')
137
+ self.storefront_oid = attributes[:'storefront_oid']
138
+ end
139
+
140
+ if attributes.key?(:'unlock_password')
141
+ self.unlock_password = attributes[:'unlock_password']
142
+ end
143
+ end
144
+
145
+ # Show invalid properties with the reasons. Usually used together with valid?
146
+ # @return Array for valid properties with the reasons
147
+ def list_invalid_properties
148
+ invalid_properties = Array.new
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ true
156
+ end
157
+
158
+ # Checks equality by comparing each attribute.
159
+ # @param [Object] Object to be compared
160
+ def ==(o)
161
+ return true if self.equal?(o)
162
+ self.class == o.class &&
163
+ host_alias1 == o.host_alias1 &&
164
+ host_alias2 == o.host_alias2 &&
165
+ host_alias3 == o.host_alias3 &&
166
+ host_alias4 == o.host_alias4 &&
167
+ host_alias5 == o.host_alias5 &&
168
+ host_name == o.host_name &&
169
+ locked == o.locked &&
170
+ merchant_id == o.merchant_id &&
171
+ redirect_aliases == o.redirect_aliases &&
172
+ storefront_oid == o.storefront_oid &&
173
+ unlock_password == o.unlock_password
174
+ end
175
+
176
+ # @see the `==` method
177
+ # @param [Object] Object to be compared
178
+ def eql?(o)
179
+ self == o
180
+ end
181
+
182
+ # Calculates hash code according to all attributes.
183
+ # @return [Integer] Hash code
184
+ def hash
185
+ [host_alias1, host_alias2, host_alias3, host_alias4, host_alias5, host_name, locked, merchant_id, redirect_aliases, storefront_oid, unlock_password].hash
186
+ end
187
+
188
+ # Builds the object from hash
189
+ # @param [Hash] attributes Model attributes in the form of hash
190
+ # @return [Object] Returns the model itself
191
+ def self.build_from_hash(attributes)
192
+ new.build_from_hash(attributes)
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def build_from_hash(attributes)
199
+ return nil unless attributes.is_a?(Hash)
200
+ attributes = attributes.transform_keys(&:to_sym)
201
+ self.class.openapi_types.each_pair do |key, type|
202
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
203
+ self.send("#{key}=", nil)
204
+ elsif type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
208
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
209
+ end
210
+ elsif !attributes[self.class.attribute_map[key]].nil?
211
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
212
+ end
213
+ end
214
+
215
+ self
216
+ end
217
+
218
+ # Deserializes the data based on type
219
+ # @param string type Data type
220
+ # @param string value Value to be deserialized
221
+ # @return [Object] Deserialized data
222
+ def _deserialize(type, value)
223
+ case type.to_sym
224
+ when :Time
225
+ Time.parse(value)
226
+ when :Date
227
+ Date.parse(value)
228
+ when :String
229
+ value.to_s
230
+ when :Integer
231
+ value.to_i
232
+ when :Float
233
+ value.to_f
234
+ when :Boolean
235
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
236
+ true
237
+ else
238
+ false
239
+ end
240
+ when :Object
241
+ # generic object (usually a Hash), return directly
242
+ value
243
+ when /\AArray<(?<inner_type>.+)>\z/
244
+ inner_type = Regexp.last_match[:inner_type]
245
+ value.map { |v| _deserialize(inner_type, v) }
246
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
247
+ k_type = Regexp.last_match[:k_type]
248
+ v_type = Regexp.last_match[:v_type]
249
+ {}.tap do |hash|
250
+ value.each do |k, v|
251
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
252
+ end
253
+ end
254
+ else # model
255
+ # models (e.g. Pet) or oneOf
256
+ klass = UltracartClient.const_get(type)
257
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+
307
+ end
308
+
309
+ end