ultracart_api 4.0.161 → 4.0.162

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 494685de448ca7be3aeae8552443e99e60c95ed59103f10e3f75634e068c194d
4
- data.tar.gz: 316c79bbdb1518f0ba06543313161ac8e9b01858017a9df219c6c01f9e2a0a6f
3
+ metadata.gz: 4edfbbc263a0b6f8b853a70d46ca9cacf88f4952b6b23263f93c438a84e39e48
4
+ data.tar.gz: 4633d63b98a6b6b36049d822a0a359e7b249c6a26fe3406e102ae0ffe84c8a2b
5
5
  SHA512:
6
- metadata.gz: 2d49bac71f6d41b7d1935099ab7f3c3a3cc570348e01b17ce6652d10fd54ef085c41d18c8375492dba1ad69476b71b6a405c7a521a03d42dd19507bd19b05008
7
- data.tar.gz: b02ca8e6ba175690c783739b762a9cef6d93982c4ac8a7190b47aa11aa1158bb6d4157f4e9519f1240ca05692308dd163ba9f7f877535fbd3e6fc450d80b48b5
6
+ metadata.gz: d1c69e1d5766cb7a9fd7957eb2b29a366fabcd4ff2146f36877b0948c76b5bcc9e9162b0281d234555374982b32a8f5e0f95c0925205cddfbedd27e209102491
7
+ data.tar.gz: 89f74cdf55ffcb5cba3be20f5a3848d8a95e0c8337e5e1f4ef55a100498e401d237e7f1018f891d5fb5f032cbbbfb1e4e9a019045b10d437bcd28785eb08b14c
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 4.0.161
10
+ - Package version: 4.0.162
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-4.0.161.gem
27
+ gem install ./ultracart_api-4.0.162.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.161.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.162.gem` to install the development dependencies)
31
31
 
32
32
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33
33
 
34
34
  Finally add this to the Gemfile:
35
35
 
36
- gem 'ultracart_api', '~> 4.0.161'
36
+ gem 'ultracart_api', '~> 4.0.162'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -1364,6 +1364,7 @@ Not every change is committed to every SDK.
1364
1364
 
1365
1365
  | Version | Date | Comments |
1366
1366
  | --: | :-: | --- |
1367
+ | 4.0.162 | 06/20/2023 | coupon add allowed values for usable_by and new OncePerNewCustomerForItem flag |
1367
1368
  | 4.0.161 | 06/15/2023 | add pickup_dts to order.shipping object |
1368
1369
  | 4.0.160 | 06/14/2023 | dw bi: add request_dts on the execute queries request and report data set objects |
1369
1370
  | 4.0.159 | 06/09/2023 | distribution center pickup times |
@@ -166,6 +166,28 @@ module UltracartClient
166
166
  # Who may use this coupon.
167
167
  attr_accessor :usable_by
168
168
 
169
+ class EnumAttributeValidator
170
+ attr_reader :datatype
171
+ attr_reader :allowable_values
172
+
173
+ def initialize(datatype, allowable_values)
174
+ @allowable_values = allowable_values.map do |value|
175
+ case datatype.to_s
176
+ when /Integer/i
177
+ value.to_i
178
+ when /Float/i
179
+ value.to_f
180
+ else
181
+ value
182
+ end
183
+ end
184
+ end
185
+
186
+ def valid?(value)
187
+ !value || allowable_values.include?(value)
188
+ end
189
+ end
190
+
169
191
  # Attribute mapping from ruby-style variable name to JSON key.
170
192
  def self.attribute_map
171
193
  {
@@ -646,6 +668,8 @@ module UltracartClient
646
668
  return false if !@merchant_code.nil? && @merchant_code.to_s.length > 20
647
669
  return false if !@merchant_notes.nil? && @merchant_notes.to_s.length > 250
648
670
  return false if !@quickbooks_code.nil? && @quickbooks_code.to_s.length > 20
671
+ usable_by_validator = EnumAttributeValidator.new('String', ["Anyone", "UniqueCode", "OncePerCustomer", "OncePerNewCustomer", "OncePerNewCustomerForItem"])
672
+ return false unless usable_by_validator.valid?(@usable_by)
649
673
  return false if !@usable_by.nil? && @usable_by.to_s.length > 50
650
674
  true
651
675
  end
@@ -700,13 +724,13 @@ module UltracartClient
700
724
  @quickbooks_code = quickbooks_code
701
725
  end
702
726
 
703
- # Custom attribute writer method with validation
704
- # @param [Object] usable_by Value to be assigned
727
+ # Custom attribute writer method checking allowed values (enum).
728
+ # @param [Object] usable_by Object to be assigned
705
729
  def usable_by=(usable_by)
706
- if !usable_by.nil? && usable_by.to_s.length > 50
707
- fail ArgumentError, 'invalid value for "usable_by", the character length must be smaller than or equal to 50.'
730
+ validator = EnumAttributeValidator.new('String', ["Anyone", "UniqueCode", "OncePerCustomer", "OncePerNewCustomer", "OncePerNewCustomerForItem"])
731
+ unless validator.valid?(usable_by)
732
+ fail ArgumentError, "invalid value for \"usable_by\", must be one of #{validator.allowable_values}."
708
733
  end
709
-
710
734
  @usable_by = usable_by
711
735
  end
712
736
 
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.161'
14
+ VERSION = '4.0.162'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.161
4
+ version: 4.0.162
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2023-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus