ultracart_api 3.0.75 → 3.1.3

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -18
  3. data/docs/AffiliateApi.md +8 -22
  4. data/docs/AutoOrderApi.md +44 -100
  5. data/docs/ChargebackApi.md +20 -55
  6. data/docs/CheckoutApi.md +78 -295
  7. data/docs/CouponApi.md +78 -209
  8. data/docs/CouponTieredAmountOffItem.md +1 -1
  9. data/docs/CouponTieredPercentOffItems.md +1 -1
  10. data/docs/CustomerApi.md +199 -110
  11. data/docs/EmailPlanAdditional.md +1 -0
  12. data/docs/EmailVerifyTokenRequest.md +9 -0
  13. data/docs/EmailVerifyTokenResponse.md +12 -0
  14. data/docs/EmailVerifyTokenValidateRequest.md +8 -0
  15. data/docs/EmailVerifyTokenValidateResponse.md +11 -0
  16. data/docs/FulfillmentApi.md +21 -55
  17. data/docs/ItemApi.md +36 -99
  18. data/docs/OauthApi.md +8 -32
  19. data/docs/OrderApi.md +84 -223
  20. data/docs/ScreenRecording.md +2 -1
  21. data/docs/StorefrontApi.md +429 -2077
  22. data/docs/TaxApi.md +121 -308
  23. data/docs/UserApi.md +46 -121
  24. data/docs/WebhookApi.md +32 -88
  25. data/lib/ultracart_api.rb +4 -0
  26. data/lib/ultracart_api/api/affiliate_api.rb +13 -0
  27. data/lib/ultracart_api/api/auto_order_api.rb +21 -8
  28. data/lib/ultracart_api/api/chargeback_api.rb +13 -0
  29. data/lib/ultracart_api/api/checkout_api.rb +15 -2
  30. data/lib/ultracart_api/api/coupon_api.rb +13 -0
  31. data/lib/ultracart_api/api/customer_api.rb +181 -0
  32. data/lib/ultracart_api/api/fulfillment_api.rb +13 -0
  33. data/lib/ultracart_api/api/item_api.rb +13 -0
  34. data/lib/ultracart_api/api/oauth_api.rb +13 -0
  35. data/lib/ultracart_api/api/order_api.rb +15 -2
  36. data/lib/ultracart_api/api/storefront_api.rb +13 -0
  37. data/lib/ultracart_api/api/tax_api.rb +13 -0
  38. data/lib/ultracart_api/api/user_api.rb +13 -0
  39. data/lib/ultracart_api/api/webhook_api.rb +13 -0
  40. data/lib/ultracart_api/models/coupon_tiered_amount_off_item.rb +1 -1
  41. data/lib/ultracart_api/models/coupon_tiered_percent_off_items.rb +1 -1
  42. data/lib/ultracart_api/models/email_plan_additional.rb +10 -1
  43. data/lib/ultracart_api/models/email_verify_token_request.rb +195 -0
  44. data/lib/ultracart_api/models/email_verify_token_response.rb +222 -0
  45. data/lib/ultracart_api/models/email_verify_token_validate_request.rb +185 -0
  46. data/lib/ultracart_api/models/email_verify_token_validate_response.rb +212 -0
  47. data/lib/ultracart_api/models/screen_recording.rb +12 -1
  48. data/lib/ultracart_api/version.rb +1 -1
  49. metadata +10 -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
  # The item being discounted by this coupon.
18
18
  attr_accessor :item
19
19
 
20
- # The maximum amount of total discount by this coupon.
20
+ # The maximum number of discounted items.
21
21
  attr_accessor :limit
22
22
 
23
23
  # A list of discount tiers.
@@ -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 amount of total discount by this coupon.
20
+ # The (optional) maximum quantity of discounted items.
21
21
  attr_accessor :limit
22
22
 
23
23
  # A list of discount tiers.
@@ -14,6 +14,8 @@ 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
@@ -33,6 +35,7 @@ module UltracartClient
33
35
  # Attribute mapping from ruby-style variable name to JSON key.
34
36
  def self.attribute_map
35
37
  {
38
+ :'active' => :'active',
36
39
  :'can_downgrade' => :'can_downgrade',
37
40
  :'can_upgrade' => :'can_upgrade',
38
41
  :'cost' => :'cost',
@@ -47,6 +50,7 @@ module UltracartClient
47
50
  # Attribute type mapping.
48
51
  def self.swagger_types
49
52
  {
53
+ :'active' => :'BOOLEAN',
50
54
  :'can_downgrade' => :'BOOLEAN',
51
55
  :'can_upgrade' => :'BOOLEAN',
52
56
  :'cost' => :'Float',
@@ -66,6 +70,10 @@ module UltracartClient
66
70
  # convert string to symbol for hash key
67
71
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
72
 
73
+ if attributes.has_key?(:'active')
74
+ self.active = attributes[:'active']
75
+ end
76
+
69
77
  if attributes.has_key?(:'can_downgrade')
70
78
  self.can_downgrade = attributes[:'can_downgrade']
71
79
  end
@@ -117,6 +125,7 @@ module UltracartClient
117
125
  def ==(o)
118
126
  return true if self.equal?(o)
119
127
  self.class == o.class &&
128
+ active == o.active &&
120
129
  can_downgrade == o.can_downgrade &&
121
130
  can_upgrade == o.can_upgrade &&
122
131
  cost == o.cost &&
@@ -136,7 +145,7 @@ module UltracartClient
136
145
  # Calculates hash code according to all attributes.
137
146
  # @return [Fixnum] Hash code
138
147
  def hash
139
- [can_downgrade, can_upgrade, cost, cost_change, cost_change_formatted, cost_formatted, customers, emails].hash
148
+ [active, can_downgrade, can_upgrade, cost, cost_change, cost_change_formatted, cost_formatted, customers, emails].hash
140
149
  end
141
150
 
142
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