From 6e250489e304bbe7c9bf0c36e80ba10c3bb37025 Mon Sep 17 00:00:00 2001 From: Jesse Myers Date: Tue, 22 Aug 2023 09:19:18 -0700 Subject: [PATCH 1/4] python: several typing and style improvements The generated (python) code fails with several standard validation tools, including `flake8`, `mypy`, and `autoflake`. While fixing every possible violation -- especially wrto typing -- woudl be a project, some of the changes are fairly easy. - The `autoflake` tool picks up on unused imports. These can just be removed. - The `mypy` tool picks up on numerious typing violations, especially if set to its strictest mode. As a starting point, all functions ought to annotate a return type, including constructors, even if the return type is `None` because otherwise the functions are omitted from type checking and it's impossible to make incremental progress towards adding types. - The `flake8` tool mostly finds whitespace and line-length issues; while line-length standards very, the source already includes several flake8 ignores, so it seems safe to add a few more. --- .../src/main/resources/python/api.mustache | 20 +++++++++---------- .../main/resources/python/api_client.mustache | 6 +++--- .../resources/python/api_response.mustache | 2 +- .../main/resources/python/api_test.mustache | 10 ++++------ .../resources/python/asyncio/rest.mustache | 6 +++--- .../resources/python/configuration.mustache | 8 ++++---- .../main/resources/python/exceptions.mustache | 20 +++++++++---------- .../resources/python/model_anyof.mustache | 4 ++-- .../resources/python/model_oneof.mustache | 4 ++-- .../main/resources/python/model_test.mustache | 12 +++++------ .../src/main/resources/python/rest.mustache | 6 +++--- .../main/resources/python/signing.mustache | 4 ++-- .../resources/python/tornado/rest.mustache | 6 +++--- 13 files changed, 52 insertions(+), 56 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 913e0dbbb28d..b92cf17e2275 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -6,8 +6,7 @@ import re # noqa: F401 import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated{{#asyncio}} +from pydantic import validate_arguments{{#asyncio}} from typing import overload, Optional, Union, Awaitable{{/asyncio}} {{#imports}} @@ -23,14 +22,14 @@ from {{packageName}}.exceptions import ( # noqa: F401 {{#operations}} -class {{classname}}(object): +class {{classname}}: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -65,10 +64,10 @@ class {{classname}}(object): {{/allParams}} :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -76,7 +75,8 @@ class {{classname}}(object): """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the {{operationId}}_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the {{operationId}}_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) {{#asyncio}} if async_req is not None: kwargs['async_req'] = async_req @@ -103,7 +103,7 @@ class {{classname}}(object): :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional 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 95fef884bc13..d68552715e59 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -24,7 +24,7 @@ from {{packageName}} import rest from {{packageName}}.exceptions import ApiValueError, ApiException -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -56,7 +56,7 @@ class ApiClient(object): _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + cookie=None, pool_threads=1) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() @@ -345,7 +345,7 @@ class ApiClient(object): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): sub_kls = re.match(r'List\[(.*)]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) diff --git a/modules/openapi-generator/src/main/resources/python/api_response.mustache b/modules/openapi-generator/src/main/resources/python/api_response.mustache index d81c2ff58477..a0b62b95246c 100644 --- a/modules/openapi-generator/src/main/resources/python/api_response.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_response.mustache @@ -18,7 +18,7 @@ class ApiResponse: status_code=None, headers=None, data=None, - raw_data=None): + raw_data=None) -> None: self.status_code = status_code self.headers = headers self.data = data diff --git a/modules/openapi-generator/src/main/resources/python/api_test.mustache b/modules/openapi-generator/src/main/resources/python/api_test.mustache index c3bbe4b822f8..ad2b8a63fe17 100644 --- a/modules/openapi-generator/src/main/resources/python/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_test.mustache @@ -4,22 +4,20 @@ import unittest -import {{packageName}} from {{apiPackage}}.{{classFilename}} import {{classname}} # noqa: E501 -from {{packageName}}.rest import ApiException class {{#operations}}Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" - def setUp(self): - self.api = {{apiPackage}}.{{classFilename}}.{{classname}}() # noqa: E501 + def setUp(self) -> None: + self.api = {{classname}}() # noqa: E501 - def tearDown(self): + def tearDown(self) -> None: pass {{#operation}} - def test_{{operationId}}(self): + def test_{{operationId}}(self) -> None: """Test case for {{{operationId}}} {{#summary}} diff --git a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache index 98c811e513e0..c97788d0c5cc 100644 --- a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) class RESTResponse(io.IOBase): - def __init__(self, resp, data): + def __init__(self, resp, data) -> None: self.aiohttp_response = resp self.status = resp.status self.reason = resp.reason @@ -33,9 +33,9 @@ class RESTResponse(io.IOBase): return self.aiohttp_response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # maxsize is number of requests to host that are allowed in parallel if maxsize is None: diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index ac51800bab8d..c3799c0c5e0d 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -11,7 +11,6 @@ import sys import urllib3 import http.client as httplib -from {{packageName}}.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -19,7 +18,7 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): +class Configuration: """This class contains various settings of the API client. :param host: Base url. @@ -45,7 +44,8 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. @@ -146,7 +146,7 @@ conf = {{{packageName}}}.Configuration( server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor """ self._base_path = "{{{basePath}}}" if host is None else host diff --git a/modules/openapi-generator/src/main/resources/python/exceptions.mustache b/modules/openapi-generator/src/main/resources/python/exceptions.mustache index baee9004b1ea..8a155a9fe08e 100644 --- a/modules/openapi-generator/src/main/resources/python/exceptions.mustache +++ b/modules/openapi-generator/src/main/resources/python/exceptions.mustache @@ -8,7 +8,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -36,7 +36,7 @@ class ApiTypeError(OpenApiException, TypeError): class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -54,7 +54,7 @@ class ApiValueError(OpenApiException, ValueError): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -73,7 +73,7 @@ class ApiAttributeError(OpenApiException, AttributeError): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -91,7 +91,7 @@ class ApiKeyError(OpenApiException, KeyError): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: if http_resp: self.status = http_resp.status self.reason = http_resp.reason @@ -118,30 +118,30 @@ class ApiException(OpenApiException): class BadRequestException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/modules/openapi-generator/src/main/resources/python/model_anyof.mustache b/modules/openapi-generator/src/main/resources/python/model_anyof.mustache index 74a007fbc192..adec7c418683 100644 --- a/modules/openapi-generator/src/main/resources/python/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_anyof.mustache @@ -40,7 +40,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} } {{/discriminator}} - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -177,4 +177,4 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{{.}}} {{/vendorExtensions.x-py-postponed-model-imports}} {{classname}}.update_forward_refs() -{{/vendorExtensions.x-py-postponed-model-imports.size}} \ No newline at end of file +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/modules/openapi-generator/src/main/resources/python/model_oneof.mustache b/modules/openapi-generator/src/main/resources/python/model_oneof.mustache index c7afad4d172b..2f23bade3418 100644 --- a/modules/openapi-generator/src/main/resources/python/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_oneof.mustache @@ -39,7 +39,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} } {{/discriminator}} - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -203,4 +203,4 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}} {{{.}}} {{/vendorExtensions.x-py-postponed-model-imports}} {{classname}}.update_forward_refs() -{{/vendorExtensions.x-py-postponed-model-imports.size}} \ No newline at end of file +{{/vendorExtensions.x-py-postponed-model-imports.size}} diff --git a/modules/openapi-generator/src/main/resources/python/model_test.mustache b/modules/openapi-generator/src/main/resources/python/model_test.mustache index 93ebf99b14fb..2c7fa1f132cc 100644 --- a/modules/openapi-generator/src/main/resources/python/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_test.mustache @@ -7,9 +7,7 @@ import datetime {{#models}} {{#model}} -import {{packageName}} from {{modelPackage}}.{{classFilename}} import {{classname}} # noqa: E501 -from {{packageName}}.rest import ApiException class Test{{classname}}(unittest.TestCase): """{{classname}} unit test stubs""" @@ -21,21 +19,21 @@ class Test{{classname}}(unittest.TestCase): pass {{^isEnum}} - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> {{classname}}: """Test {{classname}} include_option is a boolean, when False only required params are included, when True both required and optional params are included """ # uncomment below to create an instance of `{{{classname}}}` """ - model = {{packageName}}.models.{{classFilename}}.{{classname}}() # noqa: E501 - if include_optional : + model = {{classname}}() # noqa: E501 + if include_optional: return {{classname}}( {{#vars}} - {{name}} = {{{example}}}{{^example}}None{{/example}}{{^-last}}, {{/-last}} + {{name}} = {{{example}}}{{^example}}None{{/example}}{{^-last}},{{/-last}} {{/vars}} ) - else : + else: return {{classname}}( {{#vars}} {{#required}} diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index c8748d7a6ef0..f49dee2bed49 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -19,7 +19,7 @@ logger = logging.getLogger(__name__) class RESTResponse(io.IOBase): - def __init__(self, resp): + def __init__(self, resp) -> None: self.urllib3_response = resp self.status = resp.status self.reason = resp.reason @@ -34,9 +34,9 @@ class RESTResponse(io.IOBase): return self.urllib3_response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 diff --git a/modules/openapi-generator/src/main/resources/python/signing.mustache b/modules/openapi-generator/src/main/resources/python/signing.mustache index 8dca7e2d1ff6..bb2850fdcc09 100644 --- a/modules/openapi-generator/src/main/resources/python/signing.mustache +++ b/modules/openapi-generator/src/main/resources/python/signing.mustache @@ -56,7 +56,7 @@ HASH_SHA256 = 'sha256' HASH_SHA512 = 'sha512' -class HttpSigningConfiguration(object): +class HttpSigningConfiguration: """The configuration parameters for the HTTP signature security scheme. The HTTP signature security scheme is used to sign HTTP requests with a private key which is in possession of the API client. @@ -112,7 +112,7 @@ class HttpSigningConfiguration(object): signed_headers=None, signing_algorithm=None, hash_algorithm=None, - signature_max_validity=None): + signature_max_validity=None) -> None: self.key_id = key_id if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) diff --git a/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache index 59f14ffab1ea..6b91cdef986e 100644 --- a/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache @@ -20,7 +20,7 @@ logger = logging.getLogger(__name__) class RESTResponse(io.IOBase): - def __init__(self, resp): + def __init__(self, resp) -> None: self.tornado_response = resp self.status = resp.code self.reason = resp.reason @@ -39,9 +39,9 @@ class RESTResponse(io.IOBase): return self.tornado_response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=4): + def __init__(self, configuration, pools_size=4, maxsize=4) -> None: # maxsize is number of requests to host that are allowed in parallel self.ca_certs = configuration.ssl_ca_cert From 434352e39ba82f828cc5f25ee4cca9f642a946d3 Mon Sep 17 00:00:00 2001 From: Jesse Myers Date: Thu, 24 Aug 2023 18:06:02 -0700 Subject: [PATCH 2/4] Add generated files --- .../python/openapi_client/api/body_api.py | 98 ++++--- .../python/openapi_client/api/form_api.py | 20 +- .../python/openapi_client/api/header_api.py | 20 +- .../python/openapi_client/api/path_api.py | 20 +- .../python/openapi_client/api/query_api.py | 111 ++++---- .../python/openapi_client/api_client.py | 6 +- .../python/openapi_client/api_response.py | 2 +- .../python/openapi_client/configuration.py | 8 +- .../python/openapi_client/exceptions.py | 20 +- .../echo_api/python/openapi_client/rest.py | 6 +- .../petstore_api/api/another_fake_api.py | 20 +- .../petstore_api/api/default_api.py | 20 +- .../petstore_api/api/fake_api.py | 267 ++++++++++-------- .../api/fake_classname_tags123_api.py | 20 +- .../petstore_api/api/pet_api.py | 124 ++++---- .../petstore_api/api/store_api.py | 59 ++-- .../petstore_api/api/user_api.py | 111 ++++---- .../python-aiohttp/petstore_api/api_client.py | 6 +- .../petstore_api/api_response.py | 2 +- .../petstore_api/configuration.py | 8 +- .../python-aiohttp/petstore_api/exceptions.py | 20 +- .../petstore_api/models/any_of_color.py | 2 +- .../petstore_api/models/any_of_pig.py | 2 +- .../petstore_api/models/color.py | 2 +- .../petstore_api/models/int_or_string.py | 2 +- .../petstore_api/models/one_of_enum_string.py | 2 +- .../python-aiohttp/petstore_api/models/pig.py | 2 +- .../python-aiohttp/petstore_api/rest.py | 6 +- .../python-aiohttp/petstore_api/signing.py | 4 +- .../petstore_api/api/another_fake_api.py | 20 +- .../python/petstore_api/api/default_api.py | 20 +- .../python/petstore_api/api/fake_api.py | 267 ++++++++++-------- .../api/fake_classname_tags123_api.py | 20 +- .../python/petstore_api/api/pet_api.py | 124 ++++---- .../python/petstore_api/api/store_api.py | 59 ++-- .../python/petstore_api/api/user_api.py | 111 ++++---- .../python/petstore_api/api_client.py | 6 +- .../python/petstore_api/api_response.py | 2 +- .../python/petstore_api/configuration.py | 8 +- .../python/petstore_api/exceptions.py | 20 +- .../petstore_api/models/any_of_color.py | 2 +- .../python/petstore_api/models/any_of_pig.py | 2 +- .../python/petstore_api/models/color.py | 2 +- .../petstore_api/models/int_or_string.py | 2 +- .../petstore_api/models/one_of_enum_string.py | 2 +- .../python/petstore_api/models/pig.py | 2 +- .../petstore/python/petstore_api/rest.py | 6 +- .../petstore/python/petstore_api/signing.py | 4 +- 48 files changed, 878 insertions(+), 791 deletions(-) diff --git a/samples/client/echo_api/python/openapi_client/api/body_api.py b/samples/client/echo_api/python/openapi_client/api/body_api.py index fa1953cecd30..e6e916b4f795 100644 --- a/samples/client/echo_api/python/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python/openapi_client/api/body_api.py @@ -17,8 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import Field, StrictBytes, StrictStr, conlist @@ -35,14 +34,14 @@ ) -class BodyApi(object): +class BodyApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -60,10 +59,10 @@ def test_binary_gif(self, **kwargs) -> bytearray: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -71,7 +70,8 @@ def test_binary_gif(self, **kwargs) -> bytearray: # noqa: E501 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_binary_gif_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_binary_gif_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_binary_gif_with_http_info(**kwargs) # noqa: E501 @validate_arguments @@ -88,7 +88,7 @@ def test_binary_gif_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -193,10 +193,10 @@ def test_body_application_octetstream_binary(self, body : Optional[Union[StrictB :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -204,7 +204,8 @@ def test_body_application_octetstream_binary(self, body : Optional[Union[StrictB """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_application_octetstream_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_application_octetstream_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_body_application_octetstream_binary_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -223,7 +224,7 @@ def test_body_application_octetstream_binary_with_http_info(self, body : Optiona :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -344,10 +345,10 @@ def test_body_multipart_formdata_array_of_binary(self, files : conlist(Union[Str :type files: List[bytearray] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -355,7 +356,8 @@ def test_body_multipart_formdata_array_of_binary(self, files : conlist(Union[Str """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_multipart_formdata_array_of_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_multipart_formdata_array_of_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_body_multipart_formdata_array_of_binary_with_http_info(files, **kwargs) # noqa: E501 @validate_arguments @@ -374,7 +376,7 @@ def test_body_multipart_formdata_array_of_binary_with_http_info(self, files : co :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -491,10 +493,10 @@ def test_echo_body_free_form_object_response_string(self, body : Annotated[Optio :type body: object :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -502,7 +504,8 @@ def test_echo_body_free_form_object_response_string(self, body : Annotated[Optio """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_echo_body_free_form_object_response_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_echo_body_free_form_object_response_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_echo_body_free_form_object_response_string_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -521,7 +524,7 @@ def test_echo_body_free_form_object_response_string_with_http_info(self, body : :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -637,10 +640,10 @@ def test_echo_body_pet(self, pet : Annotated[Optional[Pet], Field(description="P :type pet: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -648,7 +651,8 @@ def test_echo_body_pet(self, pet : Annotated[Optional[Pet], Field(description="P """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_echo_body_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_echo_body_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_echo_body_pet_with_http_info(pet, **kwargs) # noqa: E501 @validate_arguments @@ -667,7 +671,7 @@ def test_echo_body_pet_with_http_info(self, pet : Annotated[Optional[Pet], Field :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -783,10 +787,10 @@ def test_echo_body_pet_response_string(self, pet : Annotated[Optional[Pet], Fiel :type pet: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -794,7 +798,8 @@ def test_echo_body_pet_response_string(self, pet : Annotated[Optional[Pet], Fiel """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_echo_body_pet_response_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_echo_body_pet_response_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_echo_body_pet_response_string_with_http_info(pet, **kwargs) # noqa: E501 @validate_arguments @@ -813,7 +818,7 @@ def test_echo_body_pet_response_string_with_http_info(self, pet : Annotated[Opti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -929,10 +934,10 @@ def test_echo_body_tag_response_string(self, tag : Annotated[Optional[Tag], Fiel :type tag: Tag :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -940,7 +945,8 @@ def test_echo_body_tag_response_string(self, tag : Annotated[Optional[Tag], Fiel """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_echo_body_tag_response_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_echo_body_tag_response_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_echo_body_tag_response_string_with_http_info(tag, **kwargs) # noqa: E501 @validate_arguments @@ -959,7 +965,7 @@ def test_echo_body_tag_response_string_with_http_info(self, tag : Annotated[Opti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/client/echo_api/python/openapi_client/api/form_api.py b/samples/client/echo_api/python/openapi_client/api/form_api.py index d0cc8730d4f4..20daae3ec3b4 100644 --- a/samples/client/echo_api/python/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python/openapi_client/api/form_api.py @@ -17,8 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import StrictBool, StrictInt, StrictStr @@ -33,14 +32,14 @@ ) -class FormApi(object): +class FormApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -64,10 +63,10 @@ def test_form_integer_boolean_string(self, integer_form : Optional[StrictInt] = :type string_form: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -75,7 +74,8 @@ def test_form_integer_boolean_string(self, integer_form : Optional[StrictInt] = """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_form_integer_boolean_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_form_integer_boolean_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_form_integer_boolean_string_with_http_info(integer_form, boolean_form, string_form, **kwargs) # noqa: E501 @validate_arguments @@ -98,7 +98,7 @@ def test_form_integer_boolean_string_with_http_info(self, integer_form : Optiona :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/client/echo_api/python/openapi_client/api/header_api.py b/samples/client/echo_api/python/openapi_client/api/header_api.py index 4742d4c21748..e5a7e8e67cc7 100644 --- a/samples/client/echo_api/python/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python/openapi_client/api/header_api.py @@ -17,8 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import StrictBool, StrictInt, StrictStr @@ -33,14 +32,14 @@ ) -class HeaderApi(object): +class HeaderApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -64,10 +63,10 @@ def test_header_integer_boolean_string(self, integer_header : Optional[StrictInt :type string_header: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -75,7 +74,8 @@ def test_header_integer_boolean_string(self, integer_header : Optional[StrictInt """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_header_integer_boolean_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_header_integer_boolean_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_header_integer_boolean_string_with_http_info(integer_header, boolean_header, string_header, **kwargs) # noqa: E501 @validate_arguments @@ -98,7 +98,7 @@ def test_header_integer_boolean_string_with_http_info(self, integer_header : Opt :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/client/echo_api/python/openapi_client/api/path_api.py b/samples/client/echo_api/python/openapi_client/api/path_api.py index 12a2a5c8684d..2567e782b9ab 100644 --- a/samples/client/echo_api/python/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python/openapi_client/api/path_api.py @@ -17,8 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import StrictInt, StrictStr @@ -31,14 +30,14 @@ ) -class PathApi(object): +class PathApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -60,10 +59,10 @@ def tests_path_string_path_string_integer_path_integer(self, path_string : Stric :type path_integer: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -71,7 +70,8 @@ def tests_path_string_path_string_integer_path_integer(self, path_string : Stric """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the tests_path_string_path_string_integer_path_integer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the tests_path_string_path_string_integer_path_integer_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.tests_path_string_path_string_integer_path_integer_with_http_info(path_string, path_integer, **kwargs) # noqa: E501 @validate_arguments @@ -92,7 +92,7 @@ def tests_path_string_path_string_integer_path_integer_with_http_info(self, path :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/client/echo_api/python/openapi_client/api/query_api.py b/samples/client/echo_api/python/openapi_client/api/query_api.py index 7d387c1adaf6..d401ccb9a7ba 100644 --- a/samples/client/echo_api/python/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python/openapi_client/api/query_api.py @@ -17,8 +17,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from datetime import date, datetime @@ -38,14 +37,14 @@ ) -class QueryApi(object): +class QueryApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -65,10 +64,10 @@ def test_enum_ref_string(self, enum_ref_string_query : Optional[StringEnumRef] = :type enum_ref_string_query: StringEnumRef :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -76,7 +75,8 @@ def test_enum_ref_string(self, enum_ref_string_query : Optional[StringEnumRef] = """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_enum_ref_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_enum_ref_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_enum_ref_string_with_http_info(enum_ref_string_query, **kwargs) # noqa: E501 @validate_arguments @@ -95,7 +95,7 @@ def test_enum_ref_string_with_http_info(self, enum_ref_string_query : Optional[S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -208,10 +208,10 @@ def test_query_datetime_date_string(self, datetime_query : Optional[datetime] = :type string_query: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -219,7 +219,8 @@ def test_query_datetime_date_string(self, datetime_query : Optional[datetime] = """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_datetime_date_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_datetime_date_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_datetime_date_string_with_http_info(datetime_query, date_query, string_query, **kwargs) # noqa: E501 @validate_arguments @@ -242,7 +243,7 @@ def test_query_datetime_date_string_with_http_info(self, datetime_query : Option :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -369,10 +370,10 @@ def test_query_integer_boolean_string(self, integer_query : Optional[StrictInt] :type string_query: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -380,7 +381,8 @@ def test_query_integer_boolean_string(self, integer_query : Optional[StrictInt] """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_integer_boolean_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_integer_boolean_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_integer_boolean_string_with_http_info(integer_query, boolean_query, string_query, **kwargs) # noqa: E501 @validate_arguments @@ -403,7 +405,7 @@ def test_query_integer_boolean_string_with_http_info(self, integer_query : Optio :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -520,10 +522,10 @@ def test_query_style_deep_object_explode_true_object(self, query_object : Option :type query_object: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -531,7 +533,8 @@ def test_query_style_deep_object_explode_true_object(self, query_object : Option """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_style_deep_object_explode_true_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_style_deep_object_explode_true_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_style_deep_object_explode_true_object_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments @@ -550,7 +553,7 @@ def test_query_style_deep_object_explode_true_object_with_http_info(self, query_ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -659,10 +662,10 @@ def test_query_style_deep_object_explode_true_object_all_of(self, query_object : :type query_object: TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -670,7 +673,8 @@ def test_query_style_deep_object_explode_true_object_all_of(self, query_object : """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_style_deep_object_explode_true_object_all_of_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_style_deep_object_explode_true_object_all_of_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_style_deep_object_explode_true_object_all_of_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments @@ -689,7 +693,7 @@ def test_query_style_deep_object_explode_true_object_all_of_with_http_info(self, :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -798,10 +802,10 @@ def test_query_style_form_explode_true_array_string(self, query_object : Optiona :type query_object: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -809,7 +813,8 @@ def test_query_style_form_explode_true_array_string(self, query_object : Optiona """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_style_form_explode_true_array_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_style_form_explode_true_array_string_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_style_form_explode_true_array_string_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments @@ -828,7 +833,7 @@ def test_query_style_form_explode_true_array_string_with_http_info(self, query_o :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -937,10 +942,10 @@ def test_query_style_form_explode_true_object(self, query_object : Optional[Pet] :type query_object: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -948,7 +953,8 @@ def test_query_style_form_explode_true_object(self, query_object : Optional[Pet] """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_style_form_explode_true_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_style_form_explode_true_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_style_form_explode_true_object_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments @@ -967,7 +973,7 @@ def test_query_style_form_explode_true_object_with_http_info(self, query_object :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1076,10 +1082,10 @@ def test_query_style_form_explode_true_object_all_of(self, query_object : Option :type query_object: DataQuery :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1087,7 +1093,8 @@ def test_query_style_form_explode_true_object_all_of(self, query_object : Option """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_style_form_explode_true_object_all_of_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_style_form_explode_true_object_all_of_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_style_form_explode_true_object_all_of_with_http_info(query_object, **kwargs) # noqa: E501 @validate_arguments @@ -1106,7 +1113,7 @@ def test_query_style_form_explode_true_object_all_of_with_http_info(self, query_ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index 1b315709ffeb..3c7874eae34d 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -32,7 +32,7 @@ from openapi_client.exceptions import ApiValueError, ApiException -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -64,7 +64,7 @@ class ApiClient(object): _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + cookie=None, pool_threads=1) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() @@ -327,7 +327,7 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): sub_kls = re.match(r'List\[(.*)]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) diff --git a/samples/client/echo_api/python/openapi_client/api_response.py b/samples/client/echo_api/python/openapi_client/api_response.py index d81c2ff58477..a0b62b95246c 100644 --- a/samples/client/echo_api/python/openapi_client/api_response.py +++ b/samples/client/echo_api/python/openapi_client/api_response.py @@ -18,7 +18,7 @@ def __init__(self, status_code=None, headers=None, data=None, - raw_data=None): + raw_data=None) -> None: self.status_code = status_code self.headers = headers self.data = data diff --git a/samples/client/echo_api/python/openapi_client/configuration.py b/samples/client/echo_api/python/openapi_client/configuration.py index a9fcb2500401..361ae8793856 100644 --- a/samples/client/echo_api/python/openapi_client/configuration.py +++ b/samples/client/echo_api/python/openapi_client/configuration.py @@ -20,7 +20,6 @@ import urllib3 import http.client as httplib -from openapi_client.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -28,7 +27,7 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): +class Configuration: """This class contains various settings of the API client. :param host: Base url. @@ -50,7 +49,8 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. @@ -65,7 +65,7 @@ def __init__(self, host=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor """ self._base_path = "http://localhost:3000" if host is None else host diff --git a/samples/client/echo_api/python/openapi_client/exceptions.py b/samples/client/echo_api/python/openapi_client/exceptions.py index 50b1bc01826d..ae3e985d2fee 100644 --- a/samples/client/echo_api/python/openapi_client/exceptions.py +++ b/samples/client/echo_api/python/openapi_client/exceptions.py @@ -19,7 +19,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -47,7 +47,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -65,7 +65,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -84,7 +84,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -102,7 +102,7 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: if http_resp: self.status = http_resp.status self.reason = http_resp.reason @@ -129,30 +129,30 @@ def __str__(self): class BadRequestException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/samples/client/echo_api/python/openapi_client/rest.py b/samples/client/echo_api/python/openapi_client/rest.py index c36d9d4647a9..d05e077260de 100644 --- a/samples/client/echo_api/python/openapi_client/rest.py +++ b/samples/client/echo_api/python/openapi_client/rest.py @@ -30,7 +30,7 @@ class RESTResponse(io.IOBase): - def __init__(self, resp): + def __init__(self, resp) -> None: self.urllib3_response = resp self.status = resp.status self.reason = resp.reason @@ -45,9 +45,9 @@ def getheader(self, name, default=None): return self.urllib3_response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py index 74d0a3c7de93..f3a24a3f182b 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from pydantic import Field @@ -32,14 +31,14 @@ ) -class AnotherFakeApi(object): +class AnotherFakeApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -67,10 +66,10 @@ def call_123_test_special_tags(self, client : Annotated[Client, Field(..., descr :type client: Client :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -78,7 +77,8 @@ def call_123_test_special_tags(self, client : Annotated[Client, Field(..., descr """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the call_123_test_special_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the call_123_test_special_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501 @@ -99,7 +99,7 @@ def call_123_test_special_tags_with_http_info(self, client : Annotated[Client, F :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py index f9480b03abd9..758a014805bf 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from petstore_api.models.foo_get_default_response import FooGetDefaultResponse @@ -30,14 +29,14 @@ ) -class DefaultApi(object): +class DefaultApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -62,10 +61,10 @@ def foo_get(self, async_req: Optional[bool]=None, **kwargs) -> Union[FooGetDefau :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -73,7 +72,8 @@ def foo_get(self, async_req: Optional[bool]=None, **kwargs) -> Union[FooGetDefau """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the foo_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the foo_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.foo_get_with_http_info(**kwargs) # noqa: E501 @@ -91,7 +91,7 @@ def foo_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py index ca447195df14..243ddcb7d05c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from datetime import date, datetime @@ -44,14 +43,14 @@ ) -class FakeApi(object): +class FakeApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -78,10 +77,10 @@ def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, asy :type body: object :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -89,7 +88,8 @@ def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, asy """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_any_type_request_body_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_any_type_request_body_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_any_type_request_body_with_http_info(body, **kwargs) # noqa: E501 @@ -109,7 +109,7 @@ def fake_any_type_request_body_with_http_info(self, body : Optional[Dict[str, An :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -226,10 +226,10 @@ def fake_enum_ref_query_parameter(self, enum_ref : Annotated[Optional[EnumClass] :type enum_ref: EnumClass :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -237,7 +237,8 @@ def fake_enum_ref_query_parameter(self, enum_ref : Annotated[Optional[EnumClass] """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_enum_ref_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_enum_ref_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_enum_ref_query_parameter_with_http_info(enum_ref, **kwargs) # noqa: E501 @@ -257,7 +258,7 @@ def fake_enum_ref_query_parameter_with_http_info(self, enum_ref : Annotated[Opti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -365,10 +366,10 @@ def fake_health_get(self, async_req: Optional[bool]=None, **kwargs) -> Union[Hea :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -376,7 +377,8 @@ def fake_health_get(self, async_req: Optional[bool]=None, **kwargs) -> Union[Hea """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_health_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_health_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_health_get_with_http_info(**kwargs) # noqa: E501 @@ -394,7 +396,7 @@ def fake_health_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -510,10 +512,10 @@ def fake_http_signature_test(self, pet : Annotated[Pet, Field(..., description=" :type header_1: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -521,7 +523,8 @@ def fake_http_signature_test(self, pet : Annotated[Pet, Field(..., description=" """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_http_signature_test_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_http_signature_test_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_http_signature_test_with_http_info(pet, query_1, header_1, **kwargs) # noqa: E501 @@ -545,7 +548,7 @@ def fake_http_signature_test_with_http_info(self, pet : Annotated[Pet, Field(... :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -671,10 +674,10 @@ def fake_outer_boolean_serialize(self, body : Annotated[Optional[StrictBool], Fi :type body: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -682,7 +685,8 @@ def fake_outer_boolean_serialize(self, body : Annotated[Optional[StrictBool], Fi """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_boolean_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_boolean_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_outer_boolean_serialize_with_http_info(body, **kwargs) # noqa: E501 @@ -703,7 +707,7 @@ def fake_outer_boolean_serialize_with_http_info(self, body : Annotated[Optional[ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -827,10 +831,10 @@ def fake_outer_composite_serialize(self, outer_composite : Annotated[Optional[Ou :type outer_composite: OuterComposite :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -838,7 +842,8 @@ def fake_outer_composite_serialize(self, outer_composite : Annotated[Optional[Ou """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_composite_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_composite_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_outer_composite_serialize_with_http_info(outer_composite, **kwargs) # noqa: E501 @@ -859,7 +864,7 @@ def fake_outer_composite_serialize_with_http_info(self, outer_composite : Annota :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -983,10 +988,10 @@ def fake_outer_number_serialize(self, body : Annotated[Optional[float], Field(de :type body: float :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -994,7 +999,8 @@ def fake_outer_number_serialize(self, body : Annotated[Optional[float], Field(de """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_number_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_number_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_outer_number_serialize_with_http_info(body, **kwargs) # noqa: E501 @@ -1015,7 +1021,7 @@ def fake_outer_number_serialize_with_http_info(self, body : Annotated[Optional[f :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1139,10 +1145,10 @@ def fake_outer_string_serialize(self, body : Annotated[Optional[StrictStr], Fiel :type body: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1150,7 +1156,8 @@ def fake_outer_string_serialize(self, body : Annotated[Optional[StrictStr], Fiel """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_string_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_string_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_outer_string_serialize_with_http_info(body, **kwargs) # noqa: E501 @@ -1171,7 +1178,7 @@ def fake_outer_string_serialize_with_http_info(self, body : Annotated[Optional[S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1295,10 +1302,10 @@ def fake_property_enum_integer_serialize(self, outer_object_with_enum_property : :type outer_object_with_enum_property: OuterObjectWithEnumProperty :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1306,7 +1313,8 @@ def fake_property_enum_integer_serialize(self, outer_object_with_enum_property : """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_property_enum_integer_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_property_enum_integer_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, **kwargs) # noqa: E501 @@ -1327,7 +1335,7 @@ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1448,10 +1456,10 @@ def fake_return_list_of_objects(self, async_req: Optional[bool]=None, **kwargs) :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1459,7 +1467,8 @@ def fake_return_list_of_objects(self, async_req: Optional[bool]=None, **kwargs) """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_return_list_of_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_return_list_of_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.fake_return_list_of_objects_with_http_info(**kwargs) # noqa: E501 @@ -1477,7 +1486,7 @@ def fake_return_list_of_objects_with_http_info(self, **kwargs) -> ApiResponse: :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1590,10 +1599,10 @@ def test_body_with_binary(self, body : Annotated[Optional[Union[StrictBytes, Str :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1601,7 +1610,8 @@ def test_body_with_binary(self, body : Annotated[Optional[Union[StrictBytes, Str """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_with_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_with_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_body_with_binary_with_http_info(body, **kwargs) # noqa: E501 @@ -1622,7 +1632,7 @@ def test_body_with_binary_with_http_info(self, body : Annotated[Optional[Union[S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1745,10 +1755,10 @@ def test_body_with_file_schema(self, file_schema_test_class : FileSchemaTestClas :type file_schema_test_class: FileSchemaTestClass :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1756,7 +1766,8 @@ def test_body_with_file_schema(self, file_schema_test_class : FileSchemaTestClas """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_with_file_schema_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_with_file_schema_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501 @@ -1777,7 +1788,7 @@ def test_body_with_file_schema_with_http_info(self, file_schema_test_class : Fil :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1896,10 +1907,10 @@ def test_body_with_query_params(self, query : StrictStr, user : User, async_req: :type user: User :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1907,7 +1918,8 @@ def test_body_with_query_params(self, query : StrictStr, user : User, async_req: """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_with_query_params_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_with_query_params_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501 @@ -1929,7 +1941,7 @@ def test_body_with_query_params_with_http_info(self, query : StrictStr, user : U :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2051,10 +2063,10 @@ def test_client_model(self, client : Annotated[Client, Field(..., description="c :type client: Client :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2062,7 +2074,8 @@ def test_client_model(self, client : Annotated[Client, Field(..., description="c """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_client_model_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_client_model_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501 @@ -2083,7 +2096,7 @@ def test_client_model_with_http_info(self, client : Annotated[Client, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2208,10 +2221,10 @@ def test_date_time_query_parameter(self, date_time_query : datetime, str_query : :type str_query: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2219,7 +2232,8 @@ def test_date_time_query_parameter(self, date_time_query : datetime, str_query : """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_date_time_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_date_time_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_date_time_query_parameter_with_http_info(date_time_query, str_query, **kwargs) # noqa: E501 @@ -2241,7 +2255,7 @@ def test_date_time_query_parameter_with_http_info(self, date_time_query : dateti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2387,10 +2401,10 @@ def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1 :type param_callback: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2398,7 +2412,8 @@ def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_endpoint_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_endpoint_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, byte_with_max_length, var_date, date_time, password, param_callback, **kwargs) # noqa: E501 @@ -2447,7 +2462,7 @@ def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(le :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2631,10 +2646,10 @@ def test_group_parameters(self, required_string_group : Annotated[StrictInt, Fie :type int64_group: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2642,7 +2657,8 @@ def test_group_parameters(self, required_string_group : Annotated[StrictInt, Fie """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_group_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_group_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, **kwargs) # noqa: E501 @@ -2673,7 +2689,7 @@ def test_group_parameters_with_http_info(self, required_string_group : Annotated :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2804,10 +2820,10 @@ def test_inline_additional_properties(self, request_body : Annotated[Dict[str, S :type request_body: Dict[str, str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2815,7 +2831,8 @@ def test_inline_additional_properties(self, request_body : Annotated[Dict[str, S """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_inline_additional_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_inline_additional_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501 @@ -2836,7 +2853,7 @@ def test_inline_additional_properties_with_http_info(self, request_body : Annota :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2956,10 +2973,10 @@ def test_json_form_data(self, param : Annotated[StrictStr, Field(..., descriptio :type param2: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2967,7 +2984,8 @@ def test_json_form_data(self, param : Annotated[StrictStr, Field(..., descriptio """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_json_form_data_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_json_form_data_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 @@ -2990,7 +3008,7 @@ def test_json_form_data_with_http_info(self, param : Annotated[StrictStr, Field( :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -3124,10 +3142,10 @@ def test_query_parameter_collection_format(self, pipe : conlist(StrictStr), iout :type language: Dict[str, str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -3135,7 +3153,8 @@ def test_query_parameter_collection_format(self, pipe : conlist(StrictStr), iout """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_parameter_collection_format_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_parameter_collection_format_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, **kwargs) # noqa: E501 @@ -3168,7 +3187,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe : conlist(S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py index 5f06bd394e8c..06c77157f937 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from pydantic import Field @@ -32,14 +31,14 @@ ) -class FakeClassnameTags123Api(object): +class FakeClassnameTags123Api: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -67,10 +66,10 @@ def test_classname(self, client : Annotated[Client, Field(..., description="clie :type client: Client :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -78,7 +77,8 @@ def test_classname(self, client : Annotated[Client, Field(..., description="clie """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_classname_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_classname_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.test_classname_with_http_info(client, **kwargs) # noqa: E501 @@ -99,7 +99,7 @@ def test_classname_with_http_info(self, client : Annotated[Client, Field(..., de :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py index b3a44f89a80d..1f75df6fb946 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from pydantic import Field, StrictBytes, StrictInt, StrictStr, conlist, validator @@ -35,14 +34,14 @@ ) -class PetApi(object): +class PetApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -70,10 +69,10 @@ def add_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that n :type pet: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -81,7 +80,8 @@ def add_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that n """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the add_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the add_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501 @@ -102,7 +102,7 @@ def add_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pe :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -222,10 +222,10 @@ def delete_pet(self, pet_id : Annotated[StrictInt, Field(..., description="Pet i :type api_key: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -233,7 +233,8 @@ def delete_pet(self, pet_id : Annotated[StrictInt, Field(..., description="Pet i """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the delete_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.delete_pet_with_http_info(pet_id, api_key, **kwargs) # noqa: E501 @@ -256,7 +257,7 @@ def delete_pet_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., des :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -371,10 +372,10 @@ def find_pets_by_status(self, status : Annotated[conlist(StrictStr), Field(..., :type status: List[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -382,7 +383,8 @@ def find_pets_by_status(self, status : Annotated[conlist(StrictStr), Field(..., """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the find_pets_by_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the find_pets_by_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 @@ -403,7 +405,7 @@ def find_pets_by_status_with_http_info(self, status : Annotated[conlist(StrictSt :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -522,10 +524,10 @@ def find_pets_by_tags(self, tags : Annotated[conlist(StrictStr, unique_items=Tru :type tags: List[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -533,7 +535,8 @@ def find_pets_by_tags(self, tags : Annotated[conlist(StrictStr, unique_items=Tru """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the find_pets_by_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the find_pets_by_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 @@ -554,7 +557,7 @@ def find_pets_by_tags_with_http_info(self, tags : Annotated[conlist(StrictStr, u :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -675,10 +678,10 @@ def get_pet_by_id(self, pet_id : Annotated[StrictInt, Field(..., description="ID :type pet_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -686,7 +689,8 @@ def get_pet_by_id(self, pet_id : Annotated[StrictInt, Field(..., description="ID """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_pet_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_pet_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 @@ -707,7 +711,7 @@ def get_pet_by_id_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -826,10 +830,10 @@ def update_pet(self, pet : Annotated[Pet, Field(..., description="Pet object tha :type pet: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -837,7 +841,8 @@ def update_pet(self, pet : Annotated[Pet, Field(..., description="Pet object tha """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the update_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501 @@ -858,7 +863,7 @@ def update_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description= :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -980,10 +985,10 @@ def update_pet_with_form(self, pet_id : Annotated[StrictInt, Field(..., descript :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -991,7 +996,8 @@ def update_pet_with_form(self, pet_id : Annotated[StrictInt, Field(..., descript """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_pet_with_form_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the update_pet_with_form_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.update_pet_with_form_with_http_info(pet_id, name, status, **kwargs) # noqa: E501 @@ -1016,7 +1022,7 @@ def update_pet_with_form_with_http_info(self, pet_id : Annotated[StrictInt, Fiel :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1146,10 +1152,10 @@ def upload_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID o :type file: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1157,7 +1163,8 @@ def upload_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID o """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the upload_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the upload_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.upload_file_with_http_info(pet_id, additional_metadata, file, **kwargs) # noqa: E501 @@ -1182,7 +1189,7 @@ def upload_file_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., de :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1318,10 +1325,10 @@ def upload_file_with_required_file(self, pet_id : Annotated[StrictInt, Field(... :type additional_metadata: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1329,7 +1336,8 @@ def upload_file_with_required_file(self, pet_id : Annotated[StrictInt, Field(... """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the upload_file_with_required_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the upload_file_with_required_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.upload_file_with_required_file_with_http_info(pet_id, required_file, additional_metadata, **kwargs) # noqa: E501 @@ -1354,7 +1362,7 @@ def upload_file_with_required_file_with_http_info(self, pet_id : Annotated[Stric :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py index 4ad496740135..097b45413fca 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from pydantic import Field, StrictStr, conint @@ -34,14 +33,14 @@ ) -class StoreApi(object): +class StoreApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -69,10 +68,10 @@ def delete_order(self, order_id : Annotated[StrictStr, Field(..., description="I :type order_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -80,7 +79,8 @@ def delete_order(self, order_id : Annotated[StrictStr, Field(..., description="I """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the delete_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 @@ -101,7 +101,7 @@ def delete_order_with_http_info(self, order_id : Annotated[StrictStr, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -210,10 +210,10 @@ def get_inventory(self, async_req: Optional[bool]=None, **kwargs) -> Union[Dict[ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -221,7 +221,8 @@ def get_inventory(self, async_req: Optional[bool]=None, **kwargs) -> Union[Dict[ """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_inventory_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_inventory_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_inventory_with_http_info(**kwargs) # noqa: E501 @@ -240,7 +241,7 @@ def get_inventory_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -353,10 +354,10 @@ def get_order_by_id(self, order_id : Annotated[conint(strict=True, le=5, ge=1), :type order_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -364,7 +365,8 @@ def get_order_by_id(self, order_id : Annotated[conint(strict=True, le=5, ge=1), """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_order_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_order_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 @@ -385,7 +387,7 @@ def get_order_by_id_with_http_info(self, order_id : Annotated[conint(strict=True :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -504,10 +506,10 @@ def place_order(self, order : Annotated[Order, Field(..., description="order pla :type order: Order :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -515,7 +517,8 @@ def place_order(self, order : Annotated[Order, Field(..., description="order pla """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the place_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the place_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.place_order_with_http_info(order, **kwargs) # noqa: E501 @@ -536,7 +539,7 @@ def place_order_with_http_info(self, order : Annotated[Order, Field(..., descrip :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py index a54f051ed65d..ca2e9c62eda0 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from typing import overload, Optional, Union, Awaitable from pydantic import Field, StrictStr, conlist @@ -32,14 +31,14 @@ ) -class UserApi(object): +class UserApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -67,10 +66,10 @@ def create_user(self, user : Annotated[User, Field(..., description="Created use :type user: User :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -78,7 +77,8 @@ def create_user(self, user : Annotated[User, Field(..., description="Created use """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the create_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.create_user_with_http_info(user, **kwargs) # noqa: E501 @@ -99,7 +99,7 @@ def create_user_with_http_info(self, user : Annotated[User, Field(..., descripti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -232,10 +232,10 @@ def create_users_with_array_input(self, user : Annotated[conlist(User), Field(.. :type user: List[User] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -243,7 +243,8 @@ def create_users_with_array_input(self, user : Annotated[conlist(User), Field(.. """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_users_with_array_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the create_users_with_array_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501 @@ -264,7 +265,7 @@ def create_users_with_array_input_with_http_info(self, user : Annotated[conlist( :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -382,10 +383,10 @@ def create_users_with_list_input(self, user : Annotated[conlist(User), Field(... :type user: List[User] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -393,7 +394,8 @@ def create_users_with_list_input(self, user : Annotated[conlist(User), Field(... """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_users_with_list_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the create_users_with_list_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501 @@ -414,7 +416,7 @@ def create_users_with_list_input_with_http_info(self, user : Annotated[conlist(U :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -532,10 +534,10 @@ def delete_user(self, username : Annotated[StrictStr, Field(..., description="Th :type username: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -543,7 +545,8 @@ def delete_user(self, username : Annotated[StrictStr, Field(..., description="Th """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the delete_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 @@ -564,7 +567,7 @@ def delete_user_with_http_info(self, username : Annotated[StrictStr, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -675,10 +678,10 @@ def get_user_by_name(self, username : Annotated[StrictStr, Field(..., descriptio :type username: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -686,7 +689,8 @@ def get_user_by_name(self, username : Annotated[StrictStr, Field(..., descriptio """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_user_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_user_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 @@ -707,7 +711,7 @@ def get_user_by_name_with_http_info(self, username : Annotated[StrictStr, Field( :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -828,10 +832,10 @@ def login_user(self, username : Annotated[StrictStr, Field(..., description="The :type password: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -839,7 +843,8 @@ def login_user(self, username : Annotated[StrictStr, Field(..., description="The """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the login_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the login_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 @@ -862,7 +867,7 @@ def login_user_with_http_info(self, username : Annotated[StrictStr, Field(..., d :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -982,10 +987,10 @@ def logout_user(self, async_req: Optional[bool]=None, **kwargs) -> Union[None, A :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -993,7 +998,8 @@ def logout_user(self, async_req: Optional[bool]=None, **kwargs) -> Union[None, A """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the logout_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the logout_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.logout_user_with_http_info(**kwargs) # noqa: E501 @@ -1012,7 +1018,7 @@ def logout_user_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1121,10 +1127,10 @@ def update_user(self, username : Annotated[StrictStr, Field(..., description="na :type user: User :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1132,7 +1138,8 @@ def update_user(self, username : Annotated[StrictStr, Field(..., description="na """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the update_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) if async_req is not None: kwargs['async_req'] = async_req return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501 @@ -1155,7 +1162,7 @@ def update_user_with_http_info(self, username : Annotated[StrictStr, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index daa972358f7e..520bbde43c06 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -31,7 +31,7 @@ from petstore_api.exceptions import ApiValueError, ApiException -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -63,7 +63,7 @@ class ApiClient(object): _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + cookie=None, pool_threads=1) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() @@ -327,7 +327,7 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): sub_kls = re.match(r'List\[(.*)]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py index d81c2ff58477..a0b62b95246c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_response.py @@ -18,7 +18,7 @@ def __init__(self, status_code=None, headers=None, data=None, - raw_data=None): + raw_data=None) -> None: self.status_code = status_code self.headers = headers self.data = data diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py index 77d9071f79fd..1e0b9acbc97c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/configuration.py @@ -18,7 +18,6 @@ import urllib3 import http.client as httplib -from petstore_api.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -26,7 +25,7 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): +class Configuration: """This class contains various settings of the API client. :param host: Base url. @@ -50,7 +49,8 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. @@ -141,7 +141,7 @@ def __init__(self, host=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor """ self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py index 4c61edafeaec..6c4ae9c4e02f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/exceptions.py @@ -18,7 +18,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -46,7 +46,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -64,7 +64,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -83,7 +83,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -101,7 +101,7 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: if http_resp: self.status = http_resp.status self.reason = http_resp.reason @@ -128,30 +128,30 @@ def __str__(self): class BadRequestException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py index 61defc0e9eb8..b422650686fd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_color.py @@ -45,7 +45,7 @@ class AnyOfColor(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py index c2f26f1e873b..1254f6789a8c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/any_of_pig.py @@ -45,7 +45,7 @@ class AnyOfPig(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py index eda8b56415eb..4dee9419ab7f 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/color.py @@ -44,7 +44,7 @@ class Color(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py index ef8444eec0dd..5d5de47e305a 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/int_or_string.py @@ -42,7 +42,7 @@ class IntOrString(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py index 282b555ca937..d7ae93ccb6a8 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/one_of_enum_string.py @@ -44,7 +44,7 @@ class OneOfEnumString(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py index dc8e394d6892..1cb002bf6f7d 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/pig.py @@ -47,7 +47,7 @@ class Config: discriminator_value_class_map = { } - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py index d5c9ade5621e..7daf8c921c84 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/rest.py @@ -28,7 +28,7 @@ class RESTResponse(io.IOBase): - def __init__(self, resp, data): + def __init__(self, resp, data) -> None: self.aiohttp_response = resp self.status = resp.status self.reason = resp.reason @@ -43,9 +43,9 @@ def getheader(self, name, default=None): return self.aiohttp_response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # maxsize is number of requests to host that are allowed in parallel if maxsize is None: diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py index a1b08b0b3564..ec4d7d2a67fd 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/signing.py @@ -66,7 +66,7 @@ HASH_SHA512 = 'sha512' -class HttpSigningConfiguration(object): +class HttpSigningConfiguration: """The configuration parameters for the HTTP signature security scheme. The HTTP signature security scheme is used to sign HTTP requests with a private key which is in possession of the API client. @@ -122,7 +122,7 @@ def __init__(self, key_id, signing_scheme, private_key_path, signed_headers=None, signing_algorithm=None, hash_algorithm=None, - signature_max_validity=None): + signature_max_validity=None) -> None: self.key_id = key_id if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) 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 8599ca98bbf4..fc9f70f06f56 100755 --- 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 @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import Field @@ -31,14 +30,14 @@ ) -class AnotherFakeApi(object): +class AnotherFakeApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -58,10 +57,10 @@ def call_123_test_special_tags(self, client : Annotated[Client, Field(..., descr :type client: Client :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -69,7 +68,8 @@ def call_123_test_special_tags(self, client : Annotated[Client, Field(..., descr """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the call_123_test_special_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the call_123_test_special_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.call_123_test_special_tags_with_http_info(client, **kwargs) # noqa: E501 @validate_arguments @@ -88,7 +88,7 @@ def call_123_test_special_tags_with_http_info(self, client : Annotated[Client, F :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 3ef7887aa612..ed5bfebb3699 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from petstore_api.models.foo_get_default_response import FooGetDefaultResponse @@ -29,14 +28,14 @@ ) -class DefaultApi(object): +class DefaultApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -53,10 +52,10 @@ def foo_get(self, **kwargs) -> FooGetDefaultResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -64,7 +63,8 @@ def foo_get(self, **kwargs) -> FooGetDefaultResponse: # noqa: E501 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the foo_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the foo_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.foo_get_with_http_info(**kwargs) # noqa: E501 @validate_arguments @@ -80,7 +80,7 @@ def foo_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional 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 6b0102cc4378..8a92a69c2e38 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from datetime import date, datetime @@ -43,14 +42,14 @@ ) -class FakeApi(object): +class FakeApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -69,10 +68,10 @@ def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, **k :type body: object :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -80,7 +79,8 @@ def fake_any_type_request_body(self, body : Optional[Dict[str, Any]] = None, **k """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_any_type_request_body_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_any_type_request_body_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_any_type_request_body_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -98,7 +98,7 @@ def fake_any_type_request_body_with_http_info(self, body : Optional[Dict[str, An :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -207,10 +207,10 @@ def fake_enum_ref_query_parameter(self, enum_ref : Annotated[Optional[EnumClass] :type enum_ref: EnumClass :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -218,7 +218,8 @@ def fake_enum_ref_query_parameter(self, enum_ref : Annotated[Optional[EnumClass] """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_enum_ref_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_enum_ref_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_enum_ref_query_parameter_with_http_info(enum_ref, **kwargs) # noqa: E501 @validate_arguments @@ -236,7 +237,7 @@ def fake_enum_ref_query_parameter_with_http_info(self, enum_ref : Annotated[Opti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -336,10 +337,10 @@ def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -347,7 +348,8 @@ def fake_health_get(self, **kwargs) -> HealthCheckResult: # noqa: E501 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_health_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_health_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_health_get_with_http_info(**kwargs) # noqa: E501 @validate_arguments @@ -363,7 +365,7 @@ def fake_health_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -471,10 +473,10 @@ def fake_http_signature_test(self, pet : Annotated[Pet, Field(..., description=" :type header_1: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -482,7 +484,8 @@ def fake_http_signature_test(self, pet : Annotated[Pet, Field(..., description=" """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_http_signature_test_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_http_signature_test_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_http_signature_test_with_http_info(pet, query_1, header_1, **kwargs) # noqa: E501 @validate_arguments @@ -504,7 +507,7 @@ def fake_http_signature_test_with_http_info(self, pet : Annotated[Pet, Field(... :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -622,10 +625,10 @@ def fake_outer_boolean_serialize(self, body : Annotated[Optional[StrictBool], Fi :type body: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -633,7 +636,8 @@ def fake_outer_boolean_serialize(self, body : Annotated[Optional[StrictBool], Fi """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_boolean_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_boolean_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_outer_boolean_serialize_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -652,7 +656,7 @@ def fake_outer_boolean_serialize_with_http_info(self, body : Annotated[Optional[ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -768,10 +772,10 @@ def fake_outer_composite_serialize(self, outer_composite : Annotated[Optional[Ou :type outer_composite: OuterComposite :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -779,7 +783,8 @@ def fake_outer_composite_serialize(self, outer_composite : Annotated[Optional[Ou """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_composite_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_composite_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_outer_composite_serialize_with_http_info(outer_composite, **kwargs) # noqa: E501 @validate_arguments @@ -798,7 +803,7 @@ def fake_outer_composite_serialize_with_http_info(self, outer_composite : Annota :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -914,10 +919,10 @@ def fake_outer_number_serialize(self, body : Annotated[Optional[StrictFloat], Fi :type body: float :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -925,7 +930,8 @@ def fake_outer_number_serialize(self, body : Annotated[Optional[StrictFloat], Fi """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_number_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_number_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_outer_number_serialize_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -944,7 +950,7 @@ def fake_outer_number_serialize_with_http_info(self, body : Annotated[Optional[S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1060,10 +1066,10 @@ def fake_outer_string_serialize(self, body : Annotated[Optional[StrictStr], Fiel :type body: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1071,7 +1077,8 @@ def fake_outer_string_serialize(self, body : Annotated[Optional[StrictStr], Fiel """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_outer_string_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_outer_string_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_outer_string_serialize_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -1090,7 +1097,7 @@ def fake_outer_string_serialize_with_http_info(self, body : Annotated[Optional[S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1206,10 +1213,10 @@ def fake_property_enum_integer_serialize(self, outer_object_with_enum_property : :type outer_object_with_enum_property: OuterObjectWithEnumProperty :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1217,7 +1224,8 @@ def fake_property_enum_integer_serialize(self, outer_object_with_enum_property : """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_property_enum_integer_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_property_enum_integer_serialize_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_property_enum_integer_serialize_with_http_info(outer_object_with_enum_property, **kwargs) # noqa: E501 @validate_arguments @@ -1236,7 +1244,7 @@ def fake_property_enum_integer_serialize_with_http_info(self, outer_object_with_ :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1349,10 +1357,10 @@ def fake_return_list_of_objects(self, **kwargs) -> List[List[Tag]]: # noqa: E50 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1360,7 +1368,8 @@ def fake_return_list_of_objects(self, **kwargs) -> List[List[Tag]]: # noqa: E50 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the fake_return_list_of_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the fake_return_list_of_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.fake_return_list_of_objects_with_http_info(**kwargs) # noqa: E501 @validate_arguments @@ -1376,7 +1385,7 @@ def fake_return_list_of_objects_with_http_info(self, **kwargs) -> ApiResponse: :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1481,10 +1490,10 @@ def test_body_with_binary(self, body : Annotated[Optional[Union[StrictBytes, Str :type body: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1492,7 +1501,8 @@ def test_body_with_binary(self, body : Annotated[Optional[Union[StrictBytes, Str """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_with_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_with_binary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_body_with_binary_with_http_info(body, **kwargs) # noqa: E501 @validate_arguments @@ -1511,7 +1521,7 @@ def test_body_with_binary_with_http_info(self, body : Annotated[Optional[Union[S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1626,10 +1636,10 @@ def test_body_with_file_schema(self, file_schema_test_class : FileSchemaTestClas :type file_schema_test_class: FileSchemaTestClass :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1637,7 +1647,8 @@ def test_body_with_file_schema(self, file_schema_test_class : FileSchemaTestClas """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_with_file_schema_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_with_file_schema_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_body_with_file_schema_with_http_info(file_schema_test_class, **kwargs) # noqa: E501 @validate_arguments @@ -1656,7 +1667,7 @@ def test_body_with_file_schema_with_http_info(self, file_schema_test_class : Fil :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1767,10 +1778,10 @@ def test_body_with_query_params(self, query : StrictStr, user : User, **kwargs) :type user: User :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1778,7 +1789,8 @@ def test_body_with_query_params(self, query : StrictStr, user : User, **kwargs) """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_body_with_query_params_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_body_with_query_params_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_body_with_query_params_with_http_info(query, user, **kwargs) # noqa: E501 @validate_arguments @@ -1798,7 +1810,7 @@ def test_body_with_query_params_with_http_info(self, query : StrictStr, user : U :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1912,10 +1924,10 @@ def test_client_model(self, client : Annotated[Client, Field(..., description="c :type client: Client :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1923,7 +1935,8 @@ def test_client_model(self, client : Annotated[Client, Field(..., description="c """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_client_model_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_client_model_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_client_model_with_http_info(client, **kwargs) # noqa: E501 @validate_arguments @@ -1942,7 +1955,7 @@ def test_client_model_with_http_info(self, client : Annotated[Client, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2059,10 +2072,10 @@ def test_date_time_query_parameter(self, date_time_query : datetime, str_query : :type str_query: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2070,7 +2083,8 @@ def test_date_time_query_parameter(self, date_time_query : datetime, str_query : """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_date_time_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_date_time_query_parameter_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_date_time_query_parameter_with_http_info(date_time_query, str_query, **kwargs) # noqa: E501 @validate_arguments @@ -2090,7 +2104,7 @@ def test_date_time_query_parameter_with_http_info(self, date_time_query : dateti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2228,10 +2242,10 @@ def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1 :type param_callback: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2239,7 +2253,8 @@ def test_endpoint_parameters(self, number : Annotated[confloat(le=543.2, ge=32.1 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_endpoint_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_endpoint_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_endpoint_parameters_with_http_info(number, double, pattern_without_delimiter, byte, integer, int32, int64, float, string, binary, byte_with_max_length, var_date, date_time, password, param_callback, **kwargs) # noqa: E501 @validate_arguments @@ -2286,7 +2301,7 @@ def test_endpoint_parameters_with_http_info(self, number : Annotated[confloat(le :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2462,10 +2477,10 @@ def test_group_parameters(self, required_string_group : Annotated[StrictInt, Fie :type int64_group: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2473,7 +2488,8 @@ def test_group_parameters(self, required_string_group : Annotated[StrictInt, Fie """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_group_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_group_parameters_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, string_group, boolean_group, int64_group, **kwargs) # noqa: E501 @validate_arguments @@ -2502,7 +2518,7 @@ def test_group_parameters_with_http_info(self, required_string_group : Annotated :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2625,10 +2641,10 @@ def test_inline_additional_properties(self, request_body : Annotated[Dict[str, S :type request_body: Dict[str, str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2636,7 +2652,8 @@ def test_inline_additional_properties(self, request_body : Annotated[Dict[str, S """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_inline_additional_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_inline_additional_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_inline_additional_properties_with_http_info(request_body, **kwargs) # noqa: E501 @validate_arguments @@ -2655,7 +2672,7 @@ def test_inline_additional_properties_with_http_info(self, request_body : Annota :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2767,10 +2784,10 @@ def test_json_form_data(self, param : Annotated[StrictStr, Field(..., descriptio :type param2: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2778,7 +2795,8 @@ def test_json_form_data(self, param : Annotated[StrictStr, Field(..., descriptio """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_json_form_data_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_json_form_data_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_json_form_data_with_http_info(param, param2, **kwargs) # noqa: E501 @validate_arguments @@ -2799,7 +2817,7 @@ def test_json_form_data_with_http_info(self, param : Annotated[StrictStr, Field( :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -2925,10 +2943,10 @@ def test_query_parameter_collection_format(self, pipe : conlist(StrictStr), iout :type language: Dict[str, str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2936,7 +2954,8 @@ def test_query_parameter_collection_format(self, pipe : conlist(StrictStr), iout """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_query_parameter_collection_format_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_query_parameter_collection_format_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, **kwargs) # noqa: E501 @validate_arguments @@ -2967,7 +2986,7 @@ def test_query_parameter_collection_format_with_http_info(self, pipe : conlist(S :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index d30572a41ea1..34e04a913ff9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import Field @@ -31,14 +30,14 @@ ) -class FakeClassnameTags123Api(object): +class FakeClassnameTags123Api: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -58,10 +57,10 @@ def test_classname(self, client : Annotated[Client, Field(..., description="clie :type client: Client :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -69,7 +68,8 @@ def test_classname(self, client : Annotated[Client, Field(..., description="clie """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the test_classname_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the test_classname_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.test_classname_with_http_info(client, **kwargs) # noqa: E501 @validate_arguments @@ -88,7 +88,7 @@ def test_classname_with_http_info(self, client : Annotated[Client, Field(..., de :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional 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 fc6a02505035..cd92272a23d9 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import Field, StrictBytes, StrictInt, StrictStr, conlist, validator @@ -34,14 +33,14 @@ ) -class PetApi(object): +class PetApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -61,10 +60,10 @@ def add_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that n :type pet: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -72,7 +71,8 @@ def add_pet(self, pet : Annotated[Pet, Field(..., description="Pet object that n """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the add_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the add_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.add_pet_with_http_info(pet, **kwargs) # noqa: E501 @validate_arguments @@ -91,7 +91,7 @@ def add_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description="Pe :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -203,10 +203,10 @@ def delete_pet(self, pet_id : Annotated[StrictInt, Field(..., description="Pet i :type api_key: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -214,7 +214,8 @@ def delete_pet(self, pet_id : Annotated[StrictInt, Field(..., description="Pet i """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the delete_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.delete_pet_with_http_info(pet_id, api_key, **kwargs) # noqa: E501 @validate_arguments @@ -235,7 +236,7 @@ def delete_pet_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., des :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -342,10 +343,10 @@ def find_pets_by_status(self, status : Annotated[conlist(StrictStr), Field(..., :type status: List[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -353,7 +354,8 @@ def find_pets_by_status(self, status : Annotated[conlist(StrictStr), Field(..., """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the find_pets_by_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the find_pets_by_status_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501 @validate_arguments @@ -372,7 +374,7 @@ def find_pets_by_status_with_http_info(self, status : Annotated[conlist(StrictSt :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -483,10 +485,10 @@ def find_pets_by_tags(self, tags : Annotated[conlist(StrictStr, unique_items=Tru :type tags: List[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -494,7 +496,8 @@ def find_pets_by_tags(self, tags : Annotated[conlist(StrictStr, unique_items=Tru """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the find_pets_by_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the find_pets_by_tags_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501 @validate_arguments @@ -513,7 +516,7 @@ def find_pets_by_tags_with_http_info(self, tags : Annotated[conlist(StrictStr, u :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -626,10 +629,10 @@ def get_pet_by_id(self, pet_id : Annotated[StrictInt, Field(..., description="ID :type pet_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -637,7 +640,8 @@ def get_pet_by_id(self, pet_id : Annotated[StrictInt, Field(..., description="ID """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_pet_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_pet_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.get_pet_by_id_with_http_info(pet_id, **kwargs) # noqa: E501 @validate_arguments @@ -656,7 +660,7 @@ def get_pet_by_id_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -767,10 +771,10 @@ def update_pet(self, pet : Annotated[Pet, Field(..., description="Pet object tha :type pet: Pet :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -778,7 +782,8 @@ def update_pet(self, pet : Annotated[Pet, Field(..., description="Pet object tha """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the update_pet_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.update_pet_with_http_info(pet, **kwargs) # noqa: E501 @validate_arguments @@ -797,7 +802,7 @@ def update_pet_with_http_info(self, pet : Annotated[Pet, Field(..., description= :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -911,10 +916,10 @@ def update_pet_with_form(self, pet_id : Annotated[StrictInt, Field(..., descript :type status: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -922,7 +927,8 @@ def update_pet_with_form(self, pet_id : Annotated[StrictInt, Field(..., descript """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_pet_with_form_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the update_pet_with_form_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.update_pet_with_form_with_http_info(pet_id, name, status, **kwargs) # noqa: E501 @validate_arguments @@ -945,7 +951,7 @@ def update_pet_with_form_with_http_info(self, pet_id : Annotated[StrictInt, Fiel :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1067,10 +1073,10 @@ def upload_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID o :type file: bytearray :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1078,7 +1084,8 @@ def upload_file(self, pet_id : Annotated[StrictInt, Field(..., description="ID o """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the upload_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the upload_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.upload_file_with_http_info(pet_id, additional_metadata, file, **kwargs) # noqa: E501 @validate_arguments @@ -1101,7 +1108,7 @@ def upload_file_with_http_info(self, pet_id : Annotated[StrictInt, Field(..., de :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1229,10 +1236,10 @@ def upload_file_with_required_file(self, pet_id : Annotated[StrictInt, Field(... :type additional_metadata: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1240,7 +1247,8 @@ def upload_file_with_required_file(self, pet_id : Annotated[StrictInt, Field(... """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the upload_file_with_required_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the upload_file_with_required_file_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.upload_file_with_required_file_with_http_info(pet_id, required_file, additional_metadata, **kwargs) # noqa: E501 @validate_arguments @@ -1263,7 +1271,7 @@ def upload_file_with_required_file_with_http_info(self, pet_id : Annotated[Stric :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional 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 11e41480d1b6..03c28b251634 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import Field, StrictStr, conint @@ -33,14 +32,14 @@ ) -class StoreApi(object): +class StoreApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -60,10 +59,10 @@ def delete_order(self, order_id : Annotated[StrictStr, Field(..., description="I :type order_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -71,7 +70,8 @@ def delete_order(self, order_id : Annotated[StrictStr, Field(..., description="I """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the delete_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.delete_order_with_http_info(order_id, **kwargs) # noqa: E501 @validate_arguments @@ -90,7 +90,7 @@ def delete_order_with_http_info(self, order_id : Annotated[StrictStr, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -191,10 +191,10 @@ def get_inventory(self, **kwargs) -> Dict[str, int]: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -202,7 +202,8 @@ def get_inventory(self, **kwargs) -> Dict[str, int]: # noqa: E501 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_inventory_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_inventory_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.get_inventory_with_http_info(**kwargs) # noqa: E501 @validate_arguments @@ -219,7 +220,7 @@ def get_inventory_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -324,10 +325,10 @@ def get_order_by_id(self, order_id : Annotated[conint(strict=True, le=5, ge=1), :type order_id: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -335,7 +336,8 @@ def get_order_by_id(self, order_id : Annotated[conint(strict=True, le=5, ge=1), """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_order_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_order_by_id_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.get_order_by_id_with_http_info(order_id, **kwargs) # noqa: E501 @validate_arguments @@ -354,7 +356,7 @@ def get_order_by_id_with_http_info(self, order_id : Annotated[conint(strict=True :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -465,10 +467,10 @@ def place_order(self, order : Annotated[Order, Field(..., description="order pla :type order: Order :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -476,7 +478,8 @@ def place_order(self, order : Annotated[Order, Field(..., description="order pla """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the place_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the place_order_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.place_order_with_http_info(order, **kwargs) # noqa: E501 @validate_arguments @@ -495,7 +498,7 @@ def place_order_with_http_info(self, order : Annotated[Order, Field(..., descrip :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional 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 8761c5e5b35c..eaea6c16a167 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -16,8 +16,7 @@ import io import warnings -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated +from pydantic import validate_arguments from pydantic import Field, StrictStr, conlist @@ -31,14 +30,14 @@ ) -class UserApi(object): +class UserApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -58,10 +57,10 @@ def create_user(self, user : Annotated[User, Field(..., description="Created use :type user: User :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -69,7 +68,8 @@ def create_user(self, user : Annotated[User, Field(..., description="Created use """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the create_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.create_user_with_http_info(user, **kwargs) # noqa: E501 @validate_arguments @@ -88,7 +88,7 @@ def create_user_with_http_info(self, user : Annotated[User, Field(..., descripti :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -213,10 +213,10 @@ def create_users_with_array_input(self, user : Annotated[conlist(User), Field(.. :type user: List[User] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -224,7 +224,8 @@ def create_users_with_array_input(self, user : Annotated[conlist(User), Field(.. """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_users_with_array_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the create_users_with_array_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501 @validate_arguments @@ -243,7 +244,7 @@ def create_users_with_array_input_with_http_info(self, user : Annotated[conlist( :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -353,10 +354,10 @@ def create_users_with_list_input(self, user : Annotated[conlist(User), Field(... :type user: List[User] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -364,7 +365,8 @@ def create_users_with_list_input(self, user : Annotated[conlist(User), Field(... """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the create_users_with_list_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the create_users_with_list_input_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501 @validate_arguments @@ -383,7 +385,7 @@ def create_users_with_list_input_with_http_info(self, user : Annotated[conlist(U :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -493,10 +495,10 @@ def delete_user(self, username : Annotated[StrictStr, Field(..., description="Th :type username: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -504,7 +506,8 @@ def delete_user(self, username : Annotated[StrictStr, Field(..., description="Th """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the delete_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the delete_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.delete_user_with_http_info(username, **kwargs) # noqa: E501 @validate_arguments @@ -523,7 +526,7 @@ def delete_user_with_http_info(self, username : Annotated[StrictStr, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -626,10 +629,10 @@ def get_user_by_name(self, username : Annotated[StrictStr, Field(..., descriptio :type username: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -637,7 +640,8 @@ def get_user_by_name(self, username : Annotated[StrictStr, Field(..., descriptio """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the get_user_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the get_user_by_name_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.get_user_by_name_with_http_info(username, **kwargs) # noqa: E501 @validate_arguments @@ -656,7 +660,7 @@ def get_user_by_name_with_http_info(self, username : Annotated[StrictStr, Field( :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -769,10 +773,10 @@ def login_user(self, username : Annotated[StrictStr, Field(..., description="The :type password: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -780,7 +784,8 @@ def login_user(self, username : Annotated[StrictStr, Field(..., description="The """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the login_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the login_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.login_user_with_http_info(username, password, **kwargs) # noqa: E501 @validate_arguments @@ -801,7 +806,7 @@ def login_user_with_http_info(self, username : Annotated[StrictStr, Field(..., d :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -913,10 +918,10 @@ def logout_user(self, **kwargs) -> None: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -924,7 +929,8 @@ def logout_user(self, **kwargs) -> None: # noqa: E501 """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the logout_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the logout_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.logout_user_with_http_info(**kwargs) # noqa: E501 @validate_arguments @@ -941,7 +947,7 @@ def logout_user_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional @@ -1042,10 +1048,10 @@ def update_user(self, username : Annotated[StrictStr, Field(..., description="na :type user: User :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1053,7 +1059,8 @@ def update_user(self, username : Annotated[StrictStr, Field(..., description="na """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError("Error! Please call the update_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + message = "Error! Please call the update_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 + raise ValueError(message) return self.update_user_with_http_info(username, user, **kwargs) # noqa: E501 @validate_arguments @@ -1074,7 +1081,7 @@ def update_user_with_http_info(self, username : Annotated[StrictStr, Field(..., :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the + be set to none and raw_data will store the HTTP response body without reading/decoding. Default is True. :type _preload_content: bool, optional 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 4096fc43c202..25e2ebc4ff32 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -31,7 +31,7 @@ from petstore_api.exceptions import ApiValueError, ApiException -class ApiClient(object): +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -63,7 +63,7 @@ class ApiClient(object): _pool = None def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + cookie=None, pool_threads=1) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() @@ -326,7 +326,7 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): sub_kls = re.match(r'List\[(.*)]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_response.py b/samples/openapi3/client/petstore/python/petstore_api/api_response.py index d81c2ff58477..a0b62b95246c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_response.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_response.py @@ -18,7 +18,7 @@ def __init__(self, status_code=None, headers=None, data=None, - raw_data=None): + raw_data=None) -> None: self.status_code = status_code self.headers = headers self.data = data diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index bc222ed9c00c..8bca6dc7ab0e 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -19,7 +19,6 @@ import urllib3 import http.client as httplib -from petstore_api.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -27,7 +26,7 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): +class Configuration: """This class contains various settings of the API client. :param host: Base url. @@ -51,7 +50,8 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. @@ -142,7 +142,7 @@ def __init__(self, host=None, server_index=None, server_variables=None, server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor """ self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host diff --git a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py index 4c61edafeaec..6c4ae9c4e02f 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py @@ -18,7 +18,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -46,7 +46,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -64,7 +64,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -83,7 +83,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -101,7 +101,7 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: if http_resp: self.status = http_resp.status self.reason = http_resp.reason @@ -128,30 +128,30 @@ def __str__(self): class BadRequestException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py index 61defc0e9eb8..b422650686fd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_color.py @@ -45,7 +45,7 @@ class AnyOfColor(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py index c2f26f1e873b..1254f6789a8c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/any_of_pig.py @@ -45,7 +45,7 @@ class AnyOfPig(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/color.py b/samples/openapi3/client/petstore/python/petstore_api/models/color.py index eda8b56415eb..4dee9419ab7f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/color.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/color.py @@ -44,7 +44,7 @@ class Color(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py index ef8444eec0dd..5d5de47e305a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/int_or_string.py @@ -42,7 +42,7 @@ class IntOrString(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py index 282b555ca937..d7ae93ccb6a8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/one_of_enum_string.py @@ -44,7 +44,7 @@ class OneOfEnumString(BaseModel): class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python/petstore_api/models/pig.py index 1f84dd6c2714..62ae5a2a0ef7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/pig.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/pig.py @@ -47,7 +47,7 @@ class Config: discriminator_value_class_map = { } - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py index a2bf18269664..df9aca008048 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py @@ -29,7 +29,7 @@ class RESTResponse(io.IOBase): - def __init__(self, resp): + def __init__(self, resp) -> None: self.urllib3_response = resp self.status = resp.status self.reason = resp.reason @@ -44,9 +44,9 @@ def getheader(self, name, default=None): return self.urllib3_response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 diff --git a/samples/openapi3/client/petstore/python/petstore_api/signing.py b/samples/openapi3/client/petstore/python/petstore_api/signing.py index a1b08b0b3564..ec4d7d2a67fd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/signing.py +++ b/samples/openapi3/client/petstore/python/petstore_api/signing.py @@ -66,7 +66,7 @@ HASH_SHA512 = 'sha512' -class HttpSigningConfiguration(object): +class HttpSigningConfiguration: """The configuration parameters for the HTTP signature security scheme. The HTTP signature security scheme is used to sign HTTP requests with a private key which is in possession of the API client. @@ -122,7 +122,7 @@ def __init__(self, key_id, signing_scheme, private_key_path, signed_headers=None, signing_algorithm=None, hash_algorithm=None, - signature_max_validity=None): + signature_max_validity=None) -> None: self.key_id = key_id if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}: raise Exception("Unsupported security scheme: {0}".format(signing_scheme)) From 2af7c145b2ece8a12d4385e8aad98972cc4882f4 Mon Sep 17 00:00:00 2001 From: Jesse Myers Date: Fri, 1 Sep 2023 08:00:30 -0700 Subject: [PATCH 3/4] Restore imports used by `AbstractPythonCodegen.java` --- .../openapi-generator/src/main/resources/python/api.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index b92cf17e2275..70f316a2e7f4 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -6,7 +6,8 @@ import re # noqa: F401 import io import warnings -from pydantic import validate_arguments{{#asyncio}} +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated{{#asyncio}} from typing import overload, Optional, Union, Awaitable{{/asyncio}} {{#imports}} From 29e4f89dc3789ad64cdfe7b1a62f732fd000e6e2 Mon Sep 17 00:00:00 2001 From: Jesse Myers Date: Fri, 1 Sep 2023 08:10:32 -0700 Subject: [PATCH 4/4] Update generated files --- samples/client/echo_api/python/openapi_client/api/body_api.py | 3 ++- samples/client/echo_api/python/openapi_client/api/form_api.py | 3 ++- .../client/echo_api/python/openapi_client/api/header_api.py | 3 ++- samples/client/echo_api/python/openapi_client/api/path_api.py | 3 ++- samples/client/echo_api/python/openapi_client/api/query_api.py | 3 ++- .../python-aiohttp/petstore_api/api/another_fake_api.py | 3 ++- .../petstore/python-aiohttp/petstore_api/api/default_api.py | 3 ++- .../petstore/python-aiohttp/petstore_api/api/fake_api.py | 3 ++- .../petstore_api/api/fake_classname_tags123_api.py | 3 ++- .../client/petstore/python-aiohttp/petstore_api/api/pet_api.py | 3 ++- .../petstore/python-aiohttp/petstore_api/api/store_api.py | 3 ++- .../petstore/python-aiohttp/petstore_api/api/user_api.py | 3 ++- .../petstore/python/petstore_api/api/another_fake_api.py | 3 ++- .../client/petstore/python/petstore_api/api/default_api.py | 3 ++- .../client/petstore/python/petstore_api/api/fake_api.py | 3 ++- .../python/petstore_api/api/fake_classname_tags123_api.py | 3 ++- .../client/petstore/python/petstore_api/api/pet_api.py | 3 ++- .../client/petstore/python/petstore_api/api/store_api.py | 3 ++- .../client/petstore/python/petstore_api/api/user_api.py | 3 ++- 19 files changed, 38 insertions(+), 19 deletions(-) diff --git a/samples/client/echo_api/python/openapi_client/api/body_api.py b/samples/client/echo_api/python/openapi_client/api/body_api.py index e6e916b4f795..196e2a6389f3 100644 --- a/samples/client/echo_api/python/openapi_client/api/body_api.py +++ b/samples/client/echo_api/python/openapi_client/api/body_api.py @@ -17,7 +17,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import Field, StrictBytes, StrictStr, conlist diff --git a/samples/client/echo_api/python/openapi_client/api/form_api.py b/samples/client/echo_api/python/openapi_client/api/form_api.py index 20daae3ec3b4..1137bfca3216 100644 --- a/samples/client/echo_api/python/openapi_client/api/form_api.py +++ b/samples/client/echo_api/python/openapi_client/api/form_api.py @@ -17,7 +17,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import StrictBool, StrictInt, StrictStr diff --git a/samples/client/echo_api/python/openapi_client/api/header_api.py b/samples/client/echo_api/python/openapi_client/api/header_api.py index e5a7e8e67cc7..a67fc13b2772 100644 --- a/samples/client/echo_api/python/openapi_client/api/header_api.py +++ b/samples/client/echo_api/python/openapi_client/api/header_api.py @@ -17,7 +17,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import StrictBool, StrictInt, StrictStr diff --git a/samples/client/echo_api/python/openapi_client/api/path_api.py b/samples/client/echo_api/python/openapi_client/api/path_api.py index 2567e782b9ab..13203624883b 100644 --- a/samples/client/echo_api/python/openapi_client/api/path_api.py +++ b/samples/client/echo_api/python/openapi_client/api/path_api.py @@ -17,7 +17,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import StrictInt, StrictStr diff --git a/samples/client/echo_api/python/openapi_client/api/query_api.py b/samples/client/echo_api/python/openapi_client/api/query_api.py index d401ccb9a7ba..59465cdc0cc6 100644 --- a/samples/client/echo_api/python/openapi_client/api/query_api.py +++ b/samples/client/echo_api/python/openapi_client/api/query_api.py @@ -17,7 +17,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from datetime import date, datetime diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py index f3a24a3f182b..3ba5d212b863 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/another_fake_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from pydantic import Field diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py index 758a014805bf..69cfa5ebedf5 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/default_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from petstore_api.models.foo_get_default_response import FooGetDefaultResponse diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py index 243ddcb7d05c..b6ff3b3019ba 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from datetime import date, datetime diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py index 06c77157f937..1553c2d10b87 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/fake_classname_tags123_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from pydantic import Field diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py index 1f75df6fb946..21954fd08a9c 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/pet_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from pydantic import Field, StrictBytes, StrictInt, StrictStr, conlist, validator diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py index 097b45413fca..f1e80d7e27b7 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/store_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from pydantic import Field, StrictStr, conint diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py index ca2e9c62eda0..b17529a75a96 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/user_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from typing import overload, Optional, Union, Awaitable from pydantic import Field, StrictStr, conlist 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 fc9f70f06f56..13a77052ca05 100755 --- 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 @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import Field diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index ed5bfebb3699..3b615de2250a 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from petstore_api.models.foo_get_default_response import FooGetDefaultResponse 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 8a92a69c2e38..8c9475ab6fd2 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from datetime import date, datetime diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 34e04a913ff9..56620e1baa24 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import Field 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 cd92272a23d9..0325f3353576 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import Field, StrictBytes, StrictInt, StrictStr, conlist, validator 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 03c28b251634..9ccbc98603df 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import Field, StrictStr, conint 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 eaea6c16a167..3bb8e99417de 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -16,7 +16,8 @@ import io import warnings -from pydantic import validate_arguments +from pydantic import validate_arguments, ValidationError +from typing_extensions import Annotated from pydantic import Field, StrictStr, conlist