diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index f9b3757bbdb..91643e17fd0 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -21,6 +21,7 @@ import io.swagger.v3.oas.models.tags.Tag; import java.util.*; +import java.util.stream.Collectors; public class CodegenOperation { public final List responseHeaders = new ArrayList(); @@ -33,7 +34,7 @@ public class CodegenOperation { hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined public CodegenProperty returnProperty; public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType, - returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse; + returnContainer, summary, unescapedNotes, notes, baseName; public CodegenDiscriminator discriminator; public List> consumes, produces, prioritizedContentTypes; public List servers = new ArrayList(); @@ -51,6 +52,7 @@ public class CodegenOperation { public List authMethods; public List tags; public List responses = new ArrayList(); + public CodegenResponse defaultResponse = null; public List callbacks = new ArrayList<>(); public Set imports = new HashSet(); public List> examples; @@ -197,6 +199,10 @@ public boolean getAllResponsesAreErrors() { return responses.stream().allMatch(response -> response.is4xx || response.is5xx); } + public List getNonDefaultResponses() { + return responses.stream().filter(response -> !response.isDefault).collect(Collectors.toList()); + } + /** * @return contentTypeToOperation * returns a map where the key is the request body content type and the value is the current CodegenOperation diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 708243bb2ca..af0fea0b8f4 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -4076,7 +4076,6 @@ protected void handleMethodResponse(Operation operation, op.examples = new ExampleGenerator(schemas, this.openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(this.openAPI, operation)); } - op.defaultResponse = toDefaultValue(responseSchema); op.returnType = cm.dataType; op.returnFormat = cm.dataFormat; op.hasReference = schemas != null && schemas.containsKey(op.returnBaseType); @@ -4214,6 +4213,7 @@ public CodegenOperation fromOperation(String path, } if (Boolean.TRUE.equals(r.isDefault)) { op.defaultReturnType = Boolean.TRUE; + op.defaultResponse = r; } // check if any 4xx or 5xx response has an error response object defined if ((Boolean.TRUE.equals(r.is4xx) || Boolean.TRUE.equals(r.is5xx)) && r.getContent() != null) { diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars index ec9a3acbdc3..1c79fe80923 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.handlebars @@ -932,12 +932,19 @@ class TypedDictInputVerifier: ) -class OpenApiResponse(JSONDetector, TypedDictInputVerifier): +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] def __init__( self, - response_cls: typing.Type[ApiResponse] = ApiResponse, + response_cls: typing.Type[T], content: typing.Optional[typing.Dict[str, MediaType]] = None, headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, ): @@ -1022,7 +1029,7 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier): for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars index 2e7da28a4ba..cdd7afc73ac 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/endpoint.handlebars @@ -91,15 +91,25 @@ _servers = ( {{/unless}} {{#unless isStub}} -_status_code_to_response = { -{{#each responses}} -{{#if isDefault}} - 'default': response_for_default.response, -{{else}} - '{{code}}': response_for_{{code}}.response, + +{{#if defaultResponse}} +default_response = response_for_default.response {{/if}} +{{#if getNonDefaultResponses}} +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { +{{#each getNonDefaultResponses}} + '{{code}}': api_client.OpenApiResponse[response_for_{{code}}.ApiResponse], +{{/each}} + } +) +_status_code_to_response = __StatusCodeToResponse({ +{{#each getNonDefaultResponses}} + '{{code}}': response_for_{{code}}.response, {{/each}} -} +}) +{{/if}} {{/unless}} {{#each produces}} {{#if @first}} @@ -246,22 +256,35 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) +{{#if getNonDefaultResponses}} + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ +{{#each getNonDefaultResponses}} + '{{code}}', +{{/each}} + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: - {{#if hasDefaultResponse}} - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + {{#if defaultResponse}} + api_response = default_response.deserialize(response, self.api_client.configuration) {{else}} api_response = api_client.ApiResponseWithoutDeserialization(response=response) {{/if}} +{{else}} + {{#if defaultResponse}} + api_response = default_response.deserialize(response, self.api_client.configuration) + {{else}} + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + {{/if}} +{{/if}} if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars b/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars index fa5f7534789..9be105f803b 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars +++ b/modules/openapi-json-schema-generator/src/main/resources/python/exceptions.handlebars @@ -1,6 +1,10 @@ # coding: utf-8 {{>partial_header}} +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict class OpenApiException(Exception): @@ -90,30 +94,25 @@ class ApiKeyError(OpenApiException, KeyError): super(ApiKeyError, self).__init__(full_msg) -class ApiException(OpenApiException): +T = typing.TypeVar("T") - def __init__(self, status=None, reason=None, api_response: '{{packageName}}.api_client.ApiResponse' = None): - if api_response: - self.status = api_response.response.status - self.reason = api_response.response.reason - self.body = api_response.response.data - self.headers = api_response.response.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None def __str__(self): """Custom error messages for exception""" error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.api_response: + if self.api_response.response.getheaders(): + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.getheaders()) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) return error_message diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py index eb6db803222..22ea826ffa2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/api_client.py @@ -936,12 +936,19 @@ def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict] ) -class OpenApiResponse(JSONDetector, TypedDictInputVerifier): +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] def __init__( self, - response_cls: typing.Type[ApiResponse] = ApiResponse, + response_cls: typing.Type[T], content: typing.Optional[typing.Dict[str, MediaType]] = None, headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, ): @@ -1026,7 +1033,7 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py index 54a51c36ab4..3731349e636 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/exceptions.py @@ -8,6 +8,10 @@ The version of the OpenAPI document: 0.0.1 Generated by: https://openapi-generator.tech """ +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict class OpenApiException(Exception): @@ -97,30 +101,25 @@ def __init__(self, msg, path_to_item=None): super(ApiKeyError, self).__init__(full_msg) -class ApiException(OpenApiException): +T = typing.TypeVar("T") - def __init__(self, status=None, reason=None, api_response: 'unit_test_api.api_client.ApiResponse' = None): - if api_response: - self.status = api_response.response.status - self.reason = api_response.response.reason - self.body = api_response.response.data - self.headers = api_response.response.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None def __str__(self): """Custom error messages for exception""" error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.api_response: + if self.api_response.response.getheaders(): + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.getheaders()) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) return error_message diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py index a619665a027..548b38135f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi index 915008c34a9..ba9f100f8b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py index 8f137349cdb..cfc596fc639 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi index 5eb0508a036..91316d524aa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_are_allowed_by_default_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py index 6fb61bec0e4..79e3d8dce27 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi index 13b34f83c16..9f4dbde7aa4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py index 92cd88d63f7..1a43b640c1d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi index e0342b50b75..76c4b0abdb9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_additionalproperties_should_not_look_in_applicators_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py index 2b3006f8d9b..d2621f40cfe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi index e9894b3730a..bad5b822659 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_combined_with_anyof_oneof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py index 4adfc51d411..8e60043d065 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi index 74e775c0d06..17c0084cf7f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py index 719ce7c4158..53d6c12b76d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi index adb82adee7f..9641c0a8c32 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_simple_types_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py index 10a548ccbb1..16402e6758c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi index ce525df307e..00bb8abab78 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_base_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py index 7cd16c2f885..9044fbcd1e7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi index c8337bb442b..938d97bc040 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_one_empty_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py index be96d36437c..2207cc1b366 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi index 7571d503432..35d0c3e1d28 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_first_empty_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py index 8f10969cce3..b7e68236428 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi index 253d65e0c1d..43fa802f0c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_the_last_empty_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py index d17faa51c36..f2405364d43 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi index d3e59262435..31d37ca73dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_allof_with_two_empty_schemas_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py index 511960a7a19..8f049495d89 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi index 47affc26638..104b386800b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_complex_types_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py index 235d53217c4..35d596173c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi index f5958fd6518..9c18c454df0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py index 84ccc6bb286..aa25adc0f73 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi index 63462e95af0..6ce04fae761 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_base_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py index 8c5e0c0bd23..60b3f4f3e41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi index 9c2c427edb8..dc19d2d6779 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_anyof_with_one_empty_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py index 16ec5e5b2ba..9fa06e92c9e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi index b267539ddb7..37123ce42a2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_array_type_matches_arrays_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py index 979addbacb3..a45d316750e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi index 647ea578cbf..26ecb791d39 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_boolean_type_matches_booleans_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py index 986b6a065d1..1c30d2705eb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi index 3045180375c..7ccbb843d63 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_int_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py index e3628a64b28..4b12153aeeb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi index efdd92054e7..abd32db6d99 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_number_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py index 4e920a3f4be..5aa01d0c227 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi index c052e03626d..4d871c57f35 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_by_small_number_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py index 564bc6f3fae..596781f7823 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi index 81a53574173..cf22569445a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_date_time_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py index 1b09af4fb27..ca2731ef6b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi index 7b1a73c71e3..f327bb15fa8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_email_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py index 82a1821f392..c240a2098db 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi index aa4daf879cb..9856f71d5f0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with0_does_not_match_false_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py index e836e834faa..ea9e1a8bb83 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi index 437edabe395..ecbb05a33d1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with1_does_not_match_true_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py index 5e1c1598cd7..19958f73937 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi index 4238b960955..ba2d43de5c6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_escaped_characters_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py index ef25f121dc8..de34b02be63 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi index 449dd1250e1..072ed5b079f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_false_does_not_match0_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py index 6996b5acbf1..dbf52f2c0a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi index 37b86b18577..e44a6741bb2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enum_with_true_does_not_match1_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py index bbb6eb83e34..df7f2fcdde2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi index 121812dd2e0..bc8c125a35e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_enums_in_properties_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py index ff43b22b20d..2f6c11c29c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi index b89645ae971..e90456521bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_forbidden_property_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py index 7c1916dccdd..94fe64f54d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi index 1d52091cd01..87de8ed2ae8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_hostname_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py index 0d392ebcd3a..17e1bd9834f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi index 196cac790ba..caa3b2be5f8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_integer_type_matches_integers_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py index 046dc4f0f5e..c6a26d566bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi index 95a47eea090..abce3bd9a44 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py index 0ca320b1271..f12d7b3ff1f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi index 78380c296c9..116fb05efd3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_invalid_string_value_for_default_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py index aa724da3238..148940ea8b5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi index 1df7530427f..c13ad9bd448 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv4_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py index 1bfd2bdd37a..689bcc70152 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi index 032c666b879..bcd417a0a3c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ipv6_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py index e8b4523db11..57579a4e034 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi index f8c3a1435f4..0e18412d278 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_json_pointer_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py index a3236ed09f6..a64173c210b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi index 76af35b523b..2af4125e65d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py index 89494624f58..6e915116ea1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi index ceb952c7225..7945a4af748 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maximum_validation_with_unsigned_integer_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py index 756ad2f133c..ffa23deeaaf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi index 0cde8528763..32fa84ed8c7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxitems_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py index f0d1c125336..3f08653d0a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi index f556b1c8573..d0fc12ce9bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxlength_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py index fd5ae8f23ae..1858bf07ca5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi index 2054aa45574..ccae76ec218 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties0_means_the_object_is_empty_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py index ad9cb9b16aa..cae5372edab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi index b7a1f7e0e6c..277ee9a7c00 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_maxproperties_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py index 4981df6b548..a907ccea30a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi index 5840e56ac61..9420295c264 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py index 5b67d6aa916..aaf44fd4ae0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi index 2be8fdc6631..9ade2521d2e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minimum_validation_with_signed_integer_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py index 1de5af5e7f8..b4ab0fc2803 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi index d37962cb1d6..1e025e3f250 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minitems_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py index 1e66ee47235..d71ec63f65d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi index b55500a71a4..75f53a86763 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minlength_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py index b97ab1d93fa..b581ac8cf86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi index 88f28aa17d1..d81e0712916 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_minproperties_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py index a9a044e6ce7..3f190b669b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi index e862b7f116b..bc4aac9f178 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_allof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py index cbd6e37f3ef..abe254e4664 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi index c7417b95adb..017ae69f885 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_anyof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py index cf9c17aefdc..980dbe97bd7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi index 0900c27f835..cef47e66063 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_items_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py index b7b25e09d2b..638ca8b9d9c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi index ae03307b760..fcf54069d85 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nested_oneof_to_check_validation_semantics_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py index 48f393d5ee0..eb0319522d5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi index 58fbdb3f001..691dd215e98 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_more_complex_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py index 4b7ad26981f..e5295e98699 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi index 039b1878c37..64f1173d301 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_not_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py index e3dc9d57958..02aa411dad0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi index e48ad5167f1..91a2549bd02 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_nul_characters_in_strings_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py index 2178f319982..57162493723 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi index cdb1b35bc60..c7f9d8b9ee2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_null_type_matches_only_the_null_object_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py index 68e2a7f3021..da49e4c60dd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi index f495d5a7952..f1aa97c0b03 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_number_type_matches_numbers_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py index 5aa6a27806e..a70743db753 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi index b74389a38bd..bff5ac96e30 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_properties_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py index 40cd7685f99..14e911e9c4a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi index 047091ea9c2..f74f7dee223 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_object_type_matches_objects_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py index f3ecfcb58af..7a4b90c73f5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi index d39165de385..452ccbabba8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_complex_types_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py index 1877f6da4d9..07a35895881 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi index 42a1e9bf26d..3733874fa5d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py index 1f3b3963f83..582b8c71aa2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi index 279b69c59e1..8e5fe6a2250 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_base_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py index c306179b3cc..584310ca653 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi index 7213cb5bf9e..f6b1c9628bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_empty_schema_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py index b162c3d2f7b..f6216768ad0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi index 8bba1ed0af0..a5e2dacbd4b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_oneof_with_required_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py index f967ad213b7..1a78816bdc8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi index 49d4f96a6b3..8a1908ff4d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_is_not_anchored_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py index e471efdaa87..8242f606ca4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi index 0e816efc955..80cdb3b96c0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_pattern_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py index a887ee452eb..451dc9bedf4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi index bc34929e9d5..b32036dbd79 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_properties_with_escaped_characters_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py index f3afc02c678..11f8c2fcdc5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi index ed046a68812..dcd3bb41186 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_property_named_ref_that_is_not_a_reference_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py index 5299961db0a..508b7714527 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi index 69c7aabe6ec..62711dbb696 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_additionalproperties_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py index 56ed24a0490..ab389581454 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi index 52a3db58060..95d900ba137 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_allof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py index fc65f2844dd..95f041e457c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi index 18a8b045254..54fe69f7e7a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_anyof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py index 6cd314a773f..8097cfb39f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi index 7fdbdd50355..648518d8886 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_items_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py index bbf30e3725d..42bde282e98 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi index 9696f3db660..1c66540a0b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_not_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py index d6d9f4c7316..2a476f5d326 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi index aec62dd5439..c4620d964c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_oneof_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py index b4b8b6bdf61..d6e9113612c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi index 29eabd380df..dbb0bea11b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_ref_in_property_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py index 72da1b31a09..89e5c1cfecd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi index ca68d7b5839..00752e0d37b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_default_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py index 1e4c8d35a0c..084e0f1ce92 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi index dd6f285a291..a7a600a181d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py index f2b5123e18e..0600acabd46 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi index 5b066904c6e..a2667194cbf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_empty_array_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py index 65bd68b886b..1e9a6b3243a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi index 8600ee74ed4..0c9e6a606c4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_required_with_escaped_characters_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py index 0930c16b049..61cb484f2ea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi index 3c57bcb35a9..4c58df6204f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_simple_enum_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py index 974d2db3dec..ef19bc46fec 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi index 6472cb90291..68dada10a4e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_string_type_matches_strings_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py index b104a6d74f5..1547b25e3f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi index 085cf6d6ff0..28f58c180c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py index 04523057b2b..b88d4c37c21 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi index fb68d5343ee..4fa96c0e544 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_false_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py index 2b85b675435..1eb653df887 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi index 01a5fa6a5a1..4811f1563b7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uniqueitems_validation_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py index e16eea95e3c..40537a234ce 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi index cedc85272e1..c064965985f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py index 69125cddb96..3142c7dc408 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi index f257bb340ea..aec88a6c8c8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_reference_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py index 316e7044a8f..7f3a41a3aea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi index 4a6cfa08227..d3204b4095a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/request_body_post_uri_template_format_request_body/post/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py index 0689338d4f4..ea1040a296f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.pyi index 17e89eed978..575687f3397 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py index 1fe93ec7342..95ddafff27d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.pyi index 36b839a18ce..6fd9189267a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py index 348c7496882..9ed002fc731 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.pyi index 7873802b4e1..4265748a195 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py index b5ed9be1ca5..db2c05f8d5e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.pyi index 76cb6e3637f..0a247d74298 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py index 817dca646cf..dfaacbf762a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.pyi index bdc98b03eba..e61770a0afb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py index c07cbea78e8..b7739a5fa72 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.pyi index 4a775d8f903..0846d9c8219 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py index 72344206b37..dbbe0896ba9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.pyi index 92af1a699fe..8f9a2210e9f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_simple_types_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py index 3a81db5a074..83557443563 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.pyi index 44a6dd8937d..5b8a7abc8c1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_base_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py index 5112d904dc4..3f69c27ed24 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi index 6824bc73a97..1c4346b7d18 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py index 09069729f01..774aa8b477e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.pyi index 6fc5bfcf48b..224888d3dc7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py index 997447686d8..c3525c2506f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.pyi index 563861e054e..bcb028a1d2d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py index 581cdb340e0..935980d76a6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.pyi index 22cdc04ab7a..4ba3db0b338 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py index 9249d777494..e7864564ef6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.pyi index 682a2760d2f..00f6f22f78e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_complex_types_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py index 7931e431e3d..aca20d679c2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.pyi index 0aa52cafc7f..49d5122262c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py index 3de8ee22b1f..1aa79848664 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.pyi index 7b30001156d..2851e42a38d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_base_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py index 44826380bd9..dd9406b5200 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi index 0da812fd16c..dd419f4d7a8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py index cbb03acaaf7..eda200cb650 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.pyi index 2925eb49849..da240e2ca53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_array_type_matches_arrays_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py index 2af0982360a..9e31d26779b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.pyi index 0419edcad7b..9a07dbbeba5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_boolean_type_matches_booleans_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py index 42cead9175e..a0d833e203d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.pyi index 4845c8ce162..3335d1abe73 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_int_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py index e300230cf97..3d91c091310 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.pyi index 41509a95781..60cfd4f544b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_number_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py index 321098165dc..73413342eda 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.pyi index 4c08e683d7e..0d3538a305c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_by_small_number_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py index 874a6506c73..4ed750d32e8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.pyi index 4dac911b64f..797a1771246 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_date_time_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py index eb76b44d98b..1b4e998af09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.pyi index 5124f801cd7..e90c931c51f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_email_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py index 911577ea8c9..b8bafd6a7e4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.pyi index a5954ce2367..78e926259ac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py index db2e1f21966..ac29db61674 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.pyi index 0560ce0e83c..a7e0b33d16a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py index 160f597dc12..ef87e248328 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.pyi index 14c83422082..0e4501084fe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_escaped_characters_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py index 79d6b100b50..afea47cbd2c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.pyi index d5bb9a56312..456b54604f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py index 32c8cbbdf65..aa4fd8b2105 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.pyi index 9aef0aeaf5d..550650b182d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py index e0454e68559..62a31066ee8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.pyi index 5fcf7188ff8..f7890394dde 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_enums_in_properties_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py index 5d76df9b5c5..f8b49f1712c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.pyi index e97029d54da..85a8919d0d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_forbidden_property_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py index 060e7c5cb9c..b8aaacf2548 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.pyi index 957be4a6116..651906cefa1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_hostname_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py index a8c9c0b70ab..da8d488b011 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.pyi index fab809dcb81..089c31cedf2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_integer_type_matches_integers_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py index d8bd8356f27..877c84994e8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.pyi index 872d4d1759a..dc8c9688845 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py index 50a05f4e666..8ef06b23c70 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.pyi index 9547d8a98b8..19afc387aa9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_invalid_string_value_for_default_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py index f4a47a419ad..801f01de960 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.pyi index d02e576e7df..d107980b50e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv4_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py index 300a2123d23..5eb6b69f34a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.pyi index fed1ce1ddbb..ed4a5a2fa5a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ipv6_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py index 088eb086195..548606811b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.pyi index 55880d2e840..827aa2d17b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_json_pointer_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py index 29bedf41567..7c187c7ccda 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.pyi index 9837ddf35bc..fea9803fe09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py index 5e6d41451d3..6f0202ace8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.pyi index 2e5746e7528..bcc0cab5481 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py index 96f0b4abf01..e3b9a522780 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.pyi index 407e4bcdc40..dde95fd5cc9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxitems_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py index b1dcd836170..2f1d813bb25 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.pyi index 82d4935cc6c..f4b1884f972 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxlength_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py index e42a98bd25a..05f4067a8f1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.pyi index 83c51bbc528..542d294d3a8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py index f7c97fdb1b1..676d48bbd9e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.pyi index 185983ec009..f08da941e22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_maxproperties_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py index 19d736639a3..f91604455f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.pyi index 156bc103139..57a9f99a5e0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py index 0388f470720..2957d2caf12 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.pyi index 1457811332e..7d8b061b36e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py index e5aefbbb0dc..e43f177b0e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.pyi index 6565de77dfc..782af8717de 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minitems_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py index 20b732ecf1b..4001bcce9f7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.pyi index 591641a3a90..61dcbdf6d70 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minlength_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py index 90e18080a6c..c36459928d0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.pyi index a1095a0da5a..cb2a736a976 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_minproperties_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py index d6c66cf09cf..9d56dbb0752 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi index 9a3b7cd04fa..5b20afd0c2c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py index 0414e9fb49e..fc16458b7d3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi index e5237093f2c..ab89be4469b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py index 59338cce97a..3dc86365188 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.pyi index 1760ed3537a..d8b557c46c4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_items_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py index 13bee0d233e..43d9143c2d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi index 95960d48149..48b83907fde 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py index 634a197dd0e..11b72ea4641 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.pyi index e58fb118761..90026f9156d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_more_complex_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py index 3741176ee44..caa34e87fd6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.pyi index 04dfa36a764..96219cf09fa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_not_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py index bd19e91dca5..559a8f8c4e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.pyi index 6e78fd1de5f..38149ed7c86 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_nul_characters_in_strings_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py index 9e439d88a75..10a26df5161 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.pyi index 08603c89a9e..f8294b24fd6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py index 6a4518ded3c..f2e0e9eae6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.pyi index a28174176b4..f04a1737803 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_number_type_matches_numbers_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py index 5c5c6f89127..83b52d802cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.pyi index f2395650e5d..4bf07caeee8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_properties_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py index a7cd7610619..e5d32027227 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.pyi index d944af424b4..8cc5909dd9e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_object_type_matches_objects_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py index 238ba33af6e..43c9d1757d1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.pyi index a8a0295613b..ba407db80c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_complex_types_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py index 7000fd4d097..40d299e098b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.pyi index f3df82d05d5..3a934528e32 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py index 7a8138a554c..e04de8de04d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.pyi index e71814ae054..ffd4c5ae47f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_base_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py index 839450fe1e8..d92e2a38d3f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.pyi index aa025dc2353..2a04e08937d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_empty_schema_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py index 809b83f80d4..1b382af1858 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.pyi index 1c4c00b5fc2..aed8f4f15bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_oneof_with_required_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py index 8c765a4d2f3..6dcb580b13d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.pyi index 76043df4005..085c9d4c762 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_is_not_anchored_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py index 21ff6d8a3be..69462c6098c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.pyi index 4120d3d7cc9..de80e502361 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_pattern_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py index 0f1e418aa13..8c2e2beb7b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.pyi index e007421e47e..33e5999af55 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_properties_with_escaped_characters_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py index 58ba3d29d2f..9d9d4bc026e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.pyi index 13a647f9e91..77c1181c5e0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py index ebeddadb5ac..3544d465765 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.pyi index 0942edc4f4f..e9e81a857e5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_additionalproperties_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py index 77101c02969..5978eed02b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.pyi index 57a8f448706..391122d30ed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_allof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py index c2aba950b18..dfb3a27e073 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.pyi index 68cfa92a080..80794f84f50 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_anyof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py index dd4d4e2dd87..23d7e5dc39a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.pyi index eab37a149e6..237346efceb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_items_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py index 2ba015d6d1d..cba482429ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.pyi index e517623b6e4..b5011175ff5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_not_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py index 7a090293178..3bd082a089c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.pyi index 78f289c6633..7b3f45cda81 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_oneof_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py index df54689635a..b6d42f32bc7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.pyi index 731b843419b..a4793663a02 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_ref_in_property_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py index d1e749aeecc..440d2b24133 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.pyi index 015b2a8a167..e76f52ae788 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_default_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py index 187cdf66e04..98a45cb35a0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.pyi index 63feda227e6..58d4ee9a9b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py index a6f84d1d30d..d4ce0777736 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.pyi index 1e5274cfb10..bc9f9596fc2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_empty_array_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py index c279a584924..5ccf211cd08 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.pyi index 44e2d301293..908c6ed5162 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_required_with_escaped_characters_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py index 488efd6695c..7bdb6447ac8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.pyi index 703d7522594..2a228469ade 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_simple_enum_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py index 80e45db0d98..81cc845c82c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.pyi index a561aa2d085..e2e6b109121 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_string_type_matches_strings_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py index d013cac0799..c3b807c3df6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.pyi index 59bf81740c9..ea3d1bb621f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py index ce3fc2ba5ef..3a953a9590a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.pyi index 52f3aaf81ae..cfba61c97d6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_false_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py index 256297d4014..ad5873d561d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.pyi index 2520305a061..d61521dc985 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uniqueitems_validation_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py index f2e64726462..c1e299fcde8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.pyi index b07e5d87d19..074db1c5b39 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py index 4b331a98f16..7749f1d1809 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.pyi index 1b74f83236e..bbaf6d83418 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_reference_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py index bf409d18d77..fc23cb73e68 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -101,14 +108,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.pyi b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.pyi index ca4f12db6f4..a8b5dbbd81c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.pyi +++ b/samples/openapi3/client/3_0_3_unit_test/python/unit_test_api/paths/response_body_post_uri_template_format_response_body_for_content_types/post/__init__.pyi @@ -96,14 +96,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py index b01a8441aa6..91a828c6a1b 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/api_client.py @@ -936,12 +936,19 @@ def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict] ) -class OpenApiResponse(JSONDetector, TypedDictInputVerifier): +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] def __init__( self, - response_cls: typing.Type[ApiResponse] = ApiResponse, + response_cls: typing.Type[T], content: typing.Optional[typing.Dict[str, MediaType]] = None, headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, ): @@ -1026,7 +1033,7 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py index cd641dc8a3b..b9746a34b11 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/exceptions.py @@ -8,6 +8,10 @@ The version of the OpenAPI document: 1.0 Generated by: https://openapi-generator.tech """ +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict class OpenApiException(Exception): @@ -97,30 +101,25 @@ def __init__(self, msg, path_to_item=None): super(ApiKeyError, self).__init__(full_msg) -class ApiException(OpenApiException): +T = typing.TypeVar("T") - def __init__(self, status=None, reason=None, api_response: 'this_package.api_client.ApiResponse' = None): - if api_response: - self.status = api_response.response.status - self.reason = api_response.response.reason - self.body = api_response.response.data - self.headers = api_response.response.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None def __str__(self): """Custom error messages for exception""" error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.api_response: + if self.api_response.response.getheaders(): + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.getheaders()) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) return error_message diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py index cd6454b40a9..3a036c5a523 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -126,14 +133,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi index 2d462237779..8e64ae96aec 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/this_package/paths/operators/post/__init__.pyi @@ -121,14 +121,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response 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 31b16dc6925..4de2f954560 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -936,12 +936,19 @@ def _verify_typed_dict_inputs_oapg(cls: typing.Type[typing_extensions.TypedDict] ) -class OpenApiResponse(JSONDetector, TypedDictInputVerifier): +T = typing.TypeVar("T") + + +@dataclasses.dataclass +class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): __filename_content_disposition_pattern = re.compile('filename="(.+?)"') + response_cls: typing.Type[T] + content: typing.Optional[typing.Dict[str, MediaType]] + headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] def __init__( self, - response_cls: typing.Type[ApiResponse] = ApiResponse, + response_cls: typing.Type[T], content: typing.Optional[typing.Dict[str, MediaType]] = None, headers: typing.Optional[typing.Dict[str, HeaderParameterWithoutName]] = None, ): @@ -1026,7 +1033,7 @@ def __deserialize_multipart_form_data( for part in msg.get_payload() } - def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> ApiResponse: + def deserialize(self, response: urllib3.HTTPResponse, configuration: Configuration) -> T: content_type = response.getheader('content-type') deserialized_body = unset streamed = response.supports_chunked_reads() diff --git a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py index ed422fd2d0e..b449149d0ec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/exceptions.py +++ b/samples/openapi3/client/petstore/python/petstore_api/exceptions.py @@ -8,6 +8,10 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ +import dataclasses +import typing + +from urllib3._collections import HTTPHeaderDict class OpenApiException(Exception): @@ -97,30 +101,25 @@ def __init__(self, msg, path_to_item=None): super(ApiKeyError, self).__init__(full_msg) -class ApiException(OpenApiException): +T = typing.TypeVar("T") - def __init__(self, status=None, reason=None, api_response: 'petstore_api.api_client.ApiResponse' = None): - if api_response: - self.status = api_response.response.status - self.reason = api_response.response.reason - self.body = api_response.response.data - self.headers = api_response.response.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + +@dataclasses.dataclass +class ApiException(OpenApiException, typing.Generic[T]): + status: int + reason: str + api_response: typing.Optional[T] = None def __str__(self): """Custom error messages for exception""" error_message = "({0})\n"\ "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.api_response: + if self.api_response.response.getheaders(): + error_message += "HTTP response headers: {0}\n".format( + self.api_response.response.getheaders()) + if self.api_response.response.data: + error_message += "HTTP response body: {0}\n".format(self.api_response.response.data) return error_message diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py index deface086d5..bd0ae018d39 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -140,14 +147,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi index c6a5683b458..758c72a5cfe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/another_fake_dummy/patch/__init__.pyi @@ -135,14 +135,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py index eb81be4fa13..2bc645918c1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.py @@ -93,9 +93,16 @@ class Params(RequiredParams, OptionalParams): 'bearer_test', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -184,14 +191,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi index 3d69ea6f3f1..8f65fda118e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/delete/__init__.pyi @@ -175,14 +175,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py index 74f3230edab..eeb3831bf0b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.py @@ -91,10 +91,18 @@ class Params(RequiredParams, OptionalParams): parameter_0.parameter_oapg, parameter_1.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '404': response_for_404.response, -} +}) class BaseApi(api_client.Api): @@ -216,14 +224,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi index d5f0e159ca9..7a12cf1ab56 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/get/__init__.pyi @@ -210,14 +210,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py index 7865f160fa1..7291d0ea51a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -140,14 +147,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi index 5cddb17e432..b9d9fb25072 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/patch/__init__.pyi @@ -135,14 +135,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py index 20a8d607620..7467205fb38 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.py @@ -35,10 +35,18 @@ 'http_basic_test', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '404': response_for_404.response, -} +}) class BaseApi(api_client.Api): @@ -132,14 +140,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi index 30235af3ad7..6113c740236 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake/post/__init__.pyi @@ -122,14 +122,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py index b8f24b26575..58ce6ef4fdf 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -138,14 +145,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi index dd27b16608f..5a81a0259b5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_additional_properties_with_array_of_enums/get/__init__.pyi @@ -133,14 +133,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py index 8dc7e1ebd86..527edd70eba 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi index d875542f7a1..80c99030d77 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_file_schema/put/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py index 5520afcd3fb..0afc700ddae 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.py @@ -56,9 +56,16 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -169,14 +176,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi index 4ca29986534..cb0ce4c3539 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_body_with_query_params/put/__init__.pyi @@ -164,14 +164,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py index 05536a02325..cb1e5e66977 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.py @@ -58,9 +58,16 @@ class Params(RequiredParams, OptionalParams): parameter_1.parameter_oapg, parameter_2.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -133,14 +140,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi index b08b8a81802..98d8c384fa5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_case_sensitive_params/put/__init__.pyi @@ -128,14 +128,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py index 957739e0488..de25208ce3b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.py @@ -36,9 +36,16 @@ 'api_key_query', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -145,14 +152,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi index 5d7c1178ffd..9376e139190 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_classname_test/patch/__init__.pyi @@ -136,14 +136,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py index ef5043fdbbe..e30d3277f93 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.py @@ -53,10 +53,17 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +default_response = response_for_default.response +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, - 'default': response_for_default.response, -} +}) class BaseApi(api_client.Api): @@ -132,18 +139,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi index 48730b21f23..ef32609d7c6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_delete_coffee_id/delete/__init__.pyi @@ -126,18 +126,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py index fa00d386ba9..563a0b5cf18 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -102,14 +109,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.pyi index 9456cf61380..9802bc4425a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_health/get/__init__.pyi @@ -97,14 +97,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py index fd3462d1914..18da43de164 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.py @@ -30,9 +30,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -127,14 +134,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi index de21e6f9883..62740402de7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_additional_properties/post/__init__.pyi @@ -122,14 +122,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py index c39df6a677c..f6c6ef15936 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.py @@ -57,9 +57,16 @@ class Params(RequiredParams, OptionalParams): parameter_0.parameter_oapg, parameter_1.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', 'multipart/form-data', @@ -195,14 +202,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi index 57478347498..ddfa94e1908 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_inline_composition_/post/__init__.pyi @@ -190,14 +190,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py index 8a081f5061a..c7b127f4179 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.py @@ -30,9 +30,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -125,14 +132,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi index 3635f556cbe..5eac75739fa 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_form_data/get/__init__.pyi @@ -120,14 +120,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py index 52981d4435d..4041a3be821 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -127,14 +134,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi index c04103050f0..6d38b97d5ce 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_patch/patch/__init__.pyi @@ -122,14 +122,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py index 01c14e5f5fa..586a3c4c9e3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.py @@ -30,9 +30,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json; charset=utf-8', ) @@ -136,14 +143,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi index a65aa968623..071563e4d77 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_json_with_charset/post/__init__.pyi @@ -131,14 +131,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py index 041adeb9cd1..a701cca93fc 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.py @@ -52,9 +52,16 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -128,14 +135,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi index 4a1f09d422f..11aac86023d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_obj_in_query/get/__init__.pyi @@ -123,14 +123,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py index 722b566eae4..9da365076f3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.py @@ -171,9 +171,16 @@ class Params(RequiredParams, OptionalParams): parameter_17.parameter_oapg, parameter_18.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -329,14 +336,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi index 799e63f429b..17a0f4b9fa0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_parameter_collisions_1_a_b_ab_self_a_b_/post/__init__.pyi @@ -324,14 +324,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py index c574bb19129..5982d6f672f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.py @@ -58,9 +58,16 @@ class Params(RequiredParams, OptionalParams): 'petstore_auth', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -182,14 +189,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi index 22a6f89e846..299d2cfb42b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/__init__.pyi @@ -173,14 +173,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py index ba17c0a1cc0..d864746404a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.py @@ -53,9 +53,16 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -142,14 +149,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi index e2bf931cbee..55c3f5f75f4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_query_param_with_json_content_type/get/__init__.pyi @@ -137,14 +137,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py index 64e9e2c8a95..48ddd14aa80 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.py @@ -54,9 +54,16 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -130,14 +137,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi index 92250a34d09..cc50b535189 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_ref_obj_in_query/get/__init__.pyi @@ -125,14 +125,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py index c2f674d27dc..25e2ce5fd81 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -138,14 +145,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi index 27976191654..7c69f164cf3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_array_of_enums/post/__init__.pyi @@ -133,14 +133,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py index 00c8f8df70a..ce0fb607199 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi index c52b319825d..2139b730a28 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_arraymodel/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py index 9a0757b3328..7adaa60159e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi index fbaff9530ad..afabc0e66fe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_boolean/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py index 4493cf70354..8e559dd7963 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi index f9185516ece..18045a1209a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_composed_one_of_number_with_validations/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py index aee8a7ab298..2a070345f44 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi index 222df889c68..c64c53c6657 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_enum/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py index faeb4adb4de..6e7ea8b620d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -139,14 +146,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi index 783239cbf5b..145005edbac 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_mammal/post/__init__.pyi @@ -134,14 +134,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py index a2f041a1269..811641c3316 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi index 26e3a5b8491..962e86d55a0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_number/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py index 4305b9d2c43..d4f6b211717 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi index bd429a518bd..20043c5ddf5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_object_model_with_ref_props/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py index a2f125bd375..e3f5e44aa3c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.py @@ -32,9 +32,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -137,14 +144,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi index 6040fc7ac19..dca8b27f8a2 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_refs_string/post/__init__.pyi @@ -132,14 +132,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py index 3b52bc50e1d..cb6e7c327f4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.py @@ -29,9 +29,16 @@ from . import response_for_200 -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', 'application/xml', @@ -103,14 +110,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.pyi index 76b13b0db70..b4fdaad57f0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_response_without_schema/get/__init__.pyi @@ -98,14 +98,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py index 65b56a6e01a..05581676608 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.py @@ -69,9 +69,16 @@ class Params(RequiredParams, OptionalParams): parameter_4.parameter_oapg, parameter_5.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) class BaseApi(api_client.Api): @@ -144,14 +151,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi index ed6b13e13be..a8532ca9590 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_test_query_paramters/put/__init__.pyi @@ -139,14 +139,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py index c5d6eaac7ae..399b6e95e02 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.py @@ -30,9 +30,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/octet-stream', ) @@ -138,14 +145,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi index 8f862398e47..22337624c06 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_download_file/post/__init__.pyi @@ -133,14 +133,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py index e184cf65619..3b3387a1ff1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.py @@ -30,9 +30,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -136,14 +143,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi index 90a770a1a80..dbb3ac21494 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_file/post/__init__.pyi @@ -131,14 +131,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py index e9a58eb8a49..a03936af5f8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.py @@ -30,9 +30,16 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -136,14 +143,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi index 3346dfecece..8d9a70afa70 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/fake_upload_files/post/__init__.pyi @@ -131,14 +131,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py index 3c2c4da0c4e..4d7c98f0c49 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.py @@ -29,9 +29,8 @@ from . import response_for_default -_status_code_to_response = { - 'default': response_for_default.response, -} + +default_response = response_for_default.response _all_accept_content_types = ( 'application/json', ) @@ -101,18 +100,14 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.pyi index e5511440d84..e0d5b00c6fe 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/foo/get/__init__.pyi @@ -96,18 +96,14 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py index 98c4b076255..3d0b08c994f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.py @@ -49,10 +49,18 @@ }, ) -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '405': api_client.OpenApiResponse[response_for_405.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '405': response_for_405.response, -} +}) class BaseApi(api_client.Api): @@ -169,14 +177,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '405', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi index 4093cafaff8..dc983ac98a9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/post/__init__.pyi @@ -147,14 +147,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '405', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py index 6880b08cae7..180decd8787 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.py @@ -50,11 +50,20 @@ }, ) -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + '405': api_client.OpenApiResponse[response_for_405.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '400': response_for_400.response, '404': response_for_404.response, '405': response_for_405.response, -} +}) class BaseApi(api_client.Api): @@ -161,14 +170,23 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + '405', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi index a481b5e3351..05b244d2b2a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet/put/__init__.pyi @@ -138,14 +138,23 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + '405', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py index 120b136b036..948ada7c123 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.py @@ -59,10 +59,18 @@ class Params(RequiredParams, OptionalParams): 'petstore_auth', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -151,14 +159,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi index b4ae0be13a1..b6af738bcec 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_status/get/__init__.pyi @@ -140,14 +140,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py index 57a41cd70bf..e55350c96cd 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.py @@ -59,10 +59,18 @@ class Params(RequiredParams, OptionalParams): 'petstore_auth', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -151,14 +159,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi index 47579fef9ec..434d06a608a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_find_by_tags/get/__init__.pyi @@ -140,14 +140,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py index aa45e2fc46e..b5390fdb492 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.py @@ -81,9 +81,16 @@ class Params(RequiredParams, OptionalParams): 'petstore_auth', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '400': response_for_400.response, -} +}) class BaseApi(api_client.Api): @@ -168,14 +175,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi index 0f29290b748..057d7d27cf1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/delete/__init__.pyi @@ -159,14 +159,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py index 0adf2ea9fb4..708cf6c6d2b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.py @@ -59,11 +59,20 @@ class Params(RequiredParams, OptionalParams): 'api_key', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, '404': response_for_404.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -152,14 +161,23 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi index 71f896f2f00..7b1b670af51 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/get/__init__.pyi @@ -141,14 +141,23 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py index cde1a17c9af..580087cc5c7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.py @@ -58,9 +58,16 @@ class Params(RequiredParams, OptionalParams): 'petstore_auth', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '405': api_client.OpenApiResponse[response_for_405.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '405': response_for_405.response, -} +}) class BaseApi(api_client.Api): @@ -164,14 +171,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '405', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi index 49e860edd3f..1ebe5cb3965 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id/post/__init__.pyi @@ -155,14 +155,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '405', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py index ad065637c5a..69950b6481f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.py @@ -58,9 +58,16 @@ class Params(RequiredParams, OptionalParams): 'petstore_auth', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -182,14 +189,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi index 36922eaa103..d676b27e657 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/pet_pet_id_upload_image/post/__init__.pyi @@ -173,14 +173,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py index d9a97d70383..a0a32448a44 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.py @@ -33,9 +33,16 @@ 'api_key', ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, -} +}) _all_accept_content_types = ( 'application/json', ) @@ -107,14 +114,21 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.pyi index 6954d0e40ba..a5844e0e25d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_inventory/get/__init__.pyi @@ -98,14 +98,21 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py index 65fb9214a3a..c98dcc84f0c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.py @@ -33,10 +33,18 @@ from . import request_body -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -143,14 +151,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi index 798c7a3447d..237a2153789 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order/post/__init__.pyi @@ -137,14 +137,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py index 11a1e9743ff..69784f79b2e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.py @@ -53,10 +53,18 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '400': response_for_400.response, '404': response_for_404.response, -} +}) class BaseApi(api_client.Api): @@ -126,14 +134,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi index afa821b1f3a..967e001b5e0 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/delete/__init__.pyi @@ -120,14 +120,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py index ea4c86cd48b..9726351b70a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.py @@ -55,11 +55,20 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, '404': response_for_404.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -147,14 +156,23 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi index 2ee6c1ecad4..3de21cbaf35 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/store_order_order_id/get/__init__.pyi @@ -140,14 +140,23 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py index 1a170702cc5..7dc13b9786e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.py @@ -32,9 +32,8 @@ from . import request_body -_status_code_to_response = { - 'default': response_for_default.response, -} + +default_response = response_for_default.response class BaseApi(api_client.Api): @@ -129,18 +128,14 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi index 3d988e4c8ed..c3c80e34f46 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user/post/__init__.pyi @@ -124,18 +124,14 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py index e3a246d1781..a0aee433012 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.py @@ -32,9 +32,8 @@ from . import request_body -_status_code_to_response = { - 'default': response_for_default.response, -} + +default_response = response_for_default.response class BaseApi(api_client.Api): @@ -129,18 +128,14 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi index 8f80a392830..3a80f5d4c67 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_array/post/__init__.pyi @@ -124,18 +124,14 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py index ff2886b0c63..e7ae3ad00ac 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.py @@ -32,9 +32,8 @@ from . import request_body -_status_code_to_response = { - 'default': response_for_default.response, -} + +default_response = response_for_default.response class BaseApi(api_client.Api): @@ -129,18 +128,14 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi index 437159458a9..3e3d46d6a8c 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_create_with_list/post/__init__.pyi @@ -124,18 +124,14 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py index ea70d93e794..b1e1d1fcaf1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.py @@ -57,10 +57,18 @@ class Params(RequiredParams, OptionalParams): parameter_0.parameter_oapg, parameter_1.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -148,14 +156,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi index 3ea575fa3d8..8829fa03bb1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_login/get/__init__.pyi @@ -142,14 +142,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py index f3723270e88..461b995438d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.py @@ -28,9 +28,8 @@ from . import response_for_default -_status_code_to_response = { - 'default': response_for_default.response, -} + +default_response = response_for_default.response class BaseApi(api_client.Api): @@ -88,18 +87,14 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.pyi index d6aa06821b7..44ff5e780b4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_logout/get/__init__.pyi @@ -83,18 +83,14 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) - else: - default_response = _status_code_to_response.get('default') - if default_response: - api_response = default_response.deserialize(response, self.api_client.configuration) - else: - api_response = api_client.ApiResponseWithoutDeserialization(response=response) + api_response = default_response.deserialize(response, self.api_client.configuration) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py index 6c5b63cade1..4c1621b57a1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.py @@ -53,10 +53,18 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '404': response_for_404.response, -} +}) class BaseApi(api_client.Api): @@ -130,14 +138,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi index 9a118306769..10cd329e030 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/delete/__init__.pyi @@ -124,14 +124,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py index b44a9d15f50..f70a8fea25e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.py @@ -55,11 +55,20 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '200': api_client.OpenApiResponse[response_for_200.ApiResponse], + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '200': response_for_200.response, '400': response_for_400.response, '404': response_for_404.response, -} +}) _all_accept_content_types = ( 'application/xml', 'application/json', @@ -147,14 +156,23 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi index 1739eb4afe6..800d174be9e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/get/__init__.pyi @@ -140,14 +140,23 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '200', + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py index 3cdd32bd9c0..4607f8844a8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.py @@ -57,10 +57,18 @@ class Params(RequiredParams, OptionalParams): parameters = [ parameter_0.parameter_oapg, ] -_status_code_to_response = { + +__StatusCodeToResponse = typing_extensions.TypedDict( + '__StatusCodeToResponse', + { + '400': api_client.OpenApiResponse[response_for_400.ApiResponse], + '404': api_client.OpenApiResponse[response_for_404.ApiResponse], + } +) +_status_code_to_response = __StatusCodeToResponse({ '400': response_for_400.response, '404': response_for_404.response, -} +}) class BaseApi(api_client.Api): @@ -165,14 +173,22 @@ class instances if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi index ee1f1d961cb..3ac6eb7e739 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi +++ b/samples/openapi3/client/petstore/python/petstore_api/paths/user_username/put/__init__.pyi @@ -159,14 +159,22 @@ class BaseApi(api_client.Api): if skip_deserialization: api_response = api_client.ApiResponseWithoutDeserialization(response=response) else: - response_for_status = _status_code_to_response.get(str(response.status)) - if response_for_status: - api_response = response_for_status.deserialize(response, self.api_client.configuration) + status = str(response.status) + if status in _status_code_to_response: + status: typing_extensions.Literal[ + '400', + '404', + ] + api_response = _status_code_to_response[status].deserialize(response, self.api_client.configuration) else: api_response = api_client.ApiResponseWithoutDeserialization(response=response) if not 200 <= response.status <= 299: - raise exceptions.ApiException(api_response=api_response) + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) return api_response diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py index bd9893de0a9..fc89a14978b 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py @@ -17,7 +17,7 @@ import urllib3 import petstore_api -from petstore_api import api_client +from petstore_api import api_client, schemas from petstore_api.schemas import NoneClass @@ -49,7 +49,13 @@ def test_deserialize_shape(self): by traveling through 2 discriminators """ from petstore_api.components.schema import shape, equilateral_triangle + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: shape.Shape + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=shape.Shape), }, @@ -87,7 +93,13 @@ def test_deserialize_animal(self): This is the swagger (v2) way of doing something like oneOf composition """ from petstore_api.components.schema import animal, dog + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: animal.Animal + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=animal.Animal), }, @@ -151,7 +163,13 @@ def test_deserialize_mammal(self): # whale test from petstore_api.components.schema import mammal, zebra, whale + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: mammal.Mammal + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), }, @@ -191,7 +209,13 @@ def test_deserialize_float_value(self): Deserialize floating point values. """ from petstore_api.components.schema import banana + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: banana.Banana + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=banana.Banana), }, @@ -227,7 +251,13 @@ def test_deserialize_fruit_null_value(self): fruitReq is a oneOf composed schema model with discriminator, including 'null' type. """ from petstore_api.components.schema import fruit_req + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: fruit_req.FruitReq + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=fruit_req.FruitReq), }, @@ -261,7 +291,13 @@ def test_deserialize_with_additional_properties(self): 'size': 'medium', } response = self.__response(data) + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: dog.Dog + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=dog.Dog), }, @@ -288,7 +324,13 @@ def test_deserialize_with_additional_properties(self): 'p2': ['a', 'b', 123], } response = self.__response(data) + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: mammal.Mammal + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), }, @@ -302,7 +344,13 @@ def test_deserialize_with_additional_properties(self): # The 'bananaReq' schema disallows additional properties by explicitly setting # additionalProperties: false + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: banana_req.BananaReq + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=banana_req.BananaReq), }, @@ -327,7 +375,13 @@ def test_deserialize_with_additional_properties_and_reference(self): and the schema is specified as a reference ($ref). """ from petstore_api.components.schema import drawing + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: drawing.Drawing + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=drawing.Drawing), }, @@ -397,7 +451,13 @@ def test_multiple_of_deserialization(self): 'float': 62.4, } from petstore_api.components.schema import format_test + class ApiResponse(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: format_test.FormatTest + headers: schemas.Unset + _response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponse, content={ self.json_content_type: api_client.MediaType(schema=format_test.FormatTest), },