ultracart_api 3.10.36 → 3.10.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -4
- data/docs/CartMarketing.md +1 -0
- data/docs/ConversationParticipant.md +1 -0
- data/docs/ConversationWebchatQueueStatusAgent.md +2 -1
- data/docs/CustomerApi.md +54 -0
- data/docs/CustomerMagicLinkResponse.md +12 -0
- data/docs/OrderBilling.md +2 -0
- data/docs/OrderMarketing.md +1 -0
- data/docs/StoreFront.md +18 -0
- data/docs/StoreFrontsResponse.md +12 -0
- data/docs/StorefrontApi.md +44 -0
- data/lib/ultracart_api/api/customer_api.rb +61 -0
- data/lib/ultracart_api/api/storefront_api.rb +47 -0
- data/lib/ultracart_api/models/cart_marketing.rb +11 -1
- data/lib/ultracart_api/models/conversation_participant.rb +10 -1
- data/lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb +49 -4
- data/lib/ultracart_api/models/customer_magic_link_response.rb +222 -0
- data/lib/ultracart_api/models/order_billing.rb +51 -1
- data/lib/ultracart_api/models/order_marketing.rb +11 -1
- data/lib/ultracart_api/models/store_front.rb +274 -0
- data/lib/ultracart_api/models/store_fronts_response.rb +223 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +3 -0
- metadata +8 -2
@@ -0,0 +1,222 @@
|
|
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 CustomerMagicLinkResponse
|
17
|
+
attr_accessor :error
|
18
|
+
|
19
|
+
attr_accessor :metadata
|
20
|
+
|
21
|
+
# Indicates if API call was successful
|
22
|
+
attr_accessor :success
|
23
|
+
|
24
|
+
# URL
|
25
|
+
attr_accessor :url
|
26
|
+
|
27
|
+
attr_accessor :warning
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'error' => :'error',
|
33
|
+
:'metadata' => :'metadata',
|
34
|
+
:'success' => :'success',
|
35
|
+
:'url' => :'url',
|
36
|
+
:'warning' => :'warning'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
:'error' => :'Error',
|
44
|
+
:'metadata' => :'ResponseMetadata',
|
45
|
+
:'success' => :'BOOLEAN',
|
46
|
+
:'url' => :'String',
|
47
|
+
:'warning' => :'Warning'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
return unless attributes.is_a?(Hash)
|
55
|
+
|
56
|
+
# convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
58
|
+
|
59
|
+
if attributes.has_key?(:'error')
|
60
|
+
self.error = attributes[:'error']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.has_key?(:'metadata')
|
64
|
+
self.metadata = attributes[:'metadata']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'success')
|
68
|
+
self.success = attributes[:'success']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'url')
|
72
|
+
self.url = attributes[:'url']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'warning')
|
76
|
+
self.warning = attributes[:'warning']
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
81
|
+
# @return Array for valid properties with the reasons
|
82
|
+
def list_invalid_properties
|
83
|
+
invalid_properties = Array.new
|
84
|
+
invalid_properties
|
85
|
+
end
|
86
|
+
|
87
|
+
# Check to see if the all the properties in the model are valid
|
88
|
+
# @return true if the model is valid
|
89
|
+
def valid?
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Checks equality by comparing each attribute.
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def ==(o)
|
96
|
+
return true if self.equal?(o)
|
97
|
+
self.class == o.class &&
|
98
|
+
error == o.error &&
|
99
|
+
metadata == o.metadata &&
|
100
|
+
success == o.success &&
|
101
|
+
url == o.url &&
|
102
|
+
warning == o.warning
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Fixnum] Hash code
|
113
|
+
def hash
|
114
|
+
[error, metadata, success, url, warning].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.swagger_types.each_pair do |key, type|
|
123
|
+
if type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :DateTime
|
144
|
+
DateTime.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :BOOLEAN
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
temp_model = UltracartClient.const_get(type).new
|
175
|
+
temp_model.build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
next if value.nil?
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
end
|
@@ -23,6 +23,12 @@ module UltracartClient
|
|
23
23
|
# CC emails. Multiple allowed, but total length of all emails can not exceed 100 characters.
|
24
24
|
attr_accessor :cc_emails
|
25
25
|
|
26
|
+
# Cell phone
|
27
|
+
attr_accessor :cell_phone
|
28
|
+
|
29
|
+
# Cell phone (E164 format)
|
30
|
+
attr_accessor :cell_phone_e164
|
31
|
+
|
26
32
|
# City
|
27
33
|
attr_accessor :city
|
28
34
|
|
@@ -68,6 +74,8 @@ module UltracartClient
|
|
68
74
|
:'address1' => :'address1',
|
69
75
|
:'address2' => :'address2',
|
70
76
|
:'cc_emails' => :'cc_emails',
|
77
|
+
:'cell_phone' => :'cell_phone',
|
78
|
+
:'cell_phone_e164' => :'cell_phone_e164',
|
71
79
|
:'city' => :'city',
|
72
80
|
:'company' => :'company',
|
73
81
|
:'country_code' => :'country_code',
|
@@ -90,6 +98,8 @@ module UltracartClient
|
|
90
98
|
:'address1' => :'String',
|
91
99
|
:'address2' => :'String',
|
92
100
|
:'cc_emails' => :'Array<String>',
|
101
|
+
:'cell_phone' => :'String',
|
102
|
+
:'cell_phone_e164' => :'String',
|
93
103
|
:'city' => :'String',
|
94
104
|
:'company' => :'String',
|
95
105
|
:'country_code' => :'String',
|
@@ -128,6 +138,14 @@ module UltracartClient
|
|
128
138
|
end
|
129
139
|
end
|
130
140
|
|
141
|
+
if attributes.has_key?(:'cell_phone')
|
142
|
+
self.cell_phone = attributes[:'cell_phone']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'cell_phone_e164')
|
146
|
+
self.cell_phone_e164 = attributes[:'cell_phone_e164']
|
147
|
+
end
|
148
|
+
|
131
149
|
if attributes.has_key?(:'city')
|
132
150
|
self.city = attributes[:'city']
|
133
151
|
end
|
@@ -193,6 +211,14 @@ module UltracartClient
|
|
193
211
|
invalid_properties.push('invalid value for "address2", the character length must be smaller than or equal to 50.')
|
194
212
|
end
|
195
213
|
|
214
|
+
if !@cell_phone.nil? && @cell_phone.to_s.length > 25
|
215
|
+
invalid_properties.push('invalid value for "cell_phone", the character length must be smaller than or equal to 25.')
|
216
|
+
end
|
217
|
+
|
218
|
+
if !@cell_phone_e164.nil? && @cell_phone_e164.to_s.length > 25
|
219
|
+
invalid_properties.push('invalid value for "cell_phone_e164", the character length must be smaller than or equal to 25.')
|
220
|
+
end
|
221
|
+
|
196
222
|
if !@city.nil? && @city.to_s.length > 32
|
197
223
|
invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 32.')
|
198
224
|
end
|
@@ -253,6 +279,8 @@ module UltracartClient
|
|
253
279
|
def valid?
|
254
280
|
return false if !@address1.nil? && @address1.to_s.length > 50
|
255
281
|
return false if !@address2.nil? && @address2.to_s.length > 50
|
282
|
+
return false if !@cell_phone.nil? && @cell_phone.to_s.length > 25
|
283
|
+
return false if !@cell_phone_e164.nil? && @cell_phone_e164.to_s.length > 25
|
256
284
|
return false if !@city.nil? && @city.to_s.length > 32
|
257
285
|
return false if !@company.nil? && @company.to_s.length > 50
|
258
286
|
return false if !@country_code.nil? && @country_code.to_s.length > 2
|
@@ -289,6 +317,26 @@ module UltracartClient
|
|
289
317
|
@address2 = address2
|
290
318
|
end
|
291
319
|
|
320
|
+
# Custom attribute writer method with validation
|
321
|
+
# @param [Object] cell_phone Value to be assigned
|
322
|
+
def cell_phone=(cell_phone)
|
323
|
+
if !cell_phone.nil? && cell_phone.to_s.length > 25
|
324
|
+
fail ArgumentError, 'invalid value for "cell_phone", the character length must be smaller than or equal to 25.'
|
325
|
+
end
|
326
|
+
|
327
|
+
@cell_phone = cell_phone
|
328
|
+
end
|
329
|
+
|
330
|
+
# Custom attribute writer method with validation
|
331
|
+
# @param [Object] cell_phone_e164 Value to be assigned
|
332
|
+
def cell_phone_e164=(cell_phone_e164)
|
333
|
+
if !cell_phone_e164.nil? && cell_phone_e164.to_s.length > 25
|
334
|
+
fail ArgumentError, 'invalid value for "cell_phone_e164", the character length must be smaller than or equal to 25.'
|
335
|
+
end
|
336
|
+
|
337
|
+
@cell_phone_e164 = cell_phone_e164
|
338
|
+
end
|
339
|
+
|
292
340
|
# Custom attribute writer method with validation
|
293
341
|
# @param [Object] city Value to be assigned
|
294
342
|
def city=(city)
|
@@ -427,6 +475,8 @@ module UltracartClient
|
|
427
475
|
address1 == o.address1 &&
|
428
476
|
address2 == o.address2 &&
|
429
477
|
cc_emails == o.cc_emails &&
|
478
|
+
cell_phone == o.cell_phone &&
|
479
|
+
cell_phone_e164 == o.cell_phone_e164 &&
|
430
480
|
city == o.city &&
|
431
481
|
company == o.company &&
|
432
482
|
country_code == o.country_code &&
|
@@ -451,7 +501,7 @@ module UltracartClient
|
|
451
501
|
# Calculates hash code according to all attributes.
|
452
502
|
# @return [Fixnum] Hash code
|
453
503
|
def hash
|
454
|
-
[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
|
504
|
+
[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
|
455
505
|
end
|
456
506
|
|
457
507
|
# Builds the object from hash
|
@@ -17,6 +17,9 @@ module UltracartClient
|
|
17
17
|
# Advertising source
|
18
18
|
attr_accessor :advertising_source
|
19
19
|
|
20
|
+
# True if the customer has opted into SMS marketing
|
21
|
+
attr_accessor :cell_phone_opt_in
|
22
|
+
|
20
23
|
# True if the customer has opted into mailing list subscription
|
21
24
|
attr_accessor :mailing_list
|
22
25
|
|
@@ -27,6 +30,7 @@ module UltracartClient
|
|
27
30
|
def self.attribute_map
|
28
31
|
{
|
29
32
|
:'advertising_source' => :'advertising_source',
|
33
|
+
:'cell_phone_opt_in' => :'cell_phone_opt_in',
|
30
34
|
:'mailing_list' => :'mailing_list',
|
31
35
|
:'referral_code' => :'referral_code'
|
32
36
|
}
|
@@ -36,6 +40,7 @@ module UltracartClient
|
|
36
40
|
def self.swagger_types
|
37
41
|
{
|
38
42
|
:'advertising_source' => :'String',
|
43
|
+
:'cell_phone_opt_in' => :'BOOLEAN',
|
39
44
|
:'mailing_list' => :'BOOLEAN',
|
40
45
|
:'referral_code' => :'String'
|
41
46
|
}
|
@@ -53,6 +58,10 @@ module UltracartClient
|
|
53
58
|
self.advertising_source = attributes[:'advertising_source']
|
54
59
|
end
|
55
60
|
|
61
|
+
if attributes.has_key?(:'cell_phone_opt_in')
|
62
|
+
self.cell_phone_opt_in = attributes[:'cell_phone_opt_in']
|
63
|
+
end
|
64
|
+
|
56
65
|
if attributes.has_key?(:'mailing_list')
|
57
66
|
self.mailing_list = attributes[:'mailing_list']
|
58
67
|
end
|
@@ -111,6 +120,7 @@ module UltracartClient
|
|
111
120
|
return true if self.equal?(o)
|
112
121
|
self.class == o.class &&
|
113
122
|
advertising_source == o.advertising_source &&
|
123
|
+
cell_phone_opt_in == o.cell_phone_opt_in &&
|
114
124
|
mailing_list == o.mailing_list &&
|
115
125
|
referral_code == o.referral_code
|
116
126
|
end
|
@@ -124,7 +134,7 @@ module UltracartClient
|
|
124
134
|
# Calculates hash code according to all attributes.
|
125
135
|
# @return [Fixnum] Hash code
|
126
136
|
def hash
|
127
|
-
[advertising_source, mailing_list, referral_code].hash
|
137
|
+
[advertising_source, cell_phone_opt_in, mailing_list, referral_code].hash
|
128
138
|
end
|
129
139
|
|
130
140
|
# Builds the object from hash
|
@@ -0,0 +1,274 @@
|
|
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 StoreFront
|
17
|
+
attr_accessor :host_alias1
|
18
|
+
|
19
|
+
attr_accessor :host_alias2
|
20
|
+
|
21
|
+
attr_accessor :host_alias3
|
22
|
+
|
23
|
+
attr_accessor :host_alias4
|
24
|
+
|
25
|
+
attr_accessor :host_alias5
|
26
|
+
|
27
|
+
attr_accessor :host_name
|
28
|
+
|
29
|
+
attr_accessor :locked
|
30
|
+
|
31
|
+
attr_accessor :merchant_id
|
32
|
+
|
33
|
+
attr_accessor :redirect_aliases
|
34
|
+
|
35
|
+
attr_accessor :storefront_oid
|
36
|
+
|
37
|
+
attr_accessor :unlock_password
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'host_alias1' => :'host_alias1',
|
43
|
+
:'host_alias2' => :'host_alias2',
|
44
|
+
:'host_alias3' => :'host_alias3',
|
45
|
+
:'host_alias4' => :'host_alias4',
|
46
|
+
:'host_alias5' => :'host_alias5',
|
47
|
+
:'host_name' => :'host_name',
|
48
|
+
:'locked' => :'locked',
|
49
|
+
:'merchant_id' => :'merchant_id',
|
50
|
+
:'redirect_aliases' => :'redirect_aliases',
|
51
|
+
:'storefront_oid' => :'storefront_oid',
|
52
|
+
:'unlock_password' => :'unlock_password'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute type mapping.
|
57
|
+
def self.swagger_types
|
58
|
+
{
|
59
|
+
:'host_alias1' => :'String',
|
60
|
+
:'host_alias2' => :'String',
|
61
|
+
:'host_alias3' => :'String',
|
62
|
+
:'host_alias4' => :'String',
|
63
|
+
:'host_alias5' => :'String',
|
64
|
+
:'host_name' => :'String',
|
65
|
+
:'locked' => :'BOOLEAN',
|
66
|
+
:'merchant_id' => :'String',
|
67
|
+
:'redirect_aliases' => :'BOOLEAN',
|
68
|
+
:'storefront_oid' => :'Integer',
|
69
|
+
:'unlock_password' => :'String'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
return unless attributes.is_a?(Hash)
|
77
|
+
|
78
|
+
# convert string to symbol for hash key
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
80
|
+
|
81
|
+
if attributes.has_key?(:'host_alias1')
|
82
|
+
self.host_alias1 = attributes[:'host_alias1']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.has_key?(:'host_alias2')
|
86
|
+
self.host_alias2 = attributes[:'host_alias2']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'host_alias3')
|
90
|
+
self.host_alias3 = attributes[:'host_alias3']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.has_key?(:'host_alias4')
|
94
|
+
self.host_alias4 = attributes[:'host_alias4']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.has_key?(:'host_alias5')
|
98
|
+
self.host_alias5 = attributes[:'host_alias5']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'host_name')
|
102
|
+
self.host_name = attributes[:'host_name']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'locked')
|
106
|
+
self.locked = attributes[:'locked']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'merchant_id')
|
110
|
+
self.merchant_id = attributes[:'merchant_id']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'redirect_aliases')
|
114
|
+
self.redirect_aliases = attributes[:'redirect_aliases']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'storefront_oid')
|
118
|
+
self.storefront_oid = attributes[:'storefront_oid']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'unlock_password')
|
122
|
+
self.unlock_password = attributes[:'unlock_password']
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
127
|
+
# @return Array for valid properties with the reasons
|
128
|
+
def list_invalid_properties
|
129
|
+
invalid_properties = Array.new
|
130
|
+
invalid_properties
|
131
|
+
end
|
132
|
+
|
133
|
+
# Check to see if the all the properties in the model are valid
|
134
|
+
# @return true if the model is valid
|
135
|
+
def valid?
|
136
|
+
true
|
137
|
+
end
|
138
|
+
|
139
|
+
# Checks equality by comparing each attribute.
|
140
|
+
# @param [Object] Object to be compared
|
141
|
+
def ==(o)
|
142
|
+
return true if self.equal?(o)
|
143
|
+
self.class == o.class &&
|
144
|
+
host_alias1 == o.host_alias1 &&
|
145
|
+
host_alias2 == o.host_alias2 &&
|
146
|
+
host_alias3 == o.host_alias3 &&
|
147
|
+
host_alias4 == o.host_alias4 &&
|
148
|
+
host_alias5 == o.host_alias5 &&
|
149
|
+
host_name == o.host_name &&
|
150
|
+
locked == o.locked &&
|
151
|
+
merchant_id == o.merchant_id &&
|
152
|
+
redirect_aliases == o.redirect_aliases &&
|
153
|
+
storefront_oid == o.storefront_oid &&
|
154
|
+
unlock_password == o.unlock_password
|
155
|
+
end
|
156
|
+
|
157
|
+
# @see the `==` method
|
158
|
+
# @param [Object] Object to be compared
|
159
|
+
def eql?(o)
|
160
|
+
self == o
|
161
|
+
end
|
162
|
+
|
163
|
+
# Calculates hash code according to all attributes.
|
164
|
+
# @return [Fixnum] Hash code
|
165
|
+
def hash
|
166
|
+
[host_alias1, host_alias2, host_alias3, host_alias4, host_alias5, host_name, locked, merchant_id, redirect_aliases, storefront_oid, unlock_password].hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Builds the object from hash
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
# @return [Object] Returns the model itself
|
172
|
+
def build_from_hash(attributes)
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
174
|
+
self.class.swagger_types.each_pair do |key, type|
|
175
|
+
if type =~ /\AArray<(.*)>/i
|
176
|
+
# check to ensure the input is an array given that the attribute
|
177
|
+
# is documented as an array but the input is not
|
178
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
180
|
+
end
|
181
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
182
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
183
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
184
|
+
end
|
185
|
+
|
186
|
+
self
|
187
|
+
end
|
188
|
+
|
189
|
+
# Deserializes the data based on type
|
190
|
+
# @param string type Data type
|
191
|
+
# @param string value Value to be deserialized
|
192
|
+
# @return [Object] Deserialized data
|
193
|
+
def _deserialize(type, value)
|
194
|
+
case type.to_sym
|
195
|
+
when :DateTime
|
196
|
+
DateTime.parse(value)
|
197
|
+
when :Date
|
198
|
+
Date.parse(value)
|
199
|
+
when :String
|
200
|
+
value.to_s
|
201
|
+
when :Integer
|
202
|
+
value.to_i
|
203
|
+
when :Float
|
204
|
+
value.to_f
|
205
|
+
when :BOOLEAN
|
206
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
207
|
+
true
|
208
|
+
else
|
209
|
+
false
|
210
|
+
end
|
211
|
+
when :Object
|
212
|
+
# generic object (usually a Hash), return directly
|
213
|
+
value
|
214
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
215
|
+
inner_type = Regexp.last_match[:inner_type]
|
216
|
+
value.map { |v| _deserialize(inner_type, v) }
|
217
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
218
|
+
k_type = Regexp.last_match[:k_type]
|
219
|
+
v_type = Regexp.last_match[:v_type]
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each do |k, v|
|
222
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
else # model
|
226
|
+
temp_model = UltracartClient.const_get(type).new
|
227
|
+
temp_model.build_from_hash(value)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
# Returns the string representation of the object
|
232
|
+
# @return [String] String presentation of the object
|
233
|
+
def to_s
|
234
|
+
to_hash.to_s
|
235
|
+
end
|
236
|
+
|
237
|
+
# to_body is an alias to to_hash (backward compatibility)
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_body
|
240
|
+
to_hash
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the object in the form of hash
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_hash
|
246
|
+
hash = {}
|
247
|
+
self.class.attribute_map.each_pair do |attr, param|
|
248
|
+
value = self.send(attr)
|
249
|
+
next if value.nil?
|
250
|
+
hash[param] = _to_hash(value)
|
251
|
+
end
|
252
|
+
hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Outputs non-array value in the form of hash
|
256
|
+
# For object, use to_hash. Otherwise, just return the value
|
257
|
+
# @param [Object] value Any valid value
|
258
|
+
# @return [Hash] Returns the value in the form of hash
|
259
|
+
def _to_hash(value)
|
260
|
+
if value.is_a?(Array)
|
261
|
+
value.compact.map { |v| _to_hash(v) }
|
262
|
+
elsif value.is_a?(Hash)
|
263
|
+
{}.tap do |hash|
|
264
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
265
|
+
end
|
266
|
+
elsif value.respond_to? :to_hash
|
267
|
+
value.to_hash
|
268
|
+
else
|
269
|
+
value
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
end
|
274
|
+
end
|