[Ruby] Fix ruby client generator to generate setter methods with not null validation (#20672)

* fix: Fix ruby client generator to generate setter methods with not null validation

Not null validation was missing for required and non-nullable properties when
no other validation was present.

* fix: Fix an issue where the initialize method did not accept attributes defined in its parent class
This commit is contained in:
Yuji Hanamura 2025-02-19 15:46:44 +09:00 committed by GitHub
parent 61ae569149
commit c349270c7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
217 changed files with 2328 additions and 648 deletions

View File

@ -42,16 +42,21 @@
}
end
# Returns all the JSON keys this model knows about{{#parent}}, including the ones defined in its parent(s){{/parent}}
def self.acceptable_attributes
# Returns attribute mapping this model knows about{{#parent}}, including the ones defined in its parent(s){{/parent}}
def self.acceptable_attribute_map
{{^parent}}
attribute_map.values
attribute_map
{{/parent}}
{{#parent}}
attribute_map.values.concat(superclass.acceptable_attributes)
superclass.acceptable_attribute_map.merge(attribute_map)
{{/parent}}
end
# Returns all the JSON keys this model knows about{{#parent}}, including the ones defined in its parent(s){{/parent}}
def self.acceptable_attributes
acceptable_attribute_map.values
end
# Attribute type mapping.
def self.openapi_types
{
@ -115,9 +120,10 @@
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `{{{moduleName}}}::{{{classname}}}`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `{{{moduleName}}}::{{{classname}}}`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -350,6 +356,22 @@
@{{{name}}} = {{{name}}}
end
{{/hasValidation}}
{{^hasValidation}}
{{^isNullable}}
{{#required}}
# Custom attribute writer method with validation
# @param [Object] {{{name}}} Value to be assigned
def {{{name}}}=({{{name}}})
if {{{name}}}.nil?
fail ArgumentError, '{{{name}}} cannot be nil'
end
@{{{name}}} = {{{name}}}
end
{{/required}}
{{/isNullable}}
{{/hasValidation}}
{{/isEnum}}
{{/vars}}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -55,9 +55,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -90,9 +95,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -68,9 +68,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -104,9 +109,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -62,9 +62,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -93,9 +98,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -160,6 +166,26 @@ module OpenapiClient
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Custom attribute writer method with validation
# @param [Object] photo_urls Value to be assigned
def photo_urls=(photo_urls)
if photo_urls.nil?
fail ArgumentError, 'photo_urls cannot be nil'
end
@photo_urls = photo_urls
end
# Custom attribute writer method checking allowed values (enum).
# @param [Object] status Object to be assigned
def status=(status)

View File

@ -50,9 +50,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -77,9 +82,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestFormObjectMultipartRequestMarker`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestFormObjectMultipartRequestMarker`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -33,9 +33,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -70,9 +75,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -55,9 +55,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -90,9 +95,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -68,9 +68,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -104,9 +109,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -62,9 +62,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -93,9 +98,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -160,6 +166,26 @@ module OpenapiClient
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Custom attribute writer method with validation
# @param [Object] photo_urls Value to be assigned
def photo_urls=(photo_urls)
if photo_urls.nil?
fail ArgumentError, 'photo_urls cannot be nil'
end
@photo_urls = photo_urls
end
# Custom attribute writer method checking allowed values (enum).
# @param [Object] status Object to be assigned
def status=(status)

View File

@ -50,9 +50,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -77,9 +82,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestFormObjectMultipartRequestMarker`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestFormObjectMultipartRequestMarker`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -33,9 +33,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -70,9 +75,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Bird`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Category`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -55,9 +55,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -90,9 +95,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DataQuery`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -68,9 +68,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -104,9 +109,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DefaultValue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::NumberPropertiesOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -62,9 +62,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -93,9 +98,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Pet`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -160,6 +166,26 @@ module OpenapiClient
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Custom attribute writer method with validation
# @param [Object] photo_urls Value to be assigned
def photo_urls=(photo_urls)
if photo_urls.nil?
fail ArgumentError, 'photo_urls cannot be nil'
end
@photo_urls = photo_urls
end
# Custom attribute writer method checking allowed values (enum).
# @param [Object] status Object to be assigned
def status=(status)

View File

@ -50,9 +50,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -77,9 +82,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Query`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Tag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestFormObjectMultipartRequestMarker`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestFormObjectMultipartRequestMarker`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -33,9 +33,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -70,9 +75,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module OpenapiClient
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module OpenapiClient
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -49,9 +49,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -76,9 +81,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AllOfWithSingleRef`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AllOfWithSingleRef`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -59,9 +64,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -99,6 +105,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] class_name Value to be assigned
def class_name=(class_name)
if class_name.nil?
fail ArgumentError, 'class_name cannot be nil'
end
@class_name = class_name
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)

View File

@ -30,9 +30,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -40,9 +40,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -71,9 +76,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -57,9 +62,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -92,6 +98,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)

View File

@ -46,9 +46,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -79,9 +84,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ChildWithNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ChildWithNullable`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -25,9 +25,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -51,9 +56,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DeprecatedObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DeprecatedObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -57,9 +62,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -49,9 +49,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -76,9 +81,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -67,9 +67,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -101,9 +106,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FakeBigDecimalMap200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FakeBigDecimalMap200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -26,9 +26,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -52,9 +57,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Foo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Foo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FooGetDefaultResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FooGetDefaultResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -71,9 +71,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -112,9 +117,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FormatTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -410,6 +416,26 @@ module Petstore
@string = string
end
# Custom attribute writer method with validation
# @param [Object] byte Value to be assigned
def byte=(byte)
if byte.nil?
fail ArgumentError, 'byte cannot be nil'
end
@byte = byte
end
# Custom attribute writer method with validation
# @param [Object] date Value to be assigned
def date=(date)
if date.nil?
fail ArgumentError, 'date cannot be nil'
end
@date = date
end
# Custom attribute writer method with validation
# @param [Object] password Value to be assigned
def password=(password)

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HasOnlyReadOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -25,9 +25,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -52,9 +57,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HealthCheckResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::HealthCheckResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::List`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -55,9 +55,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -84,9 +89,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MapTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::MixedPropertiesAndAdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -28,9 +28,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -55,9 +60,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Model200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -25,9 +25,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -51,9 +56,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ModelReturn`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -34,9 +34,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -63,9 +68,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Name`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -109,6 +115,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)

View File

@ -57,9 +57,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -104,9 +109,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NullableClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NullableClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::NumberOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -33,9 +33,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -62,9 +67,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ObjectWithDeprecatedFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ObjectWithDeprecatedFields`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -62,9 +62,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -93,9 +98,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Order`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterComposite`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterComposite`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -46,9 +46,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -72,9 +77,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterObjectWithEnumProperty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::OuterObjectWithEnumProperty`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -106,6 +112,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] value Value to be assigned
def value=(value)
if value.nil?
fail ArgumentError, 'value cannot be nil'
end
@value = value
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)

View File

@ -49,9 +49,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -82,9 +87,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ParentWithNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ParentWithNullable`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -62,9 +62,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -93,9 +98,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Pet`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Pet`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -160,6 +166,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Custom attribute writer method with validation
# @param [Object] photo_urls Value to be assigned
def photo_urls=(photo_urls)

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ReadOnlyFirst`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ReadOnlyFirst`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialModelName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::SpecialModelName`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Tag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Tag`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TestInlineFreeformAdditionalPropertiesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::TestInlineFreeformAdditionalPropertiesRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -46,9 +46,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -79,9 +84,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::User`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AdditionalPropertiesClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -49,9 +49,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -76,9 +81,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AllOfWithSingleRef`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::AllOfWithSingleRef`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -59,9 +64,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Animal`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -99,6 +105,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] class_name Value to be assigned
def class_name=(class_name)
if class_name.nil?
fail ArgumentError, 'class_name cannot be nil'
end
@class_name = class_name
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)

View File

@ -30,9 +30,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ApiResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayOfNumberOnly`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -30,9 +30,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -58,9 +63,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ArrayTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -40,9 +40,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -71,9 +76,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Capitalization`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -57,9 +62,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Cat`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Category`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}
@ -92,6 +98,16 @@ module Petstore
true
end
# Custom attribute writer method with validation
# @param [Object] name Value to be assigned
def name=(name)
if name.nil?
fail ArgumentError, 'name cannot be nil'
end
@name = name
end
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)

View File

@ -46,9 +46,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -79,9 +84,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ChildWithNullable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ChildWithNullable`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -25,9 +25,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -51,9 +56,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::ClassModel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Client`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DeprecatedObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::DeprecatedObject`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about, including the ones defined in its parent(s)
def self.acceptable_attribute_map
superclass.acceptable_attribute_map.merge(attribute_map)
end
# Returns all the JSON keys this model knows about, including the ones defined in its parent(s)
def self.acceptable_attributes
attribute_map.values.concat(superclass.acceptable_attributes)
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -57,9 +62,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Dog`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -49,9 +49,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -76,9 +81,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumArrays`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -67,9 +67,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -101,9 +106,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::EnumTest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FakeBigDecimalMap200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FakeBigDecimalMap200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -26,9 +26,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -52,9 +57,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::File`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -27,9 +27,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -54,9 +59,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FileSchemaTestClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Foo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::Foo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

View File

@ -24,9 +24,14 @@ module Petstore
}
end
# Returns attribute mapping this model knows about
def self.acceptable_attribute_map
attribute_map
end
# Returns all the JSON keys this model knows about
def self.acceptable_attributes
attribute_map.values
acceptable_attribute_map.values
end
# Attribute type mapping.
@ -50,9 +55,10 @@ module Petstore
end
# check to see if the attribute exists and convert string to symbol for hash key
acceptable_attribute_map = self.class.acceptable_attribute_map
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FooGetDefaultResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
if (!acceptable_attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `Petstore::FooGetDefaultResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
end
h[k.to_sym] = v
}

Some files were not shown because too many files have changed in this diff Show More