ultracart_api 3.0.74 → 3.1.2
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.
- checksums.yaml +4 -4
- data/README.md +22 -18
- data/docs/AffiliateApi.md +8 -22
- data/docs/AutoOrderApi.md +44 -100
- data/docs/ChargebackApi.md +20 -55
- data/docs/CheckoutApi.md +78 -295
- data/docs/CouponApi.md +78 -209
- data/docs/CouponTieredAmountOffItem.md +1 -1
- data/docs/CouponTieredPercentOffItems.md +1 -1
- data/docs/CustomerApi.md +199 -110
- data/docs/EmailPlan.md +1 -0
- data/docs/EmailPlanAdditional.md +3 -0
- data/docs/EmailVerifyTokenRequest.md +9 -0
- data/docs/EmailVerifyTokenResponse.md +12 -0
- data/docs/EmailVerifyTokenValidateRequest.md +8 -0
- data/docs/FulfillmentApi.md +21 -55
- data/docs/ItemApi.md +36 -99
- data/docs/OauthApi.md +8 -32
- data/docs/OrderApi.md +84 -223
- data/docs/ScreenRecording.md +2 -1
- data/docs/StorefrontApi.md +429 -2077
- data/docs/TaxApi.md +121 -308
- data/docs/UserApi.md +46 -121
- data/docs/WebhookApi.md +32 -88
- data/lib/ultracart_api.rb +3 -0
- data/lib/ultracart_api/api/affiliate_api.rb +13 -0
- data/lib/ultracart_api/api/auto_order_api.rb +21 -8
- data/lib/ultracart_api/api/chargeback_api.rb +13 -0
- data/lib/ultracart_api/api/checkout_api.rb +15 -2
- data/lib/ultracart_api/api/coupon_api.rb +13 -0
- data/lib/ultracart_api/api/customer_api.rb +181 -0
- data/lib/ultracart_api/api/fulfillment_api.rb +13 -0
- data/lib/ultracart_api/api/item_api.rb +13 -0
- data/lib/ultracart_api/api/oauth_api.rb +13 -0
- data/lib/ultracart_api/api/order_api.rb +15 -2
- data/lib/ultracart_api/api/storefront_api.rb +13 -0
- data/lib/ultracart_api/api/tax_api.rb +13 -0
- data/lib/ultracart_api/api/user_api.rb +13 -0
- data/lib/ultracart_api/api/webhook_api.rb +13 -0
- data/lib/ultracart_api/models/coupon_tiered_amount_off_item.rb +1 -1
- data/lib/ultracart_api/models/coupon_tiered_percent_off_items.rb +1 -1
- data/lib/ultracart_api/models/email_plan.rb +10 -1
- data/lib/ultracart_api/models/email_plan_additional.rb +28 -1
- data/lib/ultracart_api/models/email_verify_token_request.rb +195 -0
- data/lib/ultracart_api/models/email_verify_token_response.rb +222 -0
- data/lib/ultracart_api/models/email_verify_token_validate_request.rb +185 -0
- data/lib/ultracart_api/models/screen_recording.rb +12 -1
- data/lib/ultracart_api/version.rb +1 -1
- metadata +8 -2
@@ -19,6 +19,19 @@ module UltracartClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
|
23
|
+
def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
|
24
|
+
api_config = Configuration.new
|
25
|
+
api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
|
26
|
+
api_config.api_version = '2017-03-01'
|
27
|
+
api_config.verify_ssl = verify_ssl
|
28
|
+
|
29
|
+
api_client = ApiClient.new(api_config)
|
30
|
+
api_client.config.debugging = debugging
|
31
|
+
|
32
|
+
UltracartClient::StorefrontApi.new(api_client)
|
33
|
+
end
|
34
|
+
|
22
35
|
# Add to library
|
23
36
|
# @param add_library_request New library item request
|
24
37
|
# @param [Hash] opts the optional parameters
|
@@ -19,6 +19,19 @@ module UltracartClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
|
23
|
+
def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
|
24
|
+
api_config = Configuration.new
|
25
|
+
api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
|
26
|
+
api_config.api_version = '2017-03-01'
|
27
|
+
api_config.verify_ssl = verify_ssl
|
28
|
+
|
29
|
+
api_client = ApiClient.new(api_config)
|
30
|
+
api_client.config.debugging = debugging
|
31
|
+
|
32
|
+
UltracartClient::TaxApi.new(api_client)
|
33
|
+
end
|
34
|
+
|
22
35
|
# Deletes a Self tax provider city
|
23
36
|
# Deletes a Self tax provider city.
|
24
37
|
# @param city The city being deleted.
|
@@ -19,6 +19,19 @@ module UltracartClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
|
23
|
+
def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
|
24
|
+
api_config = Configuration.new
|
25
|
+
api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
|
26
|
+
api_config.api_version = '2017-03-01'
|
27
|
+
api_config.verify_ssl = verify_ssl
|
28
|
+
|
29
|
+
api_client = ApiClient.new(api_config)
|
30
|
+
api_client.config.debugging = debugging
|
31
|
+
|
32
|
+
UltracartClient::UserApi.new(api_client)
|
33
|
+
end
|
34
|
+
|
22
35
|
# Delete a group
|
23
36
|
# Delete a group on the UltraCart account.
|
24
37
|
# @param group_oid The group_oid to delete.
|
@@ -19,6 +19,19 @@ module UltracartClient
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
|
23
|
+
def self.new_using_api_key(simple_key, verify_ssl = true, debugging = false)
|
24
|
+
api_config = Configuration.new
|
25
|
+
api_config.api_key_prefix['x-ultracart-simple-key'] = simple_key
|
26
|
+
api_config.api_version = '2017-03-01'
|
27
|
+
api_config.verify_ssl = verify_ssl
|
28
|
+
|
29
|
+
api_client = ApiClient.new(api_config)
|
30
|
+
api_client.config.debugging = debugging
|
31
|
+
|
32
|
+
UltracartClient::WebhookApi.new(api_client)
|
33
|
+
end
|
34
|
+
|
22
35
|
# Delete a webhook
|
23
36
|
# Delete a webhook on the UltraCart account.
|
24
37
|
# @param webhook_oid The webhook oid to delete.
|
@@ -17,7 +17,7 @@ module UltracartClient
|
|
17
17
|
# A list of items of which at least one must be purchased for coupon to be valid.
|
18
18
|
attr_accessor :items
|
19
19
|
|
20
|
-
# The maximum
|
20
|
+
# The (optional) maximum quantity of discounted items.
|
21
21
|
attr_accessor :limit
|
22
22
|
|
23
23
|
# A list of discount tiers.
|
@@ -18,6 +18,8 @@ module UltracartClient
|
|
18
18
|
|
19
19
|
attr_accessor :additional_emails
|
20
20
|
|
21
|
+
attr_accessor :additional_fee
|
22
|
+
|
21
23
|
attr_accessor :allow_list_import
|
22
24
|
|
23
25
|
attr_accessor :allow_tracking_emails
|
@@ -51,6 +53,7 @@ module UltracartClient
|
|
51
53
|
{
|
52
54
|
:'additional_customers' => :'additional_customers',
|
53
55
|
:'additional_emails' => :'additional_emails',
|
56
|
+
:'additional_fee' => :'additional_fee',
|
54
57
|
:'allow_list_import' => :'allow_list_import',
|
55
58
|
:'allow_tracking_emails' => :'allow_tracking_emails',
|
56
59
|
:'customer_tiers' => :'customer_tiers',
|
@@ -73,6 +76,7 @@ module UltracartClient
|
|
73
76
|
{
|
74
77
|
:'additional_customers' => :'Integer',
|
75
78
|
:'additional_emails' => :'Integer',
|
79
|
+
:'additional_fee' => :'Float',
|
76
80
|
:'allow_list_import' => :'BOOLEAN',
|
77
81
|
:'allow_tracking_emails' => :'BOOLEAN',
|
78
82
|
:'customer_tiers' => :'Array<EmailPlanAdditional>',
|
@@ -106,6 +110,10 @@ module UltracartClient
|
|
106
110
|
self.additional_emails = attributes[:'additional_emails']
|
107
111
|
end
|
108
112
|
|
113
|
+
if attributes.has_key?(:'additional_fee')
|
114
|
+
self.additional_fee = attributes[:'additional_fee']
|
115
|
+
end
|
116
|
+
|
109
117
|
if attributes.has_key?(:'allow_list_import')
|
110
118
|
self.allow_list_import = attributes[:'allow_list_import']
|
111
119
|
end
|
@@ -185,6 +193,7 @@ module UltracartClient
|
|
185
193
|
self.class == o.class &&
|
186
194
|
additional_customers == o.additional_customers &&
|
187
195
|
additional_emails == o.additional_emails &&
|
196
|
+
additional_fee == o.additional_fee &&
|
188
197
|
allow_list_import == o.allow_list_import &&
|
189
198
|
allow_tracking_emails == o.allow_tracking_emails &&
|
190
199
|
customer_tiers == o.customer_tiers &&
|
@@ -210,7 +219,7 @@ module UltracartClient
|
|
210
219
|
# Calculates hash code according to all attributes.
|
211
220
|
# @return [Fixnum] Hash code
|
212
221
|
def hash
|
213
|
-
[additional_customers, additional_emails, allow_list_import, allow_tracking_emails, customer_tiers, initial_sending_limits, plan_customers, plan_emails, plan_name, plan_name_formatted, require_order_within_last_days, revenue_percent, spam_percent_limit, total_customers, total_emails, upgrade_to].hash
|
222
|
+
[additional_customers, additional_emails, additional_fee, allow_list_import, allow_tracking_emails, customer_tiers, initial_sending_limits, plan_customers, plan_emails, plan_name, plan_name_formatted, require_order_within_last_days, revenue_percent, spam_percent_limit, total_customers, total_emails, upgrade_to].hash
|
214
223
|
end
|
215
224
|
|
216
225
|
# Builds the object from hash
|
@@ -14,12 +14,18 @@ require 'date'
|
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class EmailPlanAdditional
|
17
|
+
attr_accessor :active
|
18
|
+
|
17
19
|
attr_accessor :can_downgrade
|
18
20
|
|
19
21
|
attr_accessor :can_upgrade
|
20
22
|
|
21
23
|
attr_accessor :cost
|
22
24
|
|
25
|
+
attr_accessor :cost_change
|
26
|
+
|
27
|
+
attr_accessor :cost_change_formatted
|
28
|
+
|
23
29
|
attr_accessor :cost_formatted
|
24
30
|
|
25
31
|
attr_accessor :customers
|
@@ -29,9 +35,12 @@ module UltracartClient
|
|
29
35
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
36
|
def self.attribute_map
|
31
37
|
{
|
38
|
+
:'active' => :'active',
|
32
39
|
:'can_downgrade' => :'can_downgrade',
|
33
40
|
:'can_upgrade' => :'can_upgrade',
|
34
41
|
:'cost' => :'cost',
|
42
|
+
:'cost_change' => :'cost_change',
|
43
|
+
:'cost_change_formatted' => :'cost_change_formatted',
|
35
44
|
:'cost_formatted' => :'cost_formatted',
|
36
45
|
:'customers' => :'customers',
|
37
46
|
:'emails' => :'emails'
|
@@ -41,9 +50,12 @@ module UltracartClient
|
|
41
50
|
# Attribute type mapping.
|
42
51
|
def self.swagger_types
|
43
52
|
{
|
53
|
+
:'active' => :'BOOLEAN',
|
44
54
|
:'can_downgrade' => :'BOOLEAN',
|
45
55
|
:'can_upgrade' => :'BOOLEAN',
|
46
56
|
:'cost' => :'Float',
|
57
|
+
:'cost_change' => :'Float',
|
58
|
+
:'cost_change_formatted' => :'String',
|
47
59
|
:'cost_formatted' => :'String',
|
48
60
|
:'customers' => :'Integer',
|
49
61
|
:'emails' => :'Integer'
|
@@ -58,6 +70,10 @@ module UltracartClient
|
|
58
70
|
# convert string to symbol for hash key
|
59
71
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
60
72
|
|
73
|
+
if attributes.has_key?(:'active')
|
74
|
+
self.active = attributes[:'active']
|
75
|
+
end
|
76
|
+
|
61
77
|
if attributes.has_key?(:'can_downgrade')
|
62
78
|
self.can_downgrade = attributes[:'can_downgrade']
|
63
79
|
end
|
@@ -70,6 +86,14 @@ module UltracartClient
|
|
70
86
|
self.cost = attributes[:'cost']
|
71
87
|
end
|
72
88
|
|
89
|
+
if attributes.has_key?(:'cost_change')
|
90
|
+
self.cost_change = attributes[:'cost_change']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.has_key?(:'cost_change_formatted')
|
94
|
+
self.cost_change_formatted = attributes[:'cost_change_formatted']
|
95
|
+
end
|
96
|
+
|
73
97
|
if attributes.has_key?(:'cost_formatted')
|
74
98
|
self.cost_formatted = attributes[:'cost_formatted']
|
75
99
|
end
|
@@ -101,9 +125,12 @@ module UltracartClient
|
|
101
125
|
def ==(o)
|
102
126
|
return true if self.equal?(o)
|
103
127
|
self.class == o.class &&
|
128
|
+
active == o.active &&
|
104
129
|
can_downgrade == o.can_downgrade &&
|
105
130
|
can_upgrade == o.can_upgrade &&
|
106
131
|
cost == o.cost &&
|
132
|
+
cost_change == o.cost_change &&
|
133
|
+
cost_change_formatted == o.cost_change_formatted &&
|
107
134
|
cost_formatted == o.cost_formatted &&
|
108
135
|
customers == o.customers &&
|
109
136
|
emails == o.emails
|
@@ -118,7 +145,7 @@ module UltracartClient
|
|
118
145
|
# Calculates hash code according to all attributes.
|
119
146
|
# @return [Fixnum] Hash code
|
120
147
|
def hash
|
121
|
-
[can_downgrade, can_upgrade, cost, cost_formatted, customers, emails].hash
|
148
|
+
[active, can_downgrade, can_upgrade, cost, cost_change, cost_change_formatted, cost_formatted, customers, emails].hash
|
122
149
|
end
|
123
150
|
|
124
151
|
# Builds the object from hash
|
@@ -0,0 +1,195 @@
|
|
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 EmailVerifyTokenRequest
|
17
|
+
# email
|
18
|
+
attr_accessor :email
|
19
|
+
|
20
|
+
# password
|
21
|
+
attr_accessor :password
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'email' => :'email',
|
27
|
+
:'password' => :'password'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.swagger_types
|
33
|
+
{
|
34
|
+
:'email' => :'String',
|
35
|
+
:'password' => :'String'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
return unless attributes.is_a?(Hash)
|
43
|
+
|
44
|
+
# convert string to symbol for hash key
|
45
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
46
|
+
|
47
|
+
if attributes.has_key?(:'email')
|
48
|
+
self.email = attributes[:'email']
|
49
|
+
end
|
50
|
+
|
51
|
+
if attributes.has_key?(:'password')
|
52
|
+
self.password = attributes[:'password']
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
+
# @return Array for valid properties with the reasons
|
58
|
+
def list_invalid_properties
|
59
|
+
invalid_properties = Array.new
|
60
|
+
invalid_properties
|
61
|
+
end
|
62
|
+
|
63
|
+
# Check to see if the all the properties in the model are valid
|
64
|
+
# @return true if the model is valid
|
65
|
+
def valid?
|
66
|
+
true
|
67
|
+
end
|
68
|
+
|
69
|
+
# Checks equality by comparing each attribute.
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def ==(o)
|
72
|
+
return true if self.equal?(o)
|
73
|
+
self.class == o.class &&
|
74
|
+
email == o.email &&
|
75
|
+
password == o.password
|
76
|
+
end
|
77
|
+
|
78
|
+
# @see the `==` method
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def eql?(o)
|
81
|
+
self == o
|
82
|
+
end
|
83
|
+
|
84
|
+
# Calculates hash code according to all attributes.
|
85
|
+
# @return [Fixnum] Hash code
|
86
|
+
def hash
|
87
|
+
[email, password].hash
|
88
|
+
end
|
89
|
+
|
90
|
+
# Builds the object from hash
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
# @return [Object] Returns the model itself
|
93
|
+
def build_from_hash(attributes)
|
94
|
+
return nil unless attributes.is_a?(Hash)
|
95
|
+
self.class.swagger_types.each_pair do |key, type|
|
96
|
+
if type =~ /\AArray<(.*)>/i
|
97
|
+
# check to ensure the input is an array given that the attribute
|
98
|
+
# is documented as an array but the input is not
|
99
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
100
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
101
|
+
end
|
102
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
103
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
104
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
105
|
+
end
|
106
|
+
|
107
|
+
self
|
108
|
+
end
|
109
|
+
|
110
|
+
# Deserializes the data based on type
|
111
|
+
# @param string type Data type
|
112
|
+
# @param string value Value to be deserialized
|
113
|
+
# @return [Object] Deserialized data
|
114
|
+
def _deserialize(type, value)
|
115
|
+
case type.to_sym
|
116
|
+
when :DateTime
|
117
|
+
DateTime.parse(value)
|
118
|
+
when :Date
|
119
|
+
Date.parse(value)
|
120
|
+
when :String
|
121
|
+
value.to_s
|
122
|
+
when :Integer
|
123
|
+
value.to_i
|
124
|
+
when :Float
|
125
|
+
value.to_f
|
126
|
+
when :BOOLEAN
|
127
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
128
|
+
true
|
129
|
+
else
|
130
|
+
false
|
131
|
+
end
|
132
|
+
when :Object
|
133
|
+
# generic object (usually a Hash), return directly
|
134
|
+
value
|
135
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
136
|
+
inner_type = Regexp.last_match[:inner_type]
|
137
|
+
value.map { |v| _deserialize(inner_type, v) }
|
138
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
139
|
+
k_type = Regexp.last_match[:k_type]
|
140
|
+
v_type = Regexp.last_match[:v_type]
|
141
|
+
{}.tap do |hash|
|
142
|
+
value.each do |k, v|
|
143
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
else # model
|
147
|
+
temp_model = UltracartClient.const_get(type).new
|
148
|
+
temp_model.build_from_hash(value)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# Returns the string representation of the object
|
153
|
+
# @return [String] String presentation of the object
|
154
|
+
def to_s
|
155
|
+
to_hash.to_s
|
156
|
+
end
|
157
|
+
|
158
|
+
# to_body is an alias to to_hash (backward compatibility)
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
160
|
+
def to_body
|
161
|
+
to_hash
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the object in the form of hash
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
166
|
+
def to_hash
|
167
|
+
hash = {}
|
168
|
+
self.class.attribute_map.each_pair do |attr, param|
|
169
|
+
value = self.send(attr)
|
170
|
+
next if value.nil?
|
171
|
+
hash[param] = _to_hash(value)
|
172
|
+
end
|
173
|
+
hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Outputs non-array value in the form of hash
|
177
|
+
# For object, use to_hash. Otherwise, just return the value
|
178
|
+
# @param [Object] value Any valid value
|
179
|
+
# @return [Hash] Returns the value in the form of hash
|
180
|
+
def _to_hash(value)
|
181
|
+
if value.is_a?(Array)
|
182
|
+
value.compact.map { |v| _to_hash(v) }
|
183
|
+
elsif value.is_a?(Hash)
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
186
|
+
end
|
187
|
+
elsif value.respond_to? :to_hash
|
188
|
+
value.to_hash
|
189
|
+
else
|
190
|
+
value
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
end
|
@@ -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 EmailVerifyTokenResponse
|
17
|
+
attr_accessor :error
|
18
|
+
|
19
|
+
attr_accessor :metadata
|
20
|
+
|
21
|
+
# Indicates if API call was successful
|
22
|
+
attr_accessor :success
|
23
|
+
|
24
|
+
# token
|
25
|
+
attr_accessor :token
|
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
|
+
:'token' => :'token',
|
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
|
+
:'token' => :'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?(:'token')
|
72
|
+
self.token = attributes[:'token']
|
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
|
+
token == o.token &&
|
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, token, 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
|