Skip to content

Commit

Permalink
fix(countries): remove duplicate countries
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions-bot committed Apr 17, 2024
1 parent c306123 commit 8f893c3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
affixapi (1.1.57)
affixapi (1.1.58)
typhoeus (~> 1.0, >= 1.0.1)

GEM
Expand Down
10 changes: 3 additions & 7 deletions lib/openapi_client/models/address_no_non_null_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def self.openapi_nullable
:'street_address',
:'locality',
:'administrative_area',
:'country',
:'post_code'
])
end
Expand Down Expand Up @@ -126,26 +127,21 @@ def initialize(attributes = {})
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
if @country.nil?
invalid_properties.push('invalid value for "country", country cannot be nil.')
end

invalid_properties
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @country.nil?
country_validator = EnumAttributeValidator.new('String', ["CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LT", "LV", "LU", "NL", "NO", "PH", "PL", "RO", "SE", "SG", "SK", "CN", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "HK", "TW"])
country_validator = EnumAttributeValidator.new('String', ["CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LU", "LV", "NL", "NO", "PH", "PL", "RO", "SE", "SK", "CN", "HK", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "TW"])
return false unless country_validator.valid?(@country)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] country Object to be assigned
def country=(country)
validator = EnumAttributeValidator.new('String', ["CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LT", "LV", "LU", "NL", "NO", "PH", "PL", "RO", "SE", "SG", "SK", "CN", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "HK", "TW"])
validator = EnumAttributeValidator.new('String', ["CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LU", "LV", "NL", "NO", "PH", "PL", "RO", "SE", "SK", "CN", "HK", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "TW"])
unless validator.valid?(country)
fail ArgumentError, "invalid value for \"country\", must be one of #{validator.allowable_values}."
end
Expand Down
4 changes: 2 additions & 2 deletions lib/openapi_client/models/address_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def list_invalid_properties
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
country_validator = EnumAttributeValidator.new('String', ["null", "CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LT", "LV", "LU", "NL", "NO", "PH", "PL", "RO", "SE", "SG", "SK", "CN", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "HK", "TW"])
country_validator = EnumAttributeValidator.new('String', ["null", "CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LU", "LV", "NL", "NO", "PH", "PL", "RO", "SE", "SK", "CN", "HK", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "TW"])
return false unless country_validator.valid?(@country)
true
end

# Custom attribute writer method checking allowed values (enum).
# @param [Object] country Object to be assigned
def country=(country)
validator = EnumAttributeValidator.new('String', ["null", "CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LT", "LV", "LU", "NL", "NO", "PH", "PL", "RO", "SE", "SG", "SK", "CN", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "HK", "TW"])
validator = EnumAttributeValidator.new('String', ["null", "CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LU", "LV", "NL", "NO", "PH", "PL", "RO", "SE", "SK", "CN", "HK", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "TW"])
unless validator.valid?(country)
fail ArgumentError, "invalid value for \"country\", must be one of #{validator.allowable_values}."
end
Expand Down
2 changes: 1 addition & 1 deletion lib/openapi_client/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module OpenapiClient
VERSION = '1.1.57'
VERSION = '1.1.58'
end
2 changes: 1 addition & 1 deletion spec/models/address_no_non_null_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
describe 'test attribute "country"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LT", "LV", "LU", "NL", "NO", "PH", "PL", "RO", "SE", "SG", "SK", "CN", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "HK", "TW"])
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LU", "LV", "NL", "NO", "PH", "PL", "RO", "SE", "SK", "CN", "HK", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "TW"])
# validator.allowable_values.each do |value|
# expect { instance.country = value }.not_to raise_error
# end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/address_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
describe 'test attribute "country"' do
it 'should work' do
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["null", "CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LT", "LV", "LU", "NL", "NO", "PH", "PL", "RO", "SE", "SG", "SK", "CN", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "HK", "TW"])
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["null", "CA", "US", "MX", "AT", "AU", "BE", "CH", "CZ", "DE", "DK", "EE", "ES", "FI", "FR", "GB", "IE", "IM", "IS", "IT", "LI", "LT", "LU", "LV", "NL", "NO", "PH", "PL", "RO", "SE", "SK", "CN", "HK", "ID", "IN", "JP", "KR", "MO", "MY", "SG", "TW"])
# validator.allowable_values.each do |value|
# expect { instance.country = value }.not_to raise_error
# end
Expand Down

0 comments on commit 8f893c3

Please sign in to comment.