ultracart_api 3.3.1 → 3.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -4
- data/docs/ConfigurationApi.md +756 -0
- data/docs/DelayAutoOrdersResponse.md +12 -0
- data/docs/IntegrationLogApi.md +51 -0
- data/docs/IntegrationLogSummary.md +16 -0
- data/docs/IntegrationLogSummaryQueryRequest.md +9 -0
- data/docs/IntegrationLogSummaryQueryResponse.md +12 -0
- data/docs/PaymentsConfiguration.md +23 -0
- data/docs/PaymentsConfigurationAffirm.md +15 -0
- data/docs/PaymentsConfigurationAmazon.md +15 -0
- data/docs/PaymentsConfigurationCOD.md +13 -0
- data/docs/PaymentsConfigurationCash.md +9 -0
- data/docs/PaymentsConfigurationCheck.md +25 -0
- data/docs/PaymentsConfigurationCreditCard.md +16 -0
- data/docs/PaymentsConfigurationLoanHero.md +12 -0
- data/docs/PaymentsConfigurationPayPal.md +36 -0
- data/docs/PaymentsConfigurationPurchaseOrder.md +11 -0
- data/docs/PaymentsConfigurationQuoteRequest.md +10 -0
- data/docs/PaymentsConfigurationResponse.md +12 -0
- data/docs/PaymentsConfigurationRestrictions.md +19 -0
- data/docs/PaymentsConfigurationSezzle.md +15 -0
- data/docs/PaymentsConfigurationWePay.md +35 -0
- data/docs/PaymentsConfigurationWireTransfer.md +18 -0
- data/docs/PaymentsThemeTransactionType.md +10 -0
- data/docs/PaymentsWepayEnroll.md +22 -0
- data/docs/RotatingTransactionGateway.md +50 -0
- data/docs/RotatingTransactionGatewayResponse.md +12 -0
- data/docs/RotatingTransactionGatewaysResponse.md +12 -0
- data/docs/RtgCurrency.md +10 -0
- data/docs/RtgDayOfMonthRestriction.md +9 -0
- data/docs/RtgDayOfWeekRestriction.md +10 -0
- data/docs/RtgSummaryGateway.md +24 -0
- data/docs/RtgSummaryResponse.md +14 -0
- data/docs/RtgThemeRestriction.md +10 -0
- data/docs/SingleSignOnAuthorizeResponse.md +9 -0
- data/docs/SingleSignOnTokenResponse.md +10 -0
- data/docs/SsoApi.md +4 -4
- data/docs/StripeConnectResponse.md +12 -0
- data/docs/TransactionGateway.md +71 -0
- data/docs/TransactionGatewaysRequest.md +10 -0
- data/docs/TransactionGatewaysResponse.md +12 -0
- data/lib/ultracart_api.rb +38 -0
- data/lib/ultracart_api/api/configuration_api.rb +843 -0
- data/lib/ultracart_api/api/integration_log_api.rb +55 -0
- data/lib/ultracart_api/api/sso_api.rb +6 -6
- data/lib/ultracart_api/models/delay_auto_orders_response.rb +221 -0
- data/lib/ultracart_api/models/integration_log_summary.rb +256 -0
- data/lib/ultracart_api/models/integration_log_summary_query_request.rb +195 -0
- data/lib/ultracart_api/models/integration_log_summary_query_response.rb +223 -0
- data/lib/ultracart_api/models/payments_configuration.rb +319 -0
- data/lib/ultracart_api/models/payments_configuration_affirm.rb +247 -0
- data/lib/ultracart_api/models/payments_configuration_amazon.rb +247 -0
- data/lib/ultracart_api/models/payments_configuration_cash.rb +193 -0
- data/lib/ultracart_api/models/payments_configuration_check.rb +337 -0
- data/lib/ultracart_api/models/payments_configuration_cod.rb +229 -0
- data/lib/ultracart_api/models/payments_configuration_credit_card.rb +256 -0
- data/lib/ultracart_api/models/payments_configuration_loan_hero.rb +220 -0
- data/lib/ultracart_api/models/payments_configuration_pay_pal.rb +436 -0
- data/lib/ultracart_api/models/payments_configuration_purchase_order.rb +211 -0
- data/lib/ultracart_api/models/payments_configuration_quote_request.rb +202 -0
- data/lib/ultracart_api/models/payments_configuration_response.rb +221 -0
- data/lib/ultracart_api/models/payments_configuration_restrictions.rb +283 -0
- data/lib/ultracart_api/models/payments_configuration_sezzle.rb +247 -0
- data/lib/ultracart_api/models/payments_configuration_we_pay.rb +427 -0
- data/lib/ultracart_api/models/payments_configuration_wire_transfer.rb +274 -0
- data/lib/ultracart_api/models/payments_theme_transaction_type.rb +239 -0
- data/lib/ultracart_api/models/payments_wepay_enroll.rb +310 -0
- data/lib/ultracart_api/models/rotating_transaction_gateway.rb +665 -0
- data/lib/ultracart_api/models/rotating_transaction_gateway_response.rb +221 -0
- data/lib/ultracart_api/models/rotating_transaction_gateways_response.rb +223 -0
- data/lib/ultracart_api/models/rtg_currency.rb +205 -0
- data/lib/ultracart_api/models/rtg_day_of_month_restriction.rb +195 -0
- data/lib/ultracart_api/models/rtg_day_of_week_restriction.rb +205 -0
- data/lib/ultracart_api/models/rtg_summary_gateway.rb +329 -0
- data/lib/ultracart_api/models/rtg_summary_response.rb +240 -0
- data/lib/ultracart_api/models/rtg_theme_restriction.rb +239 -0
- data/lib/ultracart_api/models/single_sign_on_authorize_response.rb +195 -0
- data/lib/ultracart_api/models/single_sign_on_token_response.rb +205 -0
- data/lib/ultracart_api/models/stripe_connect_response.rb +221 -0
- data/lib/ultracart_api/models/transaction_gateway.rb +823 -0
- data/lib/ultracart_api/models/transaction_gateways_request.rb +242 -0
- data/lib/ultracart_api/models/transaction_gateways_response.rb +223 -0
- data/lib/ultracart_api/version.rb +1 -1
- metadata +78 -2
@@ -0,0 +1,239 @@
|
|
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 PaymentsThemeTransactionType
|
17
|
+
# External human readable identifier for a theme
|
18
|
+
attr_accessor :code
|
19
|
+
|
20
|
+
# The credit card transaction type for this theme
|
21
|
+
attr_accessor :credit_card_transaction_type
|
22
|
+
|
23
|
+
# Internal identifier for a theme
|
24
|
+
attr_accessor :screen_branding_theme_oid
|
25
|
+
|
26
|
+
class EnumAttributeValidator
|
27
|
+
attr_reader :datatype
|
28
|
+
attr_reader :allowable_values
|
29
|
+
|
30
|
+
def initialize(datatype, allowable_values)
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
32
|
+
case datatype.to_s
|
33
|
+
when /Integer/i
|
34
|
+
value.to_i
|
35
|
+
when /Float/i
|
36
|
+
value.to_f
|
37
|
+
else
|
38
|
+
value
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def valid?(value)
|
44
|
+
!value || allowable_values.include?(value)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
+
def self.attribute_map
|
50
|
+
{
|
51
|
+
:'code' => :'code',
|
52
|
+
:'credit_card_transaction_type' => :'credit_card_transaction_type',
|
53
|
+
:'screen_branding_theme_oid' => :'screen_branding_theme_oid'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute type mapping.
|
58
|
+
def self.swagger_types
|
59
|
+
{
|
60
|
+
:'code' => :'String',
|
61
|
+
:'credit_card_transaction_type' => :'String',
|
62
|
+
:'screen_branding_theme_oid' => :'Integer'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
68
|
+
def initialize(attributes = {})
|
69
|
+
return unless attributes.is_a?(Hash)
|
70
|
+
|
71
|
+
# convert string to symbol for hash key
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
73
|
+
|
74
|
+
if attributes.has_key?(:'code')
|
75
|
+
self.code = attributes[:'code']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.has_key?(:'credit_card_transaction_type')
|
79
|
+
self.credit_card_transaction_type = attributes[:'credit_card_transaction_type']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.has_key?(:'screen_branding_theme_oid')
|
83
|
+
self.screen_branding_theme_oid = attributes[:'screen_branding_theme_oid']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
invalid_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
credit_card_transaction_type_validator = EnumAttributeValidator.new('String', ['auth and capture', 'auth then capture', 'auth only'])
|
98
|
+
return false unless credit_card_transaction_type_validator.valid?(@credit_card_transaction_type)
|
99
|
+
true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Custom attribute writer method checking allowed values (enum).
|
103
|
+
# @param [Object] credit_card_transaction_type Object to be assigned
|
104
|
+
def credit_card_transaction_type=(credit_card_transaction_type)
|
105
|
+
validator = EnumAttributeValidator.new('String', ['auth and capture', 'auth then capture', 'auth only'])
|
106
|
+
unless validator.valid?(credit_card_transaction_type)
|
107
|
+
fail ArgumentError, 'invalid value for "credit_card_transaction_type", must be one of #{validator.allowable_values}.'
|
108
|
+
end
|
109
|
+
@credit_card_transaction_type = credit_card_transaction_type
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def ==(o)
|
115
|
+
return true if self.equal?(o)
|
116
|
+
self.class == o.class &&
|
117
|
+
code == o.code &&
|
118
|
+
credit_card_transaction_type == o.credit_card_transaction_type &&
|
119
|
+
screen_branding_theme_oid == o.screen_branding_theme_oid
|
120
|
+
end
|
121
|
+
|
122
|
+
# @see the `==` method
|
123
|
+
# @param [Object] Object to be compared
|
124
|
+
def eql?(o)
|
125
|
+
self == o
|
126
|
+
end
|
127
|
+
|
128
|
+
# Calculates hash code according to all attributes.
|
129
|
+
# @return [Fixnum] Hash code
|
130
|
+
def hash
|
131
|
+
[code, credit_card_transaction_type, screen_branding_theme_oid].hash
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
self.class.swagger_types.each_pair do |key, type|
|
140
|
+
if type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :DateTime
|
161
|
+
DateTime.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :BOOLEAN
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
temp_model = UltracartClient.const_get(type).new
|
192
|
+
temp_model.build_from_hash(value)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns the string representation of the object
|
197
|
+
# @return [String] String presentation of the object
|
198
|
+
def to_s
|
199
|
+
to_hash.to_s
|
200
|
+
end
|
201
|
+
|
202
|
+
# to_body is an alias to to_hash (backward compatibility)
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_body
|
205
|
+
to_hash
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the object in the form of hash
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_hash
|
211
|
+
hash = {}
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
213
|
+
value = self.send(attr)
|
214
|
+
next if value.nil?
|
215
|
+
hash[param] = _to_hash(value)
|
216
|
+
end
|
217
|
+
hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Outputs non-array value in the form of hash
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
222
|
+
# @param [Object] value Any valid value
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
224
|
+
def _to_hash(value)
|
225
|
+
if value.is_a?(Array)
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
227
|
+
elsif value.is_a?(Hash)
|
228
|
+
{}.tap do |hash|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
230
|
+
end
|
231
|
+
elsif value.respond_to? :to_hash
|
232
|
+
value.to_hash
|
233
|
+
else
|
234
|
+
value
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
239
|
+
end
|
@@ -0,0 +1,310 @@
|
|
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 PaymentsWepayEnroll
|
17
|
+
attr_accessor :address1
|
18
|
+
|
19
|
+
attr_accessor :address2
|
20
|
+
|
21
|
+
attr_accessor :canada_accept_debit_cards
|
22
|
+
|
23
|
+
attr_accessor :city
|
24
|
+
|
25
|
+
attr_accessor :company
|
26
|
+
|
27
|
+
attr_accessor :company_description
|
28
|
+
|
29
|
+
attr_accessor :country
|
30
|
+
|
31
|
+
attr_accessor :expected_revenue
|
32
|
+
|
33
|
+
attr_accessor :industry
|
34
|
+
|
35
|
+
attr_accessor :owner_email
|
36
|
+
|
37
|
+
attr_accessor :owner_name
|
38
|
+
|
39
|
+
attr_accessor :owner_phone
|
40
|
+
|
41
|
+
attr_accessor :state
|
42
|
+
|
43
|
+
attr_accessor :webiste_url
|
44
|
+
|
45
|
+
attr_accessor :zip
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'address1' => :'address1',
|
51
|
+
:'address2' => :'address2',
|
52
|
+
:'canada_accept_debit_cards' => :'canada_accept_debit_cards',
|
53
|
+
:'city' => :'city',
|
54
|
+
:'company' => :'company',
|
55
|
+
:'company_description' => :'company_description',
|
56
|
+
:'country' => :'country',
|
57
|
+
:'expected_revenue' => :'expected_revenue',
|
58
|
+
:'industry' => :'industry',
|
59
|
+
:'owner_email' => :'owner_email',
|
60
|
+
:'owner_name' => :'owner_name',
|
61
|
+
:'owner_phone' => :'owner_phone',
|
62
|
+
:'state' => :'state',
|
63
|
+
:'webiste_url' => :'webiste_url',
|
64
|
+
:'zip' => :'zip'
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.swagger_types
|
70
|
+
{
|
71
|
+
:'address1' => :'String',
|
72
|
+
:'address2' => :'String',
|
73
|
+
:'canada_accept_debit_cards' => :'BOOLEAN',
|
74
|
+
:'city' => :'String',
|
75
|
+
:'company' => :'String',
|
76
|
+
:'company_description' => :'String',
|
77
|
+
:'country' => :'String',
|
78
|
+
:'expected_revenue' => :'String',
|
79
|
+
:'industry' => :'String',
|
80
|
+
:'owner_email' => :'String',
|
81
|
+
:'owner_name' => :'String',
|
82
|
+
:'owner_phone' => :'String',
|
83
|
+
:'state' => :'String',
|
84
|
+
:'webiste_url' => :'String',
|
85
|
+
:'zip' => :'String'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# Initializes the object
|
90
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
91
|
+
def initialize(attributes = {})
|
92
|
+
return unless attributes.is_a?(Hash)
|
93
|
+
|
94
|
+
# convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
96
|
+
|
97
|
+
if attributes.has_key?(:'address1')
|
98
|
+
self.address1 = attributes[:'address1']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'address2')
|
102
|
+
self.address2 = attributes[:'address2']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'canada_accept_debit_cards')
|
106
|
+
self.canada_accept_debit_cards = attributes[:'canada_accept_debit_cards']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.has_key?(:'city')
|
110
|
+
self.city = attributes[:'city']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.has_key?(:'company')
|
114
|
+
self.company = attributes[:'company']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.has_key?(:'company_description')
|
118
|
+
self.company_description = attributes[:'company_description']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'country')
|
122
|
+
self.country = attributes[:'country']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'expected_revenue')
|
126
|
+
self.expected_revenue = attributes[:'expected_revenue']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'industry')
|
130
|
+
self.industry = attributes[:'industry']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'owner_email')
|
134
|
+
self.owner_email = attributes[:'owner_email']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'owner_name')
|
138
|
+
self.owner_name = attributes[:'owner_name']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'owner_phone')
|
142
|
+
self.owner_phone = attributes[:'owner_phone']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'state')
|
146
|
+
self.state = attributes[:'state']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'webiste_url')
|
150
|
+
self.webiste_url = attributes[:'webiste_url']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'zip')
|
154
|
+
self.zip = attributes[:'zip']
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
159
|
+
# @return Array for valid properties with the reasons
|
160
|
+
def list_invalid_properties
|
161
|
+
invalid_properties = Array.new
|
162
|
+
invalid_properties
|
163
|
+
end
|
164
|
+
|
165
|
+
# Check to see if the all the properties in the model are valid
|
166
|
+
# @return true if the model is valid
|
167
|
+
def valid?
|
168
|
+
true
|
169
|
+
end
|
170
|
+
|
171
|
+
# Checks equality by comparing each attribute.
|
172
|
+
# @param [Object] Object to be compared
|
173
|
+
def ==(o)
|
174
|
+
return true if self.equal?(o)
|
175
|
+
self.class == o.class &&
|
176
|
+
address1 == o.address1 &&
|
177
|
+
address2 == o.address2 &&
|
178
|
+
canada_accept_debit_cards == o.canada_accept_debit_cards &&
|
179
|
+
city == o.city &&
|
180
|
+
company == o.company &&
|
181
|
+
company_description == o.company_description &&
|
182
|
+
country == o.country &&
|
183
|
+
expected_revenue == o.expected_revenue &&
|
184
|
+
industry == o.industry &&
|
185
|
+
owner_email == o.owner_email &&
|
186
|
+
owner_name == o.owner_name &&
|
187
|
+
owner_phone == o.owner_phone &&
|
188
|
+
state == o.state &&
|
189
|
+
webiste_url == o.webiste_url &&
|
190
|
+
zip == o.zip
|
191
|
+
end
|
192
|
+
|
193
|
+
# @see the `==` method
|
194
|
+
# @param [Object] Object to be compared
|
195
|
+
def eql?(o)
|
196
|
+
self == o
|
197
|
+
end
|
198
|
+
|
199
|
+
# Calculates hash code according to all attributes.
|
200
|
+
# @return [Fixnum] Hash code
|
201
|
+
def hash
|
202
|
+
[address1, address2, canada_accept_debit_cards, city, company, company_description, country, expected_revenue, industry, owner_email, owner_name, owner_phone, state, webiste_url, zip].hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Builds the object from hash
|
206
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
207
|
+
# @return [Object] Returns the model itself
|
208
|
+
def build_from_hash(attributes)
|
209
|
+
return nil unless attributes.is_a?(Hash)
|
210
|
+
self.class.swagger_types.each_pair do |key, type|
|
211
|
+
if type =~ /\AArray<(.*)>/i
|
212
|
+
# check to ensure the input is an array given that the attribute
|
213
|
+
# is documented as an array but the input is not
|
214
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
215
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
216
|
+
end
|
217
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
218
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
219
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
220
|
+
end
|
221
|
+
|
222
|
+
self
|
223
|
+
end
|
224
|
+
|
225
|
+
# Deserializes the data based on type
|
226
|
+
# @param string type Data type
|
227
|
+
# @param string value Value to be deserialized
|
228
|
+
# @return [Object] Deserialized data
|
229
|
+
def _deserialize(type, value)
|
230
|
+
case type.to_sym
|
231
|
+
when :DateTime
|
232
|
+
DateTime.parse(value)
|
233
|
+
when :Date
|
234
|
+
Date.parse(value)
|
235
|
+
when :String
|
236
|
+
value.to_s
|
237
|
+
when :Integer
|
238
|
+
value.to_i
|
239
|
+
when :Float
|
240
|
+
value.to_f
|
241
|
+
when :BOOLEAN
|
242
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
243
|
+
true
|
244
|
+
else
|
245
|
+
false
|
246
|
+
end
|
247
|
+
when :Object
|
248
|
+
# generic object (usually a Hash), return directly
|
249
|
+
value
|
250
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
251
|
+
inner_type = Regexp.last_match[:inner_type]
|
252
|
+
value.map { |v| _deserialize(inner_type, v) }
|
253
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
254
|
+
k_type = Regexp.last_match[:k_type]
|
255
|
+
v_type = Regexp.last_match[:v_type]
|
256
|
+
{}.tap do |hash|
|
257
|
+
value.each do |k, v|
|
258
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
else # model
|
262
|
+
temp_model = UltracartClient.const_get(type).new
|
263
|
+
temp_model.build_from_hash(value)
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
# Returns the string representation of the object
|
268
|
+
# @return [String] String presentation of the object
|
269
|
+
def to_s
|
270
|
+
to_hash.to_s
|
271
|
+
end
|
272
|
+
|
273
|
+
# to_body is an alias to to_hash (backward compatibility)
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
275
|
+
def to_body
|
276
|
+
to_hash
|
277
|
+
end
|
278
|
+
|
279
|
+
# Returns the object in the form of hash
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
281
|
+
def to_hash
|
282
|
+
hash = {}
|
283
|
+
self.class.attribute_map.each_pair do |attr, param|
|
284
|
+
value = self.send(attr)
|
285
|
+
next if value.nil?
|
286
|
+
hash[param] = _to_hash(value)
|
287
|
+
end
|
288
|
+
hash
|
289
|
+
end
|
290
|
+
|
291
|
+
# Outputs non-array value in the form of hash
|
292
|
+
# For object, use to_hash. Otherwise, just return the value
|
293
|
+
# @param [Object] value Any valid value
|
294
|
+
# @return [Hash] Returns the value in the form of hash
|
295
|
+
def _to_hash(value)
|
296
|
+
if value.is_a?(Array)
|
297
|
+
value.compact.map { |v| _to_hash(v) }
|
298
|
+
elsif value.is_a?(Hash)
|
299
|
+
{}.tap do |hash|
|
300
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
301
|
+
end
|
302
|
+
elsif value.respond_to? :to_hash
|
303
|
+
value.to_hash
|
304
|
+
else
|
305
|
+
value
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
310
|
+
end
|