diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 9ed3340627e..f1a110bd473 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -126,8 +126,8 @@ class {{classname}}(object): {{^isNullable}} {{#required}} # verify the required parameter '{{paramName}}' is set - if ('{{paramName}}' not in local_var_params or - local_var_params['{{paramName}}'] is None): + if self.api_client.client_side_validation and ('{{paramName}}' not in local_var_params or # noqa: E501 + local_var_params['{{paramName}}'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 {{/required}} {{/isNullable}} @@ -136,35 +136,35 @@ class {{classname}}(object): {{#allParams}} {{#hasValidation}} {{#maxLength}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) > {{maxLength}}): + if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 + len(local_var_params['{{paramName}}']) > {{maxLength}}): # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 {{/maxLength}} {{#minLength}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) < {{minLength}}): + if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 + len(local_var_params['{{paramName}}']) < {{minLength}}): # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 {{/minLength}} {{#maximum}} - if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 + if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 {{/maximum}} {{#minimum}} - if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 + if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + if self.api_client.client_side_validation and '{{paramName}}' in local_var_params and not re.search(r'{{{vendorExtensions.x-regex}}}', local_var_params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) > {{maxItems}}): + if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 + len(local_var_params['{{paramName}}']) > {{maxItems}}): # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 {{/maxItems}} {{#minItems}} - if ('{{paramName}}' in local_var_params and - len(local_var_params['{{paramName}}']) < {{minItems}}): + if self.api_client.client_side_validation and ('{{paramName}}' in local_var_params and # noqa: E501 + len(local_var_params['{{paramName}}']) < {{minItems}}): # noqa: E501 raise ApiValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 {{/minItems}} {{/hasValidation}} diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 546313cc19d..63dd91ebb5d 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -72,6 +72,7 @@ class ApiClient(object): self.cookie = cookie # Set default User-Agent. self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/python{{/httpUserAgent}}' + self.client_side_validation = configuration.client_side_validation def __del__(self): if self._pool: diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 2afcb7478ef..9677031a8c9 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -149,6 +149,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): self.retries = None """Adding retries to override urllib3 default value 3 """ + # Disable client side validation + self.client_side_validation = True @property def logger_file(self): diff --git a/modules/openapi-generator/src/main/resources/python/model.mustache b/modules/openapi-generator/src/main/resources/python/model.mustache index 16c8dadbf62..e2c39f3d6b3 100644 --- a/modules/openapi-generator/src/main/resources/python/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/model.mustache @@ -7,6 +7,8 @@ import re # noqa: F401 import six +from {{packageName}}.configuration import Configuration + {{#models}} {{#model}} @@ -51,8 +53,11 @@ class {{classname}}(object): } {{/discriminator}} - def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501 + def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, local_vars_configuration=None): # noqa: E501 """{{classname}} - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration {{#vars}}{{#-first}} {{/-first}} self._{{name}} = None @@ -101,7 +106,7 @@ class {{classname}}(object): """ {{^isNullable}} {{#required}} - if {{name}} is None: + if self.local_vars_configuration.client_side_validation and {{name}} is None: # noqa: E501 raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 {{/required}} {{/isNullable}} @@ -109,7 +114,8 @@ class {{classname}}(object): {{#isContainer}} allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 {{#isListContainer}} - if not set({{{name}}}).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set({{{name}}}).issubset(set(allowed_values))): raise ValueError( "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 @@ -117,7 +123,8 @@ class {{classname}}(object): ) {{/isListContainer}} {{#isMapContainer}} - if not set({{{name}}}.keys()).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set({{{name}}}.keys()).issubset(set(allowed_values))): raise ValueError( "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 @@ -127,7 +134,7 @@ class {{classname}}(object): {{/isContainer}} {{^isContainer}} allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if {{{name}}} not in allowed_values: + if self.local_vars_configuration.client_side_validation and {{{name}}} not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 .format({{{name}}}, allowed_values) @@ -137,31 +144,38 @@ class {{classname}}(object): {{^isEnum}} {{#hasValidation}} {{#maxLength}} - if {{name}} is not None and len({{name}}) > {{maxLength}}: + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and len({{name}}) > {{maxLength}}): raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 {{/maxLength}} {{#minLength}} - if {{name}} is not None and len({{name}}) < {{minLength}}: + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and len({{name}}) < {{minLength}}): raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 {{/minLength}} {{#maximum}} - if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 {{/maximum}} {{#minimum}} - if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501 raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} - if {{name}} is not None and len({{name}}) > {{maxItems}}: + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and len({{name}}) > {{maxItems}}): raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 {{/maxItems}} {{#minItems}} - if {{name}} is not None and len({{name}}) < {{minItems}}: + if (self.local_vars_configuration.client_side_validation and + {{name}} is not None and len({{name}}) < {{minItems}}): raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 {{/minItems}} {{/hasValidation}} @@ -215,10 +229,13 @@ class {{classname}}(object): if not isinstance(other, {{classname}}): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, {{classname}}): + return True + + return self.to_dict() != other.to_dict() {{/model}} {{/models}} diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index a47a8e3ea18..268310a3e2f 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -103,8 +103,8 @@ class AnotherFakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 692c12e25ac..6907451d920 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -103,8 +103,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'xml_item' is set - if ('xml_item' not in local_var_params or - local_var_params['xml_item'] is None): + if self.api_client.client_side_validation and ('xml_item' not in local_var_params or # noqa: E501 + local_var_params['xml_item'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 collection_formats = {} @@ -627,8 +627,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 collection_formats = {} @@ -735,12 +735,12 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'query' is set - if ('query' not in local_var_params or - local_var_params['query'] is None): + if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501 + local_var_params['query'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -849,8 +849,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -987,49 +987,49 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'number' is set - if ('number' not in local_var_params or - local_var_params['number'] is None): + if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501 + local_var_params['number'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if ('double' not in local_var_params or - local_var_params['double'] is None): + if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501 + local_var_params['double'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in local_var_params or - local_var_params['pattern_without_delimiter'] is None): + if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501 + local_var_params['pattern_without_delimiter'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if ('byte' not in local_var_params or - local_var_params['byte'] is None): + if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501 + local_var_params['byte'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 + if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 + if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 + if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 + if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 + if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 + if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 + if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 + if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 + if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 + if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 + if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if ('password' in local_var_params and - len(local_var_params['password']) > 64): + if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 + len(local_var_params['password']) > 64): # noqa: E501 raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if ('password' in local_var_params and - len(local_var_params['password']) < 10): + if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 + len(local_var_params['password']) < 10): # noqa: E501 raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 collection_formats = {} @@ -1306,16 +1306,16 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'required_string_group' is set - if ('required_string_group' not in local_var_params or - local_var_params['required_string_group'] is None): + if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501 + local_var_params['required_string_group'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_boolean_group' is set - if ('required_boolean_group' not in local_var_params or - local_var_params['required_boolean_group'] is None): + if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501 + local_var_params['required_boolean_group'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_int64_group' is set - if ('required_int64_group' not in local_var_params or - local_var_params['required_int64_group'] is None): + if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501 + local_var_params['required_int64_group'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 collection_formats = {} @@ -1426,8 +1426,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in local_var_params or - local_var_params['param'] is None): + if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 + local_var_params['param'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -1534,12 +1534,12 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in local_var_params or - local_var_params['param'] is None): + if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 + local_var_params['param'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if ('param2' not in local_var_params or - local_var_params['param2'] is None): + if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501 + local_var_params['param2'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -1656,24 +1656,24 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pipe' is set - if ('pipe' not in local_var_params or - local_var_params['pipe'] is None): + if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501 + local_var_params['pipe'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'ioutil' is set - if ('ioutil' not in local_var_params or - local_var_params['ioutil'] is None): + if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501 + local_var_params['ioutil'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'http' is set - if ('http' not in local_var_params or - local_var_params['http'] is None): + if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501 + local_var_params['http'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'url' is set - if ('url' not in local_var_params or - local_var_params['url'] is None): + if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501 + local_var_params['url'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'context' is set - if ('context' not in local_var_params or - local_var_params['context'] is None): + if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 + local_var_params['context'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 3e778e92268..90579feaae3 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -103,8 +103,8 @@ class FakeClassnameTags123Api(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index f96abdf7208..54abb9b95e7 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -101,8 +101,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -209,8 +209,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -315,8 +315,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'status' is set - if ('status' not in local_var_params or - local_var_params['status'] is None): + if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 + local_var_params['status'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -424,8 +424,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'tags' is set - if ('tags' not in local_var_params or - local_var_params['tags'] is None): + if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501 + local_var_params['tags'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -533,8 +533,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -639,8 +639,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -749,8 +749,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -863,8 +863,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} @@ -981,12 +981,12 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 # verify the required parameter 'required_file' is set - if ('required_file' not in local_var_params or - local_var_params['required_file'] is None): + if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501 + local_var_params['required_file'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index c3aa1c4a3d5..b907b107b2b 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -103,8 +103,8 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in local_var_params or - local_var_params['order_id'] is None): + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -307,13 +307,13 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in local_var_params or - local_var_params['order_id'] is None): + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 + if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 + if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} @@ -417,8 +417,8 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 86135f2c891..268721dcb89 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -103,8 +103,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -205,8 +205,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -307,8 +307,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -411,8 +411,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -513,8 +513,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -621,12 +621,12 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if ('password' not in local_var_params or - local_var_params['password'] is None): + if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 + local_var_params['password'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -831,12 +831,12 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if ('body' not in local_var_params or - local_var_params['body'] is None): + if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 + local_var_params['body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 64e1278b4eb..f9c494a76c3 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -77,6 +77,7 @@ class ApiClient(object): self.cookie = cookie # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation def __del__(self): if self._pool: diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 459ff6a3ca2..5e9d7b5d41d 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -138,6 +138,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): self.retries = None """Adding retries to override urllib3 default value 3 """ + # Disable client side validation + self.client_side_validation = True @property def logger_file(self): diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python/petstore_api/models/additional_properties_any_type.py index ed4f40068bf..2954285de87 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_any_type.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_any_type.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesAnyType(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesAnyType(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesAnyType - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesAnyType(object): if not isinstance(other, AdditionalPropertiesAnyType): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesAnyType): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python/petstore_api/models/additional_properties_array.py index 22b4133f367..c6369c22a12 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_array.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_array.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesArray(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesArray(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesArray - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesArray(object): if not isinstance(other, AdditionalPropertiesArray): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesArray): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python/petstore_api/models/additional_properties_boolean.py index 24e2fc178ab..599b7c8b884 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_boolean.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_boolean.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesBoolean(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesBoolean(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesBoolean - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesBoolean(object): if not isinstance(other, AdditionalPropertiesBoolean): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesBoolean): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py index e9e9307d1b7..be4455c683b 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -58,8 +60,11 @@ class AdditionalPropertiesClass(object): 'anytype_3': 'anytype_3' } - def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None): # noqa: E501 + def __init__(self, map_string=None, map_number=None, map_integer=None, map_boolean=None, map_array_integer=None, map_array_anytype=None, map_map_string=None, map_map_anytype=None, anytype_1=None, anytype_2=None, anytype_3=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._map_string = None self._map_number = None @@ -365,8 +370,11 @@ class AdditionalPropertiesClass(object): if not isinstance(other, AdditionalPropertiesClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python/petstore_api/models/additional_properties_integer.py index 43bcf425a7b..ddbb85fdf33 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_integer.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_integer.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesInteger(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesInteger(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesInteger - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesInteger(object): if not isinstance(other, AdditionalPropertiesInteger): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesInteger): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python/petstore_api/models/additional_properties_number.py index b3e034035a8..8bbeda83ecc 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_number.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_number.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesNumber(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesNumber(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesNumber - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesNumber(object): if not isinstance(other, AdditionalPropertiesNumber): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesNumber): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python/petstore_api/models/additional_properties_object.py index 9ab56a4e553..af87595b3e4 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_object.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_object.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesObject(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesObject(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesObject - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesObject(object): if not isinstance(other, AdditionalPropertiesObject): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python/petstore_api/models/additional_properties_string.py index 4667186bdc4..6ab2c91feda 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_string.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_string.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesString(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class AdditionalPropertiesString(object): 'name': 'name' } - def __init__(self, name=None): # noqa: E501 + def __init__(self, name=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesString - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.discriminator = None @@ -105,8 +110,11 @@ class AdditionalPropertiesString(object): if not isinstance(other, AdditionalPropertiesString): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesString): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index 552ef0e8326..65cef1a6088 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Animal(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -45,8 +47,11 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): # noqa: E501 + def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._class_name = None self._color = None @@ -74,7 +79,7 @@ class Animal(object): :param class_name: The class_name of this Animal. # noqa: E501 :type: str """ - if class_name is None: + if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501 raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 self._class_name = class_name @@ -143,8 +148,11 @@ class Animal(object): if not isinstance(other, Animal): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Animal): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/api_response.py b/samples/client/petstore/python/petstore_api/models/api_response.py index 190c3df3452..24e80d02aea 100644 --- a/samples/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/client/petstore/python/petstore_api/models/api_response.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ApiResponse(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class ApiResponse(object): 'message': 'message' } - def __init__(self, code=None, type=None, message=None): # noqa: E501 + def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 """ApiResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._code = None self._type = None @@ -157,8 +162,11 @@ class ApiResponse(object): if not isinstance(other, ApiResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ApiResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index ebf96429801..1f654452077 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ArrayOfArrayOfNumberOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ArrayOfArrayOfNumberOnly(object): 'array_array_number': 'ArrayArrayNumber' } - def __init__(self, array_array_number=None): # noqa: E501 + def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501 """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._array_array_number = None self.discriminator = None @@ -105,8 +110,11 @@ class ArrayOfArrayOfNumberOnly(object): if not isinstance(other, ArrayOfArrayOfNumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py index 8e1837c46bd..27ba1f58e31 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ArrayOfNumberOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ArrayOfNumberOnly(object): 'array_number': 'ArrayNumber' } - def __init__(self, array_number=None): # noqa: E501 + def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501 """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._array_number = None self.discriminator = None @@ -105,8 +110,11 @@ class ArrayOfNumberOnly(object): if not isinstance(other, ArrayOfNumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayOfNumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/array_test.py b/samples/client/petstore/python/petstore_api/models/array_test.py index f548fef3ee8..f34a372f6f3 100644 --- a/samples/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/client/petstore/python/petstore_api/models/array_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ArrayTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class ArrayTest(object): 'array_array_of_model': 'array_array_of_model' } - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501 """ArrayTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._array_of_string = None self._array_array_of_integer = None @@ -157,8 +162,11 @@ class ArrayTest(object): if not isinstance(other, ArrayTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/capitalization.py b/samples/client/petstore/python/petstore_api/models/capitalization.py index 0da6b77e84d..cef34c5f6dc 100644 --- a/samples/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python/petstore_api/models/capitalization.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Capitalization(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class Capitalization(object): 'att_name': 'ATT_NAME' } - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501 """Capitalization - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._small_camel = None self._capital_camel = None @@ -237,8 +242,11 @@ class Capitalization(object): if not isinstance(other, Capitalization): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Capitalization): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/cat.py b/samples/client/petstore/python/petstore_api/models/cat.py index 216e5123538..e39c1c82508 100644 --- a/samples/client/petstore/python/petstore_api/models/cat.py +++ b/samples/client/petstore/python/petstore_api/models/cat.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Cat(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Cat(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): # noqa: E501 + def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 """Cat - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._declawed = None self.discriminator = None @@ -105,8 +110,11 @@ class Cat(object): if not isinstance(other, Cat): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Cat): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/cat_all_of.py b/samples/client/petstore/python/petstore_api/models/cat_all_of.py index 3c90df84ec3..7e90fab9348 100644 --- a/samples/client/petstore/python/petstore_api/models/cat_all_of.py +++ b/samples/client/petstore/python/petstore_api/models/cat_all_of.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class CatAllOf(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class CatAllOf(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): # noqa: E501 + def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 """CatAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._declawed = None self.discriminator = None @@ -105,8 +110,11 @@ class CatAllOf(object): if not isinstance(other, CatAllOf): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CatAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index 0e23c409e50..b47c148953e 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Category(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name='default-name'): # noqa: E501 + def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._name = None @@ -90,7 +95,7 @@ class Category(object): :param name: The name of this Category. # noqa: E501 :type: str """ - if name is None: + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -132,8 +137,11 @@ class Category(object): if not isinstance(other, Category): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Category): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/class_model.py b/samples/client/petstore/python/petstore_api/models/class_model.py index 88562beff8b..ef6060ffa70 100644 --- a/samples/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/client/petstore/python/petstore_api/models/class_model.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ClassModel(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ClassModel(object): '_class': '_class' } - def __init__(self, _class=None): # noqa: E501 + def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501 """ClassModel - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.__class = None self.discriminator = None @@ -105,8 +110,11 @@ class ClassModel(object): if not isinstance(other, ClassModel): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ClassModel): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/client.py b/samples/client/petstore/python/petstore_api/models/client.py index b7083fd9bd7..ee5dbf1c43a 100644 --- a/samples/client/petstore/python/petstore_api/models/client.py +++ b/samples/client/petstore/python/petstore_api/models/client.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Client(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Client(object): 'client': 'client' } - def __init__(self, client=None): # noqa: E501 + def __init__(self, client=None, local_vars_configuration=None): # noqa: E501 """Client - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._client = None self.discriminator = None @@ -105,8 +110,11 @@ class Client(object): if not isinstance(other, Client): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Client): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/dog.py b/samples/client/petstore/python/petstore_api/models/dog.py index c325cb252c3..eacb63eedb0 100644 --- a/samples/client/petstore/python/petstore_api/models/dog.py +++ b/samples/client/petstore/python/petstore_api/models/dog.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Dog(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Dog(object): 'breed': 'breed' } - def __init__(self, breed=None): # noqa: E501 + def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 """Dog - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._breed = None self.discriminator = None @@ -105,8 +110,11 @@ class Dog(object): if not isinstance(other, Dog): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Dog): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/dog_all_of.py b/samples/client/petstore/python/petstore_api/models/dog_all_of.py index b6328b05589..48e04855708 100644 --- a/samples/client/petstore/python/petstore_api/models/dog_all_of.py +++ b/samples/client/petstore/python/petstore_api/models/dog_all_of.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class DogAllOf(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class DogAllOf(object): 'breed': 'breed' } - def __init__(self, breed=None): # noqa: E501 + def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 """DogAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._breed = None self.discriminator = None @@ -105,8 +110,11 @@ class DogAllOf(object): if not isinstance(other, DogAllOf): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, DogAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/client/petstore/python/petstore_api/models/enum_arrays.py index 00aa21d04da..481283a05c3 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/models/enum_arrays.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class EnumArrays(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class EnumArrays(object): 'array_enum': 'array_enum' } - def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501 """EnumArrays - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._just_symbol = None self._array_enum = None @@ -71,7 +76,7 @@ class EnumArrays(object): :type: str """ allowed_values = [">=", "$"] # noqa: E501 - if just_symbol not in allowed_values: + if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 .format(just_symbol, allowed_values) @@ -98,7 +103,8 @@ class EnumArrays(object): :type: list[str] """ allowed_values = ["fish", "crab"] # noqa: E501 - if not set(array_enum).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set(array_enum).issubset(set(allowed_values))): raise ValueError( "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 @@ -144,8 +150,11 @@ class EnumArrays(object): if not isinstance(other, EnumArrays): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumArrays): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/enum_class.py b/samples/client/petstore/python/petstore_api/models/enum_class.py index 3c1aa279755..8bc62757860 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python/petstore_api/models/enum_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class EnumClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class EnumClass(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """EnumClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class EnumClass(object): if not isinstance(other, EnumClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index 11e5020363e..464281b3ec0 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class EnumTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -46,8 +48,11 @@ class EnumTest(object): 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, local_vars_configuration=None): # noqa: E501 """EnumTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._enum_string = None self._enum_string_required = None @@ -85,7 +90,7 @@ class EnumTest(object): :type: str """ allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 .format(enum_string, allowed_values) @@ -111,10 +116,10 @@ class EnumTest(object): :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 :type: str """ - if enum_string_required is None: + if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501 raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string_required not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 .format(enum_string_required, allowed_values) @@ -141,7 +146,7 @@ class EnumTest(object): :type: int """ allowed_values = [1, -1] # noqa: E501 - if enum_integer not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 .format(enum_integer, allowed_values) @@ -168,7 +173,7 @@ class EnumTest(object): :type: float """ allowed_values = [1.1, -1.2] # noqa: E501 - if enum_number not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 .format(enum_number, allowed_values) @@ -234,8 +239,11 @@ class EnumTest(object): if not isinstance(other, EnumTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/file.py b/samples/client/petstore/python/petstore_api/models/file.py index 475f86b799f..282df2957e6 100644 --- a/samples/client/petstore/python/petstore_api/models/file.py +++ b/samples/client/petstore/python/petstore_api/models/file.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class File(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class File(object): 'source_uri': 'sourceURI' } - def __init__(self, source_uri=None): # noqa: E501 + def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501 """File - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._source_uri = None self.discriminator = None @@ -107,8 +112,11 @@ class File(object): if not isinstance(other, File): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, File): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python/petstore_api/models/file_schema_test_class.py index 9f3b5bdc179..de7f865b47e 100644 --- a/samples/client/petstore/python/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python/petstore_api/models/file_schema_test_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class FileSchemaTestClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class FileSchemaTestClass(object): 'files': 'files' } - def __init__(self, file=None, files=None): # noqa: E501 + def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501 """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._file = None self._files = None @@ -131,8 +136,11 @@ class FileSchemaTestClass(object): if not isinstance(other, FileSchemaTestClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, FileSchemaTestClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index 1451cdcd6af..6396c442f62 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class FormatTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -64,8 +66,11 @@ class FormatTest(object): 'big_decimal': 'BigDecimal' } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, big_decimal=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, big_decimal=None, local_vars_configuration=None): # noqa: E501 """FormatTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._integer = None self._int32 = None @@ -126,9 +131,11 @@ class FormatTest(object): :param integer: The integer of this FormatTest. # noqa: E501 :type: int """ - if integer is not None and integer > 100: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + integer is not None and integer > 100): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if integer is not None and integer < 10: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + integer is not None and integer < 10): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 self._integer = integer @@ -151,9 +158,11 @@ class FormatTest(object): :param int32: The int32 of this FormatTest. # noqa: E501 :type: int """ - if int32 is not None and int32 > 200: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + int32 is not None and int32 > 200): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if int32 is not None and int32 < 20: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + int32 is not None and int32 < 20): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 self._int32 = int32 @@ -197,11 +206,13 @@ class FormatTest(object): :param number: The number of this FormatTest. # noqa: E501 :type: float """ - if number is None: + if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if number is not None and number > 543.2: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + number is not None and number > 543.2): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if number is not None and number < 32.1: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + number is not None and number < 32.1): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 self._number = number @@ -224,9 +235,11 @@ class FormatTest(object): :param float: The float of this FormatTest. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + float is not None and float > 987.6): # noqa: E501 raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if float is not None and float < 54.3: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + float is not None and float < 54.3): # noqa: E501 raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 self._float = float @@ -249,9 +262,11 @@ class FormatTest(object): :param double: The double of this FormatTest. # noqa: E501 :type: float """ - if double is not None and double > 123.4: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + double is not None and double > 123.4): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if double is not None and double < 67.8: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + double is not None and double < 67.8): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 self._double = double @@ -274,7 +289,8 @@ class FormatTest(object): :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -297,9 +313,10 @@ class FormatTest(object): :param byte: The byte of this FormatTest. # noqa: E501 :type: str """ - if byte is None: + if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte)): # noqa: E501 raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 self._byte = byte @@ -343,7 +360,7 @@ class FormatTest(object): :param date: The date of this FormatTest. # noqa: E501 :type: date """ - if date is None: + if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501 raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 self._date = date @@ -408,11 +425,13 @@ class FormatTest(object): :param password: The password of this FormatTest. # noqa: E501 :type: str """ - if password is None: + if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501 raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if password is not None and len(password) > 64: + if (self.local_vars_configuration.client_side_validation and + password is not None and len(password) > 64): raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if password is not None and len(password) < 10: + if (self.local_vars_configuration.client_side_validation and + password is not None and len(password) < 10): raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 self._password = password @@ -475,8 +494,11 @@ class FormatTest(object): if not isinstance(other, FormatTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, FormatTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py index 7c8d921a2d8..5fc2f8a9ebd 100644 --- a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class HasOnlyReadOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class HasOnlyReadOnly(object): 'foo': 'foo' } - def __init__(self, bar=None, foo=None): # noqa: E501 + def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501 """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._bar = None self._foo = None @@ -131,8 +136,11 @@ class HasOnlyReadOnly(object): if not isinstance(other, HasOnlyReadOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, HasOnlyReadOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/list.py b/samples/client/petstore/python/petstore_api/models/list.py index 74fc3719aa0..d58d13e90fb 100644 --- a/samples/client/petstore/python/petstore_api/models/list.py +++ b/samples/client/petstore/python/petstore_api/models/list.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class List(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class List(object): '_123_list': '123-list' } - def __init__(self, _123_list=None): # noqa: E501 + def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501 """List - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.__123_list = None self.discriminator = None @@ -105,8 +110,11 @@ class List(object): if not isinstance(other, List): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, List): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/map_test.py b/samples/client/petstore/python/petstore_api/models/map_test.py index cdfb9365297..b170dce412c 100644 --- a/samples/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/client/petstore/python/petstore_api/models/map_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class MapTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -44,8 +46,11 @@ class MapTest(object): 'indirect_map': 'indirect_map' } - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501 + def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501 """MapTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._map_map_of_string = None self._map_of_enum_string = None @@ -102,7 +107,8 @@ class MapTest(object): :type: dict(str, str) """ allowed_values = ["UPPER", "lower"] # noqa: E501 - if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set(map_of_enum_string.keys()).issubset(set(allowed_values))): raise ValueError( "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 @@ -190,8 +196,11 @@ class MapTest(object): if not isinstance(other, MapTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, MapTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index 41a916eac10..5da34f8830e 100644 --- a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class MixedPropertiesAndAdditionalPropertiesClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): 'map': 'map' } - def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501 """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._uuid = None self._date_time = None @@ -157,8 +162,11 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/model200_response.py b/samples/client/petstore/python/petstore_api/models/model200_response.py index 563b82b5939..841ce1f18f3 100644 --- a/samples/client/petstore/python/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python/petstore_api/models/model200_response.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Model200Response(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Model200Response(object): '_class': 'class' } - def __init__(self, name=None, _class=None): # noqa: E501 + def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 """Model200Response - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.__class = None @@ -131,8 +136,11 @@ class Model200Response(object): if not isinstance(other, Model200Response): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Model200Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/model_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py index 09801201598..fdd8d72314a 100644 --- a/samples/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/client/petstore/python/petstore_api/models/model_return.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ModelReturn(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ModelReturn(object): '_return': 'return' } - def __init__(self, _return=None): # noqa: E501 + def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501 """ModelReturn - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.__return = None self.discriminator = None @@ -105,8 +110,11 @@ class ModelReturn(object): if not isinstance(other, ModelReturn): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ModelReturn): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/name.py b/samples/client/petstore/python/petstore_api/models/name.py index 43014d0fb64..bb2c1fbd73c 100644 --- a/samples/client/petstore/python/petstore_api/models/name.py +++ b/samples/client/petstore/python/petstore_api/models/name.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Name(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -44,8 +46,11 @@ class Name(object): '_123_number': '123Number' } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501 """Name - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self._snake_case = None @@ -79,7 +84,7 @@ class Name(object): :param name: The name of this Name. # noqa: E501 :type: int """ - if name is None: + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -184,8 +189,11 @@ class Name(object): if not isinstance(other, Name): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Name): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/number_only.py b/samples/client/petstore/python/petstore_api/models/number_only.py index b6f3d1c1b65..99b2424852f 100644 --- a/samples/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/client/petstore/python/petstore_api/models/number_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class NumberOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class NumberOnly(object): 'just_number': 'JustNumber' } - def __init__(self, just_number=None): # noqa: E501 + def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501 """NumberOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._just_number = None self.discriminator = None @@ -105,8 +110,11 @@ class NumberOnly(object): if not isinstance(other, NumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, NumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/order.py b/samples/client/petstore/python/petstore_api/models/order.py index 8b64e3a3583..8c863cce8fe 100644 --- a/samples/client/petstore/python/petstore_api/models/order.py +++ b/samples/client/petstore/python/petstore_api/models/order.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Order(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class Order(object): 'complete': 'complete' } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501 """Order - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._pet_id = None @@ -177,7 +182,7 @@ class Order(object): :type: str """ allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -243,8 +248,11 @@ class Order(object): if not isinstance(other, Order): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Order): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_composite.py b/samples/client/petstore/python/petstore_api/models/outer_composite.py index dccd67055be..c11859114a5 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python/petstore_api/models/outer_composite.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterComposite(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class OuterComposite(object): 'my_boolean': 'my_boolean' } - def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501 """OuterComposite - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._my_number = None self._my_string = None @@ -157,8 +162,11 @@ class OuterComposite(object): if not isinstance(other, OuterComposite): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterComposite): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_enum.py b/samples/client/petstore/python/petstore_api/models/outer_enum.py index a6697a0b152..8fbfeb7aaea 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python/petstore_api/models/outer_enum.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterEnum(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class OuterEnum(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """OuterEnum - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class OuterEnum(object): if not isinstance(other, OuterEnum): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterEnum): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/pet.py b/samples/client/petstore/python/petstore_api/models/pet.py index 870608e17ac..edbf73f5312 100644 --- a/samples/client/petstore/python/petstore_api/models/pet.py +++ b/samples/client/petstore/python/petstore_api/models/pet.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Pet(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class Pet(object): 'status': 'status' } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501 """Pet - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._category = None @@ -130,7 +135,7 @@ class Pet(object): :param name: The name of this Pet. # noqa: E501 :type: str """ - if name is None: + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -153,7 +158,7 @@ class Pet(object): :param photo_urls: The photo_urls of this Pet. # noqa: E501 :type: list[str] """ - if photo_urls is None: + if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501 raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 self._photo_urls = photo_urls @@ -200,7 +205,7 @@ class Pet(object): :type: str """ allowed_values = ["available", "pending", "sold"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -245,8 +250,11 @@ class Pet(object): if not isinstance(other, Pet): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Pet): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/read_only_first.py b/samples/client/petstore/python/petstore_api/models/read_only_first.py index 3dfb7c7f626..a84679e98de 100644 --- a/samples/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/models/read_only_first.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ReadOnlyFirst(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class ReadOnlyFirst(object): 'baz': 'baz' } - def __init__(self, bar=None, baz=None): # noqa: E501 + def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501 """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._bar = None self._baz = None @@ -131,8 +136,11 @@ class ReadOnlyFirst(object): if not isinstance(other, ReadOnlyFirst): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ReadOnlyFirst): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/special_model_name.py b/samples/client/petstore/python/petstore_api/models/special_model_name.py index 2fd6378fcdc..396e75bcee5 100644 --- a/samples/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/models/special_model_name.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class SpecialModelName(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class SpecialModelName(object): 'special_property_name': '$special[property.name]' } - def __init__(self, special_property_name=None): # noqa: E501 + def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501 """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._special_property_name = None self.discriminator = None @@ -105,8 +110,11 @@ class SpecialModelName(object): if not isinstance(other, SpecialModelName): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SpecialModelName): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/tag.py b/samples/client/petstore/python/petstore_api/models/tag.py index cb9c22d9f53..d6137fdd47f 100644 --- a/samples/client/petstore/python/petstore_api/models/tag.py +++ b/samples/client/petstore/python/petstore_api/models/tag.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Tag(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Tag(object): 'name': 'name' } - def __init__(self, id=None, name=None): # noqa: E501 + def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 """Tag - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._name = None @@ -131,8 +136,11 @@ class Tag(object): if not isinstance(other, Tag): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Tag): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_default.py b/samples/client/petstore/python/petstore_api/models/type_holder_default.py index d7c207cb5f6..8163ea77aa7 100644 --- a/samples/client/petstore/python/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python/petstore_api/models/type_holder_default.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class TypeHolderDefault(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -46,8 +48,11 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None): # noqa: E501 + def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._string_item = None self._number_item = None @@ -80,7 +85,7 @@ class TypeHolderDefault(object): :param string_item: The string_item of this TypeHolderDefault. # noqa: E501 :type: str """ - if string_item is None: + if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 self._string_item = string_item @@ -103,7 +108,7 @@ class TypeHolderDefault(object): :param number_item: The number_item of this TypeHolderDefault. # noqa: E501 :type: float """ - if number_item is None: + if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 self._number_item = number_item @@ -126,7 +131,7 @@ class TypeHolderDefault(object): :param integer_item: The integer_item of this TypeHolderDefault. # noqa: E501 :type: int """ - if integer_item is None: + if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 self._integer_item = integer_item @@ -149,7 +154,7 @@ class TypeHolderDefault(object): :param bool_item: The bool_item of this TypeHolderDefault. # noqa: E501 :type: bool """ - if bool_item is None: + if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 self._bool_item = bool_item @@ -172,7 +177,7 @@ class TypeHolderDefault(object): :param array_item: The array_item of this TypeHolderDefault. # noqa: E501 :type: list[int] """ - if array_item is None: + if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 self._array_item = array_item @@ -214,8 +219,11 @@ class TypeHolderDefault(object): if not isinstance(other, TypeHolderDefault): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, TypeHolderDefault): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_example.py b/samples/client/petstore/python/petstore_api/models/type_holder_example.py index 745fe95da2c..34481fd21e3 100644 --- a/samples/client/petstore/python/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python/petstore_api/models/type_holder_example.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class TypeHolderExample(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class TypeHolderExample(object): 'array_item': 'array_item' } - def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None): # noqa: E501 + def __init__(self, string_item=None, number_item=None, float_item=None, integer_item=None, bool_item=None, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderExample - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._string_item = None self._number_item = None @@ -84,7 +89,7 @@ class TypeHolderExample(object): :param string_item: The string_item of this TypeHolderExample. # noqa: E501 :type: str """ - if string_item is None: + if self.local_vars_configuration.client_side_validation and string_item is None: # noqa: E501 raise ValueError("Invalid value for `string_item`, must not be `None`") # noqa: E501 self._string_item = string_item @@ -107,7 +112,7 @@ class TypeHolderExample(object): :param number_item: The number_item of this TypeHolderExample. # noqa: E501 :type: float """ - if number_item is None: + if self.local_vars_configuration.client_side_validation and number_item is None: # noqa: E501 raise ValueError("Invalid value for `number_item`, must not be `None`") # noqa: E501 self._number_item = number_item @@ -130,7 +135,7 @@ class TypeHolderExample(object): :param float_item: The float_item of this TypeHolderExample. # noqa: E501 :type: float """ - if float_item is None: + if self.local_vars_configuration.client_side_validation and float_item is None: # noqa: E501 raise ValueError("Invalid value for `float_item`, must not be `None`") # noqa: E501 self._float_item = float_item @@ -153,7 +158,7 @@ class TypeHolderExample(object): :param integer_item: The integer_item of this TypeHolderExample. # noqa: E501 :type: int """ - if integer_item is None: + if self.local_vars_configuration.client_side_validation and integer_item is None: # noqa: E501 raise ValueError("Invalid value for `integer_item`, must not be `None`") # noqa: E501 self._integer_item = integer_item @@ -176,7 +181,7 @@ class TypeHolderExample(object): :param bool_item: The bool_item of this TypeHolderExample. # noqa: E501 :type: bool """ - if bool_item is None: + if self.local_vars_configuration.client_side_validation and bool_item is None: # noqa: E501 raise ValueError("Invalid value for `bool_item`, must not be `None`") # noqa: E501 self._bool_item = bool_item @@ -199,7 +204,7 @@ class TypeHolderExample(object): :param array_item: The array_item of this TypeHolderExample. # noqa: E501 :type: list[int] """ - if array_item is None: + if self.local_vars_configuration.client_side_validation and array_item is None: # noqa: E501 raise ValueError("Invalid value for `array_item`, must not be `None`") # noqa: E501 self._array_item = array_item @@ -241,8 +246,11 @@ class TypeHolderExample(object): if not isinstance(other, TypeHolderExample): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, TypeHolderExample): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/user.py b/samples/client/petstore/python/petstore_api/models/user.py index f46f5165dfd..de88bda4cde 100644 --- a/samples/client/petstore/python/petstore_api/models/user.py +++ b/samples/client/petstore/python/petstore_api/models/user.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class User(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -52,8 +54,11 @@ class User(object): 'user_status': 'userStatus' } - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501 """User - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._username = None @@ -289,8 +294,11 @@ class User(object): if not isinstance(other, User): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, User): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/xml_item.py b/samples/client/petstore/python/petstore_api/models/xml_item.py index eaceeb5ef45..52ecc9aa522 100644 --- a/samples/client/petstore/python/petstore_api/models/xml_item.py +++ b/samples/client/petstore/python/petstore_api/models/xml_item.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class XmlItem(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -94,8 +96,11 @@ class XmlItem(object): 'prefix_ns_wrapped_array': 'prefix_ns_wrapped_array' } - def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None): # noqa: E501 + def __init__(self, attribute_string=None, attribute_number=None, attribute_integer=None, attribute_boolean=None, wrapped_array=None, name_string=None, name_number=None, name_integer=None, name_boolean=None, name_array=None, name_wrapped_array=None, prefix_string=None, prefix_number=None, prefix_integer=None, prefix_boolean=None, prefix_array=None, prefix_wrapped_array=None, namespace_string=None, namespace_number=None, namespace_integer=None, namespace_boolean=None, namespace_array=None, namespace_wrapped_array=None, prefix_ns_string=None, prefix_ns_number=None, prefix_ns_integer=None, prefix_ns_boolean=None, prefix_ns_array=None, prefix_ns_wrapped_array=None, local_vars_configuration=None): # noqa: E501 """XmlItem - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._attribute_string = None self._attribute_number = None @@ -833,8 +838,11 @@ class XmlItem(object): if not isinstance(other, XmlItem): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, XmlItem): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 07cf6defd82..6f3925c1ab6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -103,8 +103,8 @@ class AnotherFakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client' is set - if ('client' not in local_var_params or - local_var_params['client'] is None): + if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 + local_var_params['client'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `client` when calling `call_123_test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index ee3d0723576..b4247c90c74 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -633,8 +633,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'file_schema_test_class' is set - if ('file_schema_test_class' not in local_var_params or - local_var_params['file_schema_test_class'] is None): + if self.api_client.client_side_validation and ('file_schema_test_class' not in local_var_params or # noqa: E501 + local_var_params['file_schema_test_class'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `file_schema_test_class` when calling `test_body_with_file_schema`") # noqa: E501 collection_formats = {} @@ -741,12 +741,12 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'query' is set - if ('query' not in local_var_params or - local_var_params['query'] is None): + if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501 + local_var_params['query'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): + if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 + local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -855,8 +855,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client' is set - if ('client' not in local_var_params or - local_var_params['client'] is None): + if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 + local_var_params['client'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `client` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -993,49 +993,49 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'number' is set - if ('number' not in local_var_params or - local_var_params['number'] is None): + if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501 + local_var_params['number'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if ('double' not in local_var_params or - local_var_params['double'] is None): + if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501 + local_var_params['double'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in local_var_params or - local_var_params['pattern_without_delimiter'] is None): + if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501 + local_var_params['pattern_without_delimiter'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if ('byte' not in local_var_params or - local_var_params['byte'] is None): + if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501 + local_var_params['byte'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 + if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 + if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] < 32.1: # noqa: E501 raise ApiValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 + if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] > 123.4: # noqa: E501 raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 + if self.api_client.client_side_validation and 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501 raise ApiValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 + if self.api_client.client_side_validation and 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501 raise ApiValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 + if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501 raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 + if self.api_client.client_side_validation and 'integer' in local_var_params and local_var_params['integer'] < 10: # noqa: E501 raise ApiValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 + if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] > 200: # noqa: E501 raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 + if self.api_client.client_side_validation and 'int32' in local_var_params and local_var_params['int32'] < 20: # noqa: E501 raise ApiValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 + if self.api_client.client_side_validation and 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501 raise ApiValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 + if self.api_client.client_side_validation and 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501 raise ApiValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if ('password' in local_var_params and - len(local_var_params['password']) > 64): + if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 + len(local_var_params['password']) > 64): # noqa: E501 raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if ('password' in local_var_params and - len(local_var_params['password']) < 10): + if self.api_client.client_side_validation and ('password' in local_var_params and # noqa: E501 + len(local_var_params['password']) < 10): # noqa: E501 raise ApiValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 collection_formats = {} @@ -1312,16 +1312,16 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'required_string_group' is set - if ('required_string_group' not in local_var_params or - local_var_params['required_string_group'] is None): + if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501 + local_var_params['required_string_group'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_boolean_group' is set - if ('required_boolean_group' not in local_var_params or - local_var_params['required_boolean_group'] is None): + if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501 + local_var_params['required_boolean_group'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_int64_group' is set - if ('required_int64_group' not in local_var_params or - local_var_params['required_int64_group'] is None): + if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501 + local_var_params['required_int64_group'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 collection_formats = {} @@ -1432,8 +1432,8 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'request_body' is set - if ('request_body' not in local_var_params or - local_var_params['request_body'] is None): + if self.api_client.client_side_validation and ('request_body' not in local_var_params or # noqa: E501 + local_var_params['request_body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `request_body` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -1540,12 +1540,12 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in local_var_params or - local_var_params['param'] is None): + if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 + local_var_params['param'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if ('param2' not in local_var_params or - local_var_params['param2'] is None): + if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501 + local_var_params['param2'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -1662,24 +1662,24 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pipe' is set - if ('pipe' not in local_var_params or - local_var_params['pipe'] is None): + if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501 + local_var_params['pipe'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'ioutil' is set - if ('ioutil' not in local_var_params or - local_var_params['ioutil'] is None): + if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501 + local_var_params['ioutil'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'http' is set - if ('http' not in local_var_params or - local_var_params['http'] is None): + if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501 + local_var_params['http'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'url' is set - if ('url' not in local_var_params or - local_var_params['url'] is None): + if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501 + local_var_params['url'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'context' is set - if ('context' not in local_var_params or - local_var_params['context'] is None): + if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 + local_var_params['context'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 8446a6d3997..a01b9a7de52 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -103,8 +103,8 @@ class FakeClassnameTags123Api(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client' is set - if ('client' not in local_var_params or - local_var_params['client'] is None): + if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 + local_var_params['client'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 05819b4c13b..af535ad1199 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -107,8 +107,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet' is set - if ('pet' not in local_var_params or - local_var_params['pet'] is None): + if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501 + local_var_params['pet'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -216,8 +216,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -322,8 +322,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'status' is set - if ('status' not in local_var_params or - local_var_params['status'] is None): + if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 + local_var_params['status'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -431,8 +431,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'tags' is set - if ('tags' not in local_var_params or - local_var_params['tags'] is None): + if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501 + local_var_params['tags'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -540,8 +540,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -652,8 +652,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet' is set - if ('pet' not in local_var_params or - local_var_params['pet'] is None): + if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501 + local_var_params['pet'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -763,8 +763,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -877,8 +877,8 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} @@ -995,12 +995,12 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in local_var_params or - local_var_params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 + local_var_params['pet_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 # verify the required parameter 'required_file' is set - if ('required_file' not in local_var_params or - local_var_params['required_file'] is None): + if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501 + local_var_params['required_file'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index 944ea66190c..7ad607fdf32 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -103,8 +103,8 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in local_var_params or - local_var_params['order_id'] is None): + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -307,13 +307,13 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in local_var_params or - local_var_params['order_id'] is None): + if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 + local_var_params['order_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 + if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 + if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1: # noqa: E501 raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} @@ -417,8 +417,8 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order' is set - if ('order' not in local_var_params or - local_var_params['order'] is None): + if self.api_client.client_side_validation and ('order' not in local_var_params or # noqa: E501 + local_var_params['order'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `order` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 62682316ae2..eb2663b7569 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -103,8 +103,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): + if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 + local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -209,8 +209,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): + if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 + local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -315,8 +315,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): + if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 + local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -423,8 +423,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -525,8 +525,8 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -633,12 +633,12 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if ('password' not in local_var_params or - local_var_params['password'] is None): + if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 + local_var_params['password'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -843,12 +843,12 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in local_var_params or - local_var_params['username'] is None): + if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 + local_var_params['username'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'user' is set - if ('user' not in local_var_params or - local_var_params['user'] is None): + if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 + local_var_params['user'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `update_user`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 64e1278b4eb..f9c494a76c3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -77,6 +77,7 @@ class ApiClient(object): self.cookie = cookie # Set default User-Agent. self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation def __del__(self): if self._pool: diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 499d3870a57..d03bd91e197 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -138,6 +138,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): self.retries = None """Adding retries to override urllib3 default value 3 """ + # Disable client side validation + self.client_side_validation = True @property def logger_file(self): diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py index 17cd6af6797..9da151ae829 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class AdditionalPropertiesClass(object): 'map_of_map_property': 'map_of_map_property' } - def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501 + def __init__(self, map_property=None, map_of_map_property=None, local_vars_configuration=None): # noqa: E501 """AdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._map_property = None self._map_of_map_property = None @@ -131,8 +136,11 @@ class AdditionalPropertiesClass(object): if not isinstance(other, AdditionalPropertiesClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 552ef0e8326..65cef1a6088 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Animal(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -45,8 +47,11 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): # noqa: E501 + def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._class_name = None self._color = None @@ -74,7 +79,7 @@ class Animal(object): :param class_name: The class_name of this Animal. # noqa: E501 :type: str """ - if class_name is None: + if self.local_vars_configuration.client_side_validation and class_name is None: # noqa: E501 raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 self._class_name = class_name @@ -143,8 +148,11 @@ class Animal(object): if not isinstance(other, Animal): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Animal): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py index 190c3df3452..24e80d02aea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/api_response.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ApiResponse(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class ApiResponse(object): 'message': 'message' } - def __init__(self, code=None, type=None, message=None): # noqa: E501 + def __init__(self, code=None, type=None, message=None, local_vars_configuration=None): # noqa: E501 """ApiResponse - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._code = None self._type = None @@ -157,8 +162,11 @@ class ApiResponse(object): if not isinstance(other, ApiResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ApiResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index ebf96429801..1f654452077 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ArrayOfArrayOfNumberOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ArrayOfArrayOfNumberOnly(object): 'array_array_number': 'ArrayArrayNumber' } - def __init__(self, array_array_number=None): # noqa: E501 + def __init__(self, array_array_number=None, local_vars_configuration=None): # noqa: E501 """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._array_array_number = None self.discriminator = None @@ -105,8 +110,11 @@ class ArrayOfArrayOfNumberOnly(object): if not isinstance(other, ArrayOfArrayOfNumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py index 8e1837c46bd..27ba1f58e31 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ArrayOfNumberOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ArrayOfNumberOnly(object): 'array_number': 'ArrayNumber' } - def __init__(self, array_number=None): # noqa: E501 + def __init__(self, array_number=None, local_vars_configuration=None): # noqa: E501 """ArrayOfNumberOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._array_number = None self.discriminator = None @@ -105,8 +110,11 @@ class ArrayOfNumberOnly(object): if not isinstance(other, ArrayOfNumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayOfNumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py index f548fef3ee8..f34a372f6f3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/array_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ArrayTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class ArrayTest(object): 'array_array_of_model': 'array_array_of_model' } - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, local_vars_configuration=None): # noqa: E501 """ArrayTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._array_of_string = None self._array_array_of_integer = None @@ -157,8 +162,11 @@ class ArrayTest(object): if not isinstance(other, ArrayTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py index 0da6b77e84d..cef34c5f6dc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/capitalization.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Capitalization(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class Capitalization(object): 'att_name': 'ATT_NAME' } - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, local_vars_configuration=None): # noqa: E501 """Capitalization - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._small_camel = None self._capital_camel = None @@ -237,8 +242,11 @@ class Capitalization(object): if not isinstance(other, Capitalization): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Capitalization): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py index 216e5123538..e39c1c82508 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Cat(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Cat(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): # noqa: E501 + def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 """Cat - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._declawed = None self.discriminator = None @@ -105,8 +110,11 @@ class Cat(object): if not isinstance(other, Cat): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Cat): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/models/cat_all_of.py index 3c90df84ec3..7e90fab9348 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/cat_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/cat_all_of.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class CatAllOf(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class CatAllOf(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): # noqa: E501 + def __init__(self, declawed=None, local_vars_configuration=None): # noqa: E501 """CatAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._declawed = None self.discriminator = None @@ -105,8 +110,11 @@ class CatAllOf(object): if not isinstance(other, CatAllOf): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, CatAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/category.py b/samples/openapi3/client/petstore/python/petstore_api/models/category.py index 0e23c409e50..b47c148953e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Category(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name='default-name'): # noqa: E501 + def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._name = None @@ -90,7 +95,7 @@ class Category(object): :param name: The name of this Category. # noqa: E501 :type: str """ - if name is None: + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -132,8 +137,11 @@ class Category(object): if not isinstance(other, Category): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Category): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py index 88562beff8b..ef6060ffa70 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/class_model.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ClassModel(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ClassModel(object): '_class': '_class' } - def __init__(self, _class=None): # noqa: E501 + def __init__(self, _class=None, local_vars_configuration=None): # noqa: E501 """ClassModel - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.__class = None self.discriminator = None @@ -105,8 +110,11 @@ class ClassModel(object): if not isinstance(other, ClassModel): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ClassModel): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/client.py b/samples/openapi3/client/petstore/python/petstore_api/models/client.py index b7083fd9bd7..ee5dbf1c43a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/client.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Client(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Client(object): 'client': 'client' } - def __init__(self, client=None): # noqa: E501 + def __init__(self, client=None, local_vars_configuration=None): # noqa: E501 """Client - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._client = None self.discriminator = None @@ -105,8 +110,11 @@ class Client(object): if not isinstance(other, Client): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Client): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py index c325cb252c3..eacb63eedb0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Dog(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Dog(object): 'breed': 'breed' } - def __init__(self, breed=None): # noqa: E501 + def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 """Dog - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._breed = None self.discriminator = None @@ -105,8 +110,11 @@ class Dog(object): if not isinstance(other, Dog): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Dog): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python/petstore_api/models/dog_all_of.py index b6328b05589..48e04855708 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/dog_all_of.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/dog_all_of.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class DogAllOf(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class DogAllOf(object): 'breed': 'breed' } - def __init__(self, breed=None): # noqa: E501 + def __init__(self, breed=None, local_vars_configuration=None): # noqa: E501 """DogAllOf - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._breed = None self.discriminator = None @@ -105,8 +110,11 @@ class DogAllOf(object): if not isinstance(other, DogAllOf): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, DogAllOf): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py index 00aa21d04da..481283a05c3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_arrays.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class EnumArrays(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class EnumArrays(object): 'array_enum': 'array_enum' } - def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + def __init__(self, just_symbol=None, array_enum=None, local_vars_configuration=None): # noqa: E501 """EnumArrays - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._just_symbol = None self._array_enum = None @@ -71,7 +76,7 @@ class EnumArrays(object): :type: str """ allowed_values = [">=", "$"] # noqa: E501 - if just_symbol not in allowed_values: + if self.local_vars_configuration.client_side_validation and just_symbol not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 .format(just_symbol, allowed_values) @@ -98,7 +103,8 @@ class EnumArrays(object): :type: list[str] """ allowed_values = ["fish", "crab"] # noqa: E501 - if not set(array_enum).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set(array_enum).issubset(set(allowed_values))): raise ValueError( "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 @@ -144,8 +150,11 @@ class EnumArrays(object): if not isinstance(other, EnumArrays): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumArrays): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py index 3c1aa279755..8bc62757860 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class EnumClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class EnumClass(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """EnumClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class EnumClass(object): if not isinstance(other, EnumClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py index 07b17fe5dab..24ed1b462d0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/enum_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class EnumTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -52,8 +54,11 @@ class EnumTest(object): 'outer_enum_integer_default_value': 'outerEnumIntegerDefaultValue' } - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, outer_enum_integer=None, outer_enum_default_value=None, outer_enum_integer_default_value=None): # noqa: E501 + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, outer_enum_integer=None, outer_enum_default_value=None, outer_enum_integer_default_value=None, local_vars_configuration=None): # noqa: E501 """EnumTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._enum_string = None self._enum_string_required = None @@ -99,7 +104,7 @@ class EnumTest(object): :type: str """ allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_string not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 .format(enum_string, allowed_values) @@ -125,10 +130,10 @@ class EnumTest(object): :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 :type: str """ - if enum_string_required is None: + if self.local_vars_configuration.client_side_validation and enum_string_required is None: # noqa: E501 raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string_required not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_string_required not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 .format(enum_string_required, allowed_values) @@ -155,7 +160,7 @@ class EnumTest(object): :type: int """ allowed_values = [1, -1] # noqa: E501 - if enum_integer not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_integer not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 .format(enum_integer, allowed_values) @@ -182,7 +187,7 @@ class EnumTest(object): :type: float """ allowed_values = [1.1, -1.2] # noqa: E501 - if enum_number not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_number not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 .format(enum_number, allowed_values) @@ -311,8 +316,11 @@ class EnumTest(object): if not isinstance(other, EnumTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file.py b/samples/openapi3/client/petstore/python/petstore_api/models/file.py index 475f86b799f..282df2957e6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class File(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class File(object): 'source_uri': 'sourceURI' } - def __init__(self, source_uri=None): # noqa: E501 + def __init__(self, source_uri=None, local_vars_configuration=None): # noqa: E501 """File - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._source_uri = None self.discriminator = None @@ -107,8 +112,11 @@ class File(object): if not isinstance(other, File): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, File): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py index 9f3b5bdc179..de7f865b47e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/file_schema_test_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class FileSchemaTestClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class FileSchemaTestClass(object): 'files': 'files' } - def __init__(self, file=None, files=None): # noqa: E501 + def __init__(self, file=None, files=None, local_vars_configuration=None): # noqa: E501 """FileSchemaTestClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._file = None self._files = None @@ -131,8 +136,11 @@ class FileSchemaTestClass(object): if not isinstance(other, FileSchemaTestClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, FileSchemaTestClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py index 4368815952d..0a98b8837ca 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Foo(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class Foo(object): 'bar': 'bar' } - def __init__(self, bar='bar'): # noqa: E501 + def __init__(self, bar='bar', local_vars_configuration=None): # noqa: E501 """Foo - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._bar = None self.discriminator = None @@ -105,8 +110,11 @@ class Foo(object): if not isinstance(other, Foo): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Foo): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py index 005e00cdffc..60e64039be5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/format_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class FormatTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -66,8 +68,11 @@ class FormatTest(object): 'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter' } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, pattern_with_digits=None, pattern_with_digits_and_delimiter=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, pattern_with_digits=None, pattern_with_digits_and_delimiter=None, local_vars_configuration=None): # noqa: E501 """FormatTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._integer = None self._int32 = None @@ -131,9 +136,11 @@ class FormatTest(object): :param integer: The integer of this FormatTest. # noqa: E501 :type: int """ - if integer is not None and integer > 100: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + integer is not None and integer > 100): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if integer is not None and integer < 10: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + integer is not None and integer < 10): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 self._integer = integer @@ -156,9 +163,11 @@ class FormatTest(object): :param int32: The int32 of this FormatTest. # noqa: E501 :type: int """ - if int32 is not None and int32 > 200: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + int32 is not None and int32 > 200): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if int32 is not None and int32 < 20: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + int32 is not None and int32 < 20): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 self._int32 = int32 @@ -202,11 +211,13 @@ class FormatTest(object): :param number: The number of this FormatTest. # noqa: E501 :type: float """ - if number is None: + if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if number is not None and number > 543.2: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + number is not None and number > 543.2): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if number is not None and number < 32.1: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + number is not None and number < 32.1): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 self._number = number @@ -229,9 +240,11 @@ class FormatTest(object): :param float: The float of this FormatTest. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + float is not None and float > 987.6): # noqa: E501 raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 - if float is not None and float < 54.3: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + float is not None and float < 54.3): # noqa: E501 raise ValueError("Invalid value for `float`, must be a value greater than or equal to `54.3`") # noqa: E501 self._float = float @@ -254,9 +267,11 @@ class FormatTest(object): :param double: The double of this FormatTest. # noqa: E501 :type: float """ - if double is not None and double > 123.4: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + double is not None and double > 123.4): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if double is not None and double < 67.8: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + double is not None and double < 67.8): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 self._double = double @@ -279,7 +294,8 @@ class FormatTest(object): :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -302,7 +318,7 @@ class FormatTest(object): :param byte: The byte of this FormatTest. # noqa: E501 :type: str """ - if byte is None: + if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 self._byte = byte @@ -346,7 +362,7 @@ class FormatTest(object): :param date: The date of this FormatTest. # noqa: E501 :type: date """ - if date is None: + if self.local_vars_configuration.client_side_validation and date is None: # noqa: E501 raise ValueError("Invalid value for `date`, must not be `None`") # noqa: E501 self._date = date @@ -411,11 +427,13 @@ class FormatTest(object): :param password: The password of this FormatTest. # noqa: E501 :type: str """ - if password is None: + if self.local_vars_configuration.client_side_validation and password is None: # noqa: E501 raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if password is not None and len(password) > 64: + if (self.local_vars_configuration.client_side_validation and + password is not None and len(password) > 64): raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if password is not None and len(password) < 10: + if (self.local_vars_configuration.client_side_validation and + password is not None and len(password) < 10): raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 self._password = password @@ -440,7 +458,8 @@ class FormatTest(object): :param pattern_with_digits: The pattern_with_digits of this FormatTest. # noqa: E501 :type: str """ - if pattern_with_digits is not None and not re.search(r'^\d{10}$', pattern_with_digits): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + pattern_with_digits is not None and not re.search(r'^\d{10}$', pattern_with_digits)): # noqa: E501 raise ValueError(r"Invalid value for `pattern_with_digits`, must be a follow pattern or equal to `/^\d{10}$/`") # noqa: E501 self._pattern_with_digits = pattern_with_digits @@ -465,7 +484,8 @@ class FormatTest(object): :param pattern_with_digits_and_delimiter: The pattern_with_digits_and_delimiter of this FormatTest. # noqa: E501 :type: str """ - if pattern_with_digits_and_delimiter is not None and not re.search(r'^image_\d{1,3}$', pattern_with_digits_and_delimiter, flags=re.IGNORECASE): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + pattern_with_digits_and_delimiter is not None and not re.search(r'^image_\d{1,3}$', pattern_with_digits_and_delimiter, flags=re.IGNORECASE)): # noqa: E501 raise ValueError(r"Invalid value for `pattern_with_digits_and_delimiter`, must be a follow pattern or equal to `/^image_\d{1,3}$/i`") # noqa: E501 self._pattern_with_digits_and_delimiter = pattern_with_digits_and_delimiter @@ -507,8 +527,11 @@ class FormatTest(object): if not isinstance(other, FormatTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, FormatTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py index 7c8d921a2d8..5fc2f8a9ebd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class HasOnlyReadOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class HasOnlyReadOnly(object): 'foo': 'foo' } - def __init__(self, bar=None, foo=None): # noqa: E501 + def __init__(self, bar=None, foo=None, local_vars_configuration=None): # noqa: E501 """HasOnlyReadOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._bar = None self._foo = None @@ -131,8 +136,11 @@ class HasOnlyReadOnly(object): if not isinstance(other, HasOnlyReadOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, HasOnlyReadOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py index c7051c31c5c..7c62a43ef7a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/health_check_result.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class HealthCheckResult(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class HealthCheckResult(object): 'nullable_message': 'NullableMessage' } - def __init__(self, nullable_message=None): # noqa: E501 + def __init__(self, nullable_message=None, local_vars_configuration=None): # noqa: E501 """HealthCheckResult - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._nullable_message = None self.discriminator = None @@ -104,8 +109,11 @@ class HealthCheckResult(object): if not isinstance(other, HealthCheckResult): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, HealthCheckResult): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object.py index 39eba7c59aa..0ac70b16a32 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineObject(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class InlineObject(object): 'status': 'status' } - def __init__(self, name=None, status=None): # noqa: E501 + def __init__(self, name=None, status=None, local_vars_configuration=None): # noqa: E501 """InlineObject - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self._status = None @@ -135,8 +140,11 @@ class InlineObject(object): if not isinstance(other, InlineObject): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineObject): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object1.py index b354a352a50..300af445d03 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object1.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object1.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineObject1(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class InlineObject1(object): 'file': 'file' } - def __init__(self, additional_metadata=None, file=None): # noqa: E501 + def __init__(self, additional_metadata=None, file=None, local_vars_configuration=None): # noqa: E501 """InlineObject1 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._additional_metadata = None self._file = None @@ -135,8 +140,11 @@ class InlineObject1(object): if not isinstance(other, InlineObject1): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineObject1): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py index 88032d774a3..4e30b86dc22 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineObject2(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class InlineObject2(object): 'enum_form_string': 'enum_form_string' } - def __init__(self, enum_form_string_array=None, enum_form_string='-efg'): # noqa: E501 + def __init__(self, enum_form_string_array=None, enum_form_string='-efg', local_vars_configuration=None): # noqa: E501 """InlineObject2 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._enum_form_string_array = None self._enum_form_string = None @@ -73,7 +78,8 @@ class InlineObject2(object): :type: list[str] """ allowed_values = [">", "$"] # noqa: E501 - if not set(enum_form_string_array).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set(enum_form_string_array).issubset(set(allowed_values))): raise ValueError( "Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(enum_form_string_array) - set(allowed_values))), # noqa: E501 @@ -103,7 +109,7 @@ class InlineObject2(object): :type: str """ allowed_values = ["_abc", "-efg", "(xyz)"] # noqa: E501 - if enum_form_string not in allowed_values: + if self.local_vars_configuration.client_side_validation and enum_form_string not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `enum_form_string` ({0}), must be one of {1}" # noqa: E501 .format(enum_form_string, allowed_values) @@ -148,8 +154,11 @@ class InlineObject2(object): if not isinstance(other, InlineObject2): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineObject2): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object3.py index 843136bf6bf..9870a922b2b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object3.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object3.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineObject3(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -64,8 +66,11 @@ class InlineObject3(object): 'callback': 'callback' } - def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, date=None, date_time=None, password=None, callback=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, date=None, date_time=None, password=None, callback=None, local_vars_configuration=None): # noqa: E501 """InlineObject3 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._integer = None self._int32 = None @@ -128,9 +133,11 @@ class InlineObject3(object): :param integer: The integer of this InlineObject3. # noqa: E501 :type: int """ - if integer is not None and integer > 100: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + integer is not None and integer > 100): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if integer is not None and integer < 10: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + integer is not None and integer < 10): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 self._integer = integer @@ -155,9 +162,11 @@ class InlineObject3(object): :param int32: The int32 of this InlineObject3. # noqa: E501 :type: int """ - if int32 is not None and int32 > 200: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + int32 is not None and int32 > 200): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if int32 is not None and int32 < 20: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + int32 is not None and int32 < 20): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 self._int32 = int32 @@ -205,11 +214,13 @@ class InlineObject3(object): :param number: The number of this InlineObject3. # noqa: E501 :type: float """ - if number is None: + if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501 raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if number is not None and number > 543.2: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + number is not None and number > 543.2): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if number is not None and number < 32.1: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + number is not None and number < 32.1): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 self._number = number @@ -234,7 +245,8 @@ class InlineObject3(object): :param float: The float of this InlineObject3. # noqa: E501 :type: float """ - if float is not None and float > 987.6: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + float is not None and float > 987.6): # noqa: E501 raise ValueError("Invalid value for `float`, must be a value less than or equal to `987.6`") # noqa: E501 self._float = float @@ -259,11 +271,13 @@ class InlineObject3(object): :param double: The double of this InlineObject3. # noqa: E501 :type: float """ - if double is None: + if self.local_vars_configuration.client_side_validation and double is None: # noqa: E501 raise ValueError("Invalid value for `double`, must not be `None`") # noqa: E501 - if double is not None and double > 123.4: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + double is not None and double > 123.4): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if double is not None and double < 67.8: # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + double is not None and double < 67.8): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 self._double = double @@ -288,7 +302,8 @@ class InlineObject3(object): :param string: The string of this InlineObject3. # noqa: E501 :type: str """ - if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -313,9 +328,10 @@ class InlineObject3(object): :param pattern_without_delimiter: The pattern_without_delimiter of this InlineObject3. # noqa: E501 :type: str """ - if pattern_without_delimiter is None: + if self.local_vars_configuration.client_side_validation and pattern_without_delimiter is None: # noqa: E501 raise ValueError("Invalid value for `pattern_without_delimiter`, must not be `None`") # noqa: E501 - if pattern_without_delimiter is not None and not re.search(r'^[A-Z].*', pattern_without_delimiter): # noqa: E501 + if (self.local_vars_configuration.client_side_validation and + pattern_without_delimiter is not None and not re.search(r'^[A-Z].*', pattern_without_delimiter)): # noqa: E501 raise ValueError(r"Invalid value for `pattern_without_delimiter`, must be a follow pattern or equal to `/^[A-Z].*/`") # noqa: E501 self._pattern_without_delimiter = pattern_without_delimiter @@ -340,7 +356,7 @@ class InlineObject3(object): :param byte: The byte of this InlineObject3. # noqa: E501 :type: str """ - if byte is None: + if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501 raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 self._byte = byte @@ -434,9 +450,11 @@ class InlineObject3(object): :param password: The password of this InlineObject3. # noqa: E501 :type: str """ - if password is not None and len(password) > 64: + if (self.local_vars_configuration.client_side_validation and + password is not None and len(password) > 64): raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if password is not None and len(password) < 10: + if (self.local_vars_configuration.client_side_validation and + password is not None and len(password) < 10): raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 self._password = password @@ -501,8 +519,11 @@ class InlineObject3(object): if not isinstance(other, InlineObject3): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineObject3): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object4.py index 4b817111926..a4ecb978d0a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object4.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object4.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineObject4(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class InlineObject4(object): 'param2': 'param2' } - def __init__(self, param=None, param2=None): # noqa: E501 + def __init__(self, param=None, param2=None, local_vars_configuration=None): # noqa: E501 """InlineObject4 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._param = None self._param2 = None @@ -70,7 +75,7 @@ class InlineObject4(object): :param param: The param of this InlineObject4. # noqa: E501 :type: str """ - if param is None: + if self.local_vars_configuration.client_side_validation and param is None: # noqa: E501 raise ValueError("Invalid value for `param`, must not be `None`") # noqa: E501 self._param = param @@ -95,7 +100,7 @@ class InlineObject4(object): :param param2: The param2 of this InlineObject4. # noqa: E501 :type: str """ - if param2 is None: + if self.local_vars_configuration.client_side_validation and param2 is None: # noqa: E501 raise ValueError("Invalid value for `param2`, must not be `None`") # noqa: E501 self._param2 = param2 @@ -137,8 +142,11 @@ class InlineObject4(object): if not isinstance(other, InlineObject4): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineObject4): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object5.py index bdc63b3ab20..2badeb2274c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object5.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object5.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineObject5(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class InlineObject5(object): 'required_file': 'requiredFile' } - def __init__(self, additional_metadata=None, required_file=None): # noqa: E501 + def __init__(self, additional_metadata=None, required_file=None, local_vars_configuration=None): # noqa: E501 """InlineObject5 - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._additional_metadata = None self._required_file = None @@ -94,7 +99,7 @@ class InlineObject5(object): :param required_file: The required_file of this InlineObject5. # noqa: E501 :type: file """ - if required_file is None: + if self.local_vars_configuration.client_side_validation and required_file is None: # noqa: E501 raise ValueError("Invalid value for `required_file`, must not be `None`") # noqa: E501 self._required_file = required_file @@ -136,8 +141,11 @@ class InlineObject5(object): if not isinstance(other, InlineObject5): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineObject5): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_response_default.py index 434ebdfb089..3904d39c9cc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_response_default.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_response_default.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class InlineResponseDefault(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class InlineResponseDefault(object): 'string': 'string' } - def __init__(self, string=None): # noqa: E501 + def __init__(self, string=None, local_vars_configuration=None): # noqa: E501 """InlineResponseDefault - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._string = None self.discriminator = None @@ -105,8 +110,11 @@ class InlineResponseDefault(object): if not isinstance(other, InlineResponseDefault): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, InlineResponseDefault): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/list.py b/samples/openapi3/client/petstore/python/petstore_api/models/list.py index 74fc3719aa0..d58d13e90fb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/list.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class List(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class List(object): '_123_list': '123-list' } - def __init__(self, _123_list=None): # noqa: E501 + def __init__(self, _123_list=None, local_vars_configuration=None): # noqa: E501 """List - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.__123_list = None self.discriminator = None @@ -105,8 +110,11 @@ class List(object): if not isinstance(other, List): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, List): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py index cdfb9365297..b170dce412c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/map_test.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class MapTest(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -44,8 +46,11 @@ class MapTest(object): 'indirect_map': 'indirect_map' } - def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None): # noqa: E501 + def __init__(self, map_map_of_string=None, map_of_enum_string=None, direct_map=None, indirect_map=None, local_vars_configuration=None): # noqa: E501 """MapTest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._map_map_of_string = None self._map_of_enum_string = None @@ -102,7 +107,8 @@ class MapTest(object): :type: dict(str, str) """ allowed_values = ["UPPER", "lower"] # noqa: E501 - if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + if (self.local_vars_configuration.client_side_validation and + not set(map_of_enum_string.keys()).issubset(set(allowed_values))): raise ValueError( "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 @@ -190,8 +196,11 @@ class MapTest(object): if not isinstance(other, MapTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, MapTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index 41a916eac10..5da34f8830e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class MixedPropertiesAndAdditionalPropertiesClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): 'map': 'map' } - def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + def __init__(self, uuid=None, date_time=None, map=None, local_vars_configuration=None): # noqa: E501 """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._uuid = None self._date_time = None @@ -157,8 +162,11 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py index 563b82b5939..841ce1f18f3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model200_response.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Model200Response(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Model200Response(object): '_class': 'class' } - def __init__(self, name=None, _class=None): # noqa: E501 + def __init__(self, name=None, _class=None, local_vars_configuration=None): # noqa: E501 """Model200Response - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self.__class = None @@ -131,8 +136,11 @@ class Model200Response(object): if not isinstance(other, Model200Response): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Model200Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py index 09801201598..fdd8d72314a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/model_return.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ModelReturn(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class ModelReturn(object): '_return': 'return' } - def __init__(self, _return=None): # noqa: E501 + def __init__(self, _return=None, local_vars_configuration=None): # noqa: E501 """ModelReturn - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.__return = None self.discriminator = None @@ -105,8 +110,11 @@ class ModelReturn(object): if not isinstance(other, ModelReturn): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ModelReturn): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/name.py b/samples/openapi3/client/petstore/python/petstore_api/models/name.py index 43014d0fb64..bb2c1fbd73c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/name.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Name(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -44,8 +46,11 @@ class Name(object): '_123_number': '123Number' } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, local_vars_configuration=None): # noqa: E501 """Name - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._name = None self._snake_case = None @@ -79,7 +84,7 @@ class Name(object): :param name: The name of this Name. # noqa: E501 :type: int """ - if name is None: + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -184,8 +189,11 @@ class Name(object): if not isinstance(other, Name): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Name): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py index b589850f458..b81eb554e91 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/nullable_class.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class NullableClass(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -60,8 +62,11 @@ class NullableClass(object): 'object_items_nullable': 'object_items_nullable' } - def __init__(self, integer_prop=None, number_prop=None, boolean_prop=None, string_prop=None, date_prop=None, datetime_prop=None, array_nullable_prop=None, array_and_items_nullable_prop=None, array_items_nullable=None, object_nullable_prop=None, object_and_items_nullable_prop=None, object_items_nullable=None): # noqa: E501 + def __init__(self, integer_prop=None, number_prop=None, boolean_prop=None, string_prop=None, date_prop=None, datetime_prop=None, array_nullable_prop=None, array_and_items_nullable_prop=None, array_items_nullable=None, object_nullable_prop=None, object_and_items_nullable_prop=None, object_items_nullable=None, local_vars_configuration=None): # noqa: E501 """NullableClass - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._integer_prop = None self._number_prop = None @@ -381,8 +386,11 @@ class NullableClass(object): if not isinstance(other, NullableClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, NullableClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py index b6f3d1c1b65..99b2424852f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/number_only.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class NumberOnly(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class NumberOnly(object): 'just_number': 'JustNumber' } - def __init__(self, just_number=None): # noqa: E501 + def __init__(self, just_number=None, local_vars_configuration=None): # noqa: E501 """NumberOnly - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._just_number = None self.discriminator = None @@ -105,8 +110,11 @@ class NumberOnly(object): if not isinstance(other, NumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, NumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/order.py b/samples/openapi3/client/petstore/python/petstore_api/models/order.py index 8b64e3a3583..8c863cce8fe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/order.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Order(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class Order(object): 'complete': 'complete' } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, local_vars_configuration=None): # noqa: E501 """Order - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._pet_id = None @@ -177,7 +182,7 @@ class Order(object): :type: str """ allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -243,8 +248,11 @@ class Order(object): if not isinstance(other, Order): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Order): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py index dccd67055be..c11859114a5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_composite.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterComposite(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -42,8 +44,11 @@ class OuterComposite(object): 'my_boolean': 'my_boolean' } - def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + def __init__(self, my_number=None, my_string=None, my_boolean=None, local_vars_configuration=None): # noqa: E501 """OuterComposite - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._my_number = None self._my_string = None @@ -157,8 +162,11 @@ class OuterComposite(object): if not isinstance(other, OuterComposite): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterComposite): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py index a6697a0b152..8fbfeb7aaea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterEnum(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class OuterEnum(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """OuterEnum - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class OuterEnum(object): if not isinstance(other, OuterEnum): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterEnum): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py index 30824a6587e..881edd1384f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_default_value.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterEnumDefaultValue(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class OuterEnumDefaultValue(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """OuterEnumDefaultValue - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class OuterEnumDefaultValue(object): if not isinstance(other, OuterEnumDefaultValue): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterEnumDefaultValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py index 59edabdd20f..8e6d0c44b08 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterEnumInteger(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class OuterEnumInteger(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """OuterEnumInteger - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class OuterEnumInteger(object): if not isinstance(other, OuterEnumInteger): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterEnumInteger): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py index 488fd986ef1..943ad3b596c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/outer_enum_integer_default_value.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class OuterEnumIntegerDefaultValue(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -43,8 +45,11 @@ class OuterEnumIntegerDefaultValue(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, local_vars_configuration=None): # noqa: E501 """OuterEnumIntegerDefaultValue - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self.discriminator = None def to_dict(self): @@ -84,8 +89,11 @@ class OuterEnumIntegerDefaultValue(object): if not isinstance(other, OuterEnumIntegerDefaultValue): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterEnumIntegerDefaultValue): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py index 870608e17ac..edbf73f5312 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pet.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Pet(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -48,8 +50,11 @@ class Pet(object): 'status': 'status' } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, local_vars_configuration=None): # noqa: E501 """Pet - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._category = None @@ -130,7 +135,7 @@ class Pet(object): :param name: The name of this Pet. # noqa: E501 :type: str """ - if name is None: + if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -153,7 +158,7 @@ class Pet(object): :param photo_urls: The photo_urls of this Pet. # noqa: E501 :type: list[str] """ - if photo_urls is None: + if self.local_vars_configuration.client_side_validation and photo_urls is None: # noqa: E501 raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 self._photo_urls = photo_urls @@ -200,7 +205,7 @@ class Pet(object): :type: str """ allowed_values = ["available", "pending", "sold"] # noqa: E501 - if status not in allowed_values: + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -245,8 +250,11 @@ class Pet(object): if not isinstance(other, Pet): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Pet): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py index 3dfb7c7f626..a84679e98de 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/read_only_first.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class ReadOnlyFirst(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class ReadOnlyFirst(object): 'baz': 'baz' } - def __init__(self, bar=None, baz=None): # noqa: E501 + def __init__(self, bar=None, baz=None, local_vars_configuration=None): # noqa: E501 """ReadOnlyFirst - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._bar = None self._baz = None @@ -131,8 +136,11 @@ class ReadOnlyFirst(object): if not isinstance(other, ReadOnlyFirst): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ReadOnlyFirst): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py index 2fd6378fcdc..396e75bcee5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/special_model_name.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class SpecialModelName(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -38,8 +40,11 @@ class SpecialModelName(object): 'special_property_name': '$special[property.name]' } - def __init__(self, special_property_name=None): # noqa: E501 + def __init__(self, special_property_name=None, local_vars_configuration=None): # noqa: E501 """SpecialModelName - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._special_property_name = None self.discriminator = None @@ -105,8 +110,11 @@ class SpecialModelName(object): if not isinstance(other, SpecialModelName): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SpecialModelName): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py index cb9c22d9f53..d6137fdd47f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/tag.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class Tag(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -40,8 +42,11 @@ class Tag(object): 'name': 'name' } - def __init__(self, id=None, name=None): # noqa: E501 + def __init__(self, id=None, name=None, local_vars_configuration=None): # noqa: E501 """Tag - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._name = None @@ -131,8 +136,11 @@ class Tag(object): if not isinstance(other, Tag): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Tag): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/user.py b/samples/openapi3/client/petstore/python/petstore_api/models/user.py index f46f5165dfd..de88bda4cde 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/user.py @@ -15,6 +15,8 @@ import re # noqa: F401 import six +from petstore_api.configuration import Configuration + class User(object): """NOTE: This class is auto generated by OpenAPI Generator. @@ -52,8 +54,11 @@ class User(object): 'user_status': 'userStatus' } - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, local_vars_configuration=None): # noqa: E501 """User - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration self._id = None self._username = None @@ -289,8 +294,11 @@ class User(object): if not isinstance(other, User): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, User): + return True + + return self.to_dict() != other.to_dict()