diff --git a/.github/workflows/samples-python-petstore.yaml b/.github/workflows/samples-python-petstore.yaml
index 658b506ff0e..e8b476e9c7f 100644
--- a/.github/workflows/samples-python-petstore.yaml
+++ b/.github/workflows/samples-python-petstore.yaml
@@ -35,6 +35,7 @@ jobs:
sample:
- samples/openapi3/client/petstore/python-aiohttp
- samples/openapi3/client/petstore/python
+ - samples/openapi3/client/petstore/python-lazyImports
services:
petstore-api:
image: swaggerapi/petstore
diff --git a/bin/configs/python-lazyImports.yaml b/bin/configs/python-lazyImports.yaml
new file mode 100644
index 00000000000..88c0b631caf
--- /dev/null
+++ b/bin/configs/python-lazyImports.yaml
@@ -0,0 +1,18 @@
+generatorName: python
+outputDir: samples/openapi3/client/petstore/python-lazyImports
+inputSpec: modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml
+templateDir: modules/openapi-generator/src/main/resources/python
+additionalProperties:
+ packageName: petstore_api
+ useOneOfDiscriminatorLookup: "true"
+ disallowAdditionalPropertiesIfNotPresent: false
+ mapNumberTo: StrictFloat
+ lazyImports: 'true'
+nameMappings:
+ _type: underscore_type
+ type_: type_with_underscore
+modelNameMappings:
+ # The OpenAPI spec ApiResponse conflicts with the internal ApiResponse
+ ApiResponse: ModelApiResponse
+openapiNormalizer:
+ SIMPLIFY_ONEOF_ANYOF_ENUM: false
diff --git a/docs/generators/python.md b/docs/generators/python.md
index 51b011e0440..0c2df7ed72f 100644
--- a/docs/generators/python.md
+++ b/docs/generators/python.md
@@ -24,6 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
- **false**
- The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
- **true**
- Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true|
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
+|lazyImports|Enable lazy imports.| |false|
|library|library template (sub-template) to use: asyncio, tornado (deprecated), urllib3| |urllib3|
|mapNumberTo|Map number to Union[StrictFloat, StrictInt], StrictStr or float.| |Union[StrictFloat, StrictInt]|
|packageName|python package name (convention: snake_case).| |openapi_client|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
index 011b807c98d..63f5d24933f 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java
@@ -48,6 +48,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
public static final String DATE_FORMAT = "dateFormat";
public static final String SET_ENSURE_ASCII_TO_FALSE = "setEnsureAsciiToFalse";
public static final String POETRY1_FALLBACK = "poetry1";
+ public static final String LAZY_IMPORTS = "lazyImports";
@Setter protected String packageUrl;
protected String apiDocPath = "docs/";
@@ -151,6 +152,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
.defaultValue("%Y-%m-%d"));
cliOptions.add(new CliOption(CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC).defaultValue("false"));
cliOptions.add(new CliOption(POETRY1_FALLBACK, "Fallback to formatting pyproject.toml to Poetry 1.x format."));
+ cliOptions.add(new CliOption(LAZY_IMPORTS, "Enable lazy imports.").defaultValue(Boolean.FALSE.toString()));
supportedLibraries.put("urllib3", "urllib3-based client");
supportedLibraries.put("asyncio", "asyncio-based client");
@@ -264,6 +266,10 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
additionalProperties.put(DATE_FORMAT, dateFormat);
}
+ if (additionalProperties.containsKey(LAZY_IMPORTS)) {
+ additionalProperties.put(LAZY_IMPORTS, Boolean.valueOf(additionalProperties.get(LAZY_IMPORTS).toString()));
+ }
+
String modelPath = packagePath() + File.separatorChar + modelPackage.replace('.', File.separatorChar);
String apiPath = packagePath() + File.separatorChar + apiPackage.replace('.', File.separatorChar);
diff --git a/modules/openapi-generator/src/main/resources/python/__init__api.mustache b/modules/openapi-generator/src/main/resources/python/__init__api.mustache
index b67117ea58f..dff26fb1fce 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__api.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__api.mustache
@@ -1,6 +1,9 @@
# flake8: noqa
-if __import__("typing").TYPE_CHECKING:
+{{^lazyImports}}
+{{>exports_api}}
+{{/lazyImports}}
+{{#lazyImports}}if __import__("typing").TYPE_CHECKING:
{{>exports_api}}
else:
from lazy_imports import LazyModule, as_package, load
@@ -13,3 +16,4 @@ else:
doc=__doc__,
)
)
+{{/lazyImports}}
diff --git a/modules/openapi-generator/src/main/resources/python/__init__model.mustache b/modules/openapi-generator/src/main/resources/python/__init__model.mustache
index 7e40f3fcf35..117f69132c4 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__model.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__model.mustache
@@ -3,8 +3,10 @@
# flake8: noqa
{{>partial_header}}
-
-if __import__("typing").TYPE_CHECKING:
+{{^lazyImports}}
+{{>exports_model}}
+{{/lazyImports}}
+{{#lazyImports}}if __import__("typing").TYPE_CHECKING:
{{>exports_model}}
else:
from lazy_imports import LazyModule, as_package, load
@@ -17,3 +19,4 @@ else:
doc=__doc__,
)
)
+{{/lazyImports}}
diff --git a/modules/openapi-generator/src/main/resources/python/__init__package.mustache b/modules/openapi-generator/src/main/resources/python/__init__package.mustache
index 7d1cb6943a0..73f0adf0d47 100644
--- a/modules/openapi-generator/src/main/resources/python/__init__package.mustache
+++ b/modules/openapi-generator/src/main/resources/python/__init__package.mustache
@@ -24,7 +24,10 @@ __all__ = [
{{/-last}}{{#-last}},{{/-last}}{{/model}}{{/models}}
]
-if __import__("typing").TYPE_CHECKING:
+{{^lazyImports}}
+{{>exports_package}}
+{{/lazyImports}}
+{{#lazyImports}}if __import__("typing").TYPE_CHECKING:
{{>exports_package}}
else:
from lazy_imports import LazyModule, as_package, load
@@ -39,6 +42,7 @@ else:
doc=__doc__,
)
)
+{{/lazyImports}}
{{#recursionLimit}}
__import__('sys').setrecursionlimit({{{.}}})
diff --git a/modules/openapi-generator/src/main/resources/python/pyproject.mustache b/modules/openapi-generator/src/main/resources/python/pyproject.mustache
index 5f7f1581136..12997eed86b 100644
--- a/modules/openapi-generator/src/main/resources/python/pyproject.mustache
+++ b/modules/openapi-generator/src/main/resources/python/pyproject.mustache
@@ -48,7 +48,9 @@ pycryptodome = ">= 3.9.0"
{{/hasHttpSignatureMethods}}
pydantic = ">= 2"
typing-extensions = ">= 4.7.1"
+{{#lazyImports}}
lazy-imports = ">= 1, < 2"
+{{/lazyImports}}
{{/poetry1}}
{{^poetry1}}
requires-python = ">=3.9"
@@ -69,7 +71,9 @@ dependencies = [
{{/hasHttpSignatureMethods}}
"pydantic (>=2)",
"typing-extensions (>=4.7.1)",
+{{#lazyImports}}
"lazy-imports (>=1,<2)"
+{{/lazyImports}}
]
[project.urls]
diff --git a/modules/openapi-generator/src/main/resources/python/requirements.mustache b/modules/openapi-generator/src/main/resources/python/requirements.mustache
index 82b57e8c9c2..132751d7a71 100644
--- a/modules/openapi-generator/src/main/resources/python/requirements.mustache
+++ b/modules/openapi-generator/src/main/resources/python/requirements.mustache
@@ -13,4 +13,6 @@ pycryptodome >= 3.9.0
{{/hasHttpSignatureMethods}}
pydantic >= 2
typing-extensions >= 4.7.1
+{{#lazyImports}}
lazy-imports >= 1, < 2
+{{/lazyImports}}
diff --git a/modules/openapi-generator/src/main/resources/python/setup.mustache b/modules/openapi-generator/src/main/resources/python/setup.mustache
index 9540d4ba844..1fb79c09a2b 100644
--- a/modules/openapi-generator/src/main/resources/python/setup.mustache
+++ b/modules/openapi-generator/src/main/resources/python/setup.mustache
@@ -30,7 +30,9 @@ REQUIRES = [
{{/hasHttpSignatureMethods}}
"pydantic >= 2",
"typing-extensions >= 4.7.1",
+{{#lazyImports}}
"lazy-imports >= 1, < 2",
+{{/lazyImports}}
]
setup(
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py
index a4a081020d9..e390db819e8 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/__init__.py
@@ -48,49 +48,7 @@ __all__ = [
"TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter",
]
-if __import__("typing").TYPE_CHECKING:
- # import apis into sdk package
- from openapi_client.api.auth_api import AuthApi as AuthApi
- from openapi_client.api.body_api import BodyApi as BodyApi
- from openapi_client.api.form_api import FormApi as FormApi
- from openapi_client.api.header_api import HeaderApi as HeaderApi
- from openapi_client.api.path_api import PathApi as PathApi
- from openapi_client.api.query_api import QueryApi as QueryApi
-
- # import ApiClient
- from openapi_client.api_response import ApiResponse as ApiResponse
- from openapi_client.api_client import ApiClient as ApiClient
- from openapi_client.configuration import Configuration as Configuration
- from openapi_client.exceptions import OpenApiException as OpenApiException
- from openapi_client.exceptions import ApiTypeError as ApiTypeError
- from openapi_client.exceptions import ApiValueError as ApiValueError
- from openapi_client.exceptions import ApiKeyError as ApiKeyError
- from openapi_client.exceptions import ApiAttributeError as ApiAttributeError
- from openapi_client.exceptions import ApiException as ApiException
-
- # import models into sdk package
- from openapi_client.models.bird import Bird as Bird
- from openapi_client.models.category import Category as Category
- from openapi_client.models.data_query import DataQuery as DataQuery
- from openapi_client.models.default_value import DefaultValue as DefaultValue
- from openapi_client.models.number_properties_only import NumberPropertiesOnly as NumberPropertiesOnly
- from openapi_client.models.pet import Pet as Pet
- from openapi_client.models.query import Query as Query
- from openapi_client.models.string_enum_ref import StringEnumRef as StringEnumRef
- from openapi_client.models.tag import Tag as Tag
- from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker as TestFormObjectMultipartRequestMarker
- from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter as TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter as TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- ("__version__", __version__),
- ("__all__", __all__),
- """# import apis into sdk package
+# import apis into sdk package
from openapi_client.api.auth_api import AuthApi as AuthApi
from openapi_client.api.body_api import BodyApi as BodyApi
from openapi_client.api.form_api import FormApi as FormApi
@@ -123,8 +81,3 @@ from openapi_client.models.test_form_object_multipart_request_marker import Test
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter as TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter as TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/__init__.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/__init__.py
index c55dee436e1..9c9ae790c3b 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/__init__.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api/__init__.py
@@ -1,21 +1,6 @@
# flake8: noqa
-if __import__("typing").TYPE_CHECKING:
- # import apis into api package
- from openapi_client.api.auth_api import AuthApi
- from openapi_client.api.body_api import BodyApi
- from openapi_client.api.form_api import FormApi
- from openapi_client.api.header_api import HeaderApi
- from openapi_client.api.path_api import PathApi
- from openapi_client.api.query_api import QueryApi
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import apis into api package
+# import apis into api package
from openapi_client.api.auth_api import AuthApi
from openapi_client.api.body_api import BodyApi
from openapi_client.api.form_api import FormApi
@@ -23,8 +8,3 @@ from openapi_client.api.header_api import HeaderApi
from openapi_client.api.path_api import PathApi
from openapi_client.api.query_api import QueryApi
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/__init__.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/__init__.py
index abd67e38090..10474719c5a 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/__init__.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/__init__.py
@@ -13,29 +13,7 @@
Do not edit the class manually.
""" # noqa: E501
-
-if __import__("typing").TYPE_CHECKING:
- # import models into model package
- from openapi_client.models.bird import Bird
- from openapi_client.models.category import Category
- from openapi_client.models.data_query import DataQuery
- from openapi_client.models.default_value import DefaultValue
- from openapi_client.models.number_properties_only import NumberPropertiesOnly
- from openapi_client.models.pet import Pet
- from openapi_client.models.query import Query
- from openapi_client.models.string_enum_ref import StringEnumRef
- from openapi_client.models.tag import Tag
- from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
- from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import models into model package
+# import models into model package
from openapi_client.models.bird import Bird
from openapi_client.models.category import Category
from openapi_client.models.data_query import DataQuery
@@ -49,8 +27,3 @@ from openapi_client.models.test_form_object_multipart_request_marker import Test
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml
index fcf9c73b152..84c2c75e9f8 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/pyproject.toml
@@ -15,7 +15,6 @@ dependencies = [
"python-dateutil (>=2.8.2)",
"pydantic (>=2)",
"typing-extensions (>=4.7.1)",
- "lazy-imports (>=1,<2)"
]
[project.urls]
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/requirements.txt b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/requirements.txt
index 867a4496cd4..6cbb2b98b16 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/requirements.txt
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/requirements.txt
@@ -2,4 +2,3 @@ urllib3 >= 2.1.0, < 3.0.0
python_dateutil >= 2.8.2
pydantic >= 2
typing-extensions >= 4.7.1
-lazy-imports >= 1, < 2
diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py
index c7563af2915..5527d5073fe 100644
--- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py
+++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/setup.py
@@ -29,7 +29,6 @@ REQUIRES = [
"python-dateutil >= 2.8.2",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
- "lazy-imports >= 1, < 2",
]
setup(
diff --git a/samples/client/echo_api/python/openapi_client/__init__.py b/samples/client/echo_api/python/openapi_client/__init__.py
index a4a081020d9..e390db819e8 100644
--- a/samples/client/echo_api/python/openapi_client/__init__.py
+++ b/samples/client/echo_api/python/openapi_client/__init__.py
@@ -48,49 +48,7 @@ __all__ = [
"TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter",
]
-if __import__("typing").TYPE_CHECKING:
- # import apis into sdk package
- from openapi_client.api.auth_api import AuthApi as AuthApi
- from openapi_client.api.body_api import BodyApi as BodyApi
- from openapi_client.api.form_api import FormApi as FormApi
- from openapi_client.api.header_api import HeaderApi as HeaderApi
- from openapi_client.api.path_api import PathApi as PathApi
- from openapi_client.api.query_api import QueryApi as QueryApi
-
- # import ApiClient
- from openapi_client.api_response import ApiResponse as ApiResponse
- from openapi_client.api_client import ApiClient as ApiClient
- from openapi_client.configuration import Configuration as Configuration
- from openapi_client.exceptions import OpenApiException as OpenApiException
- from openapi_client.exceptions import ApiTypeError as ApiTypeError
- from openapi_client.exceptions import ApiValueError as ApiValueError
- from openapi_client.exceptions import ApiKeyError as ApiKeyError
- from openapi_client.exceptions import ApiAttributeError as ApiAttributeError
- from openapi_client.exceptions import ApiException as ApiException
-
- # import models into sdk package
- from openapi_client.models.bird import Bird as Bird
- from openapi_client.models.category import Category as Category
- from openapi_client.models.data_query import DataQuery as DataQuery
- from openapi_client.models.default_value import DefaultValue as DefaultValue
- from openapi_client.models.number_properties_only import NumberPropertiesOnly as NumberPropertiesOnly
- from openapi_client.models.pet import Pet as Pet
- from openapi_client.models.query import Query as Query
- from openapi_client.models.string_enum_ref import StringEnumRef as StringEnumRef
- from openapi_client.models.tag import Tag as Tag
- from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker as TestFormObjectMultipartRequestMarker
- from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter as TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter as TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- ("__version__", __version__),
- ("__all__", __all__),
- """# import apis into sdk package
+# import apis into sdk package
from openapi_client.api.auth_api import AuthApi as AuthApi
from openapi_client.api.body_api import BodyApi as BodyApi
from openapi_client.api.form_api import FormApi as FormApi
@@ -123,8 +81,3 @@ from openapi_client.models.test_form_object_multipart_request_marker import Test
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter as TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter as TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/client/echo_api/python/openapi_client/api/__init__.py b/samples/client/echo_api/python/openapi_client/api/__init__.py
index c55dee436e1..9c9ae790c3b 100644
--- a/samples/client/echo_api/python/openapi_client/api/__init__.py
+++ b/samples/client/echo_api/python/openapi_client/api/__init__.py
@@ -1,21 +1,6 @@
# flake8: noqa
-if __import__("typing").TYPE_CHECKING:
- # import apis into api package
- from openapi_client.api.auth_api import AuthApi
- from openapi_client.api.body_api import BodyApi
- from openapi_client.api.form_api import FormApi
- from openapi_client.api.header_api import HeaderApi
- from openapi_client.api.path_api import PathApi
- from openapi_client.api.query_api import QueryApi
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import apis into api package
+# import apis into api package
from openapi_client.api.auth_api import AuthApi
from openapi_client.api.body_api import BodyApi
from openapi_client.api.form_api import FormApi
@@ -23,8 +8,3 @@ from openapi_client.api.header_api import HeaderApi
from openapi_client.api.path_api import PathApi
from openapi_client.api.query_api import QueryApi
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/client/echo_api/python/openapi_client/models/__init__.py b/samples/client/echo_api/python/openapi_client/models/__init__.py
index abd67e38090..10474719c5a 100644
--- a/samples/client/echo_api/python/openapi_client/models/__init__.py
+++ b/samples/client/echo_api/python/openapi_client/models/__init__.py
@@ -13,29 +13,7 @@
Do not edit the class manually.
""" # noqa: E501
-
-if __import__("typing").TYPE_CHECKING:
- # import models into model package
- from openapi_client.models.bird import Bird
- from openapi_client.models.category import Category
- from openapi_client.models.data_query import DataQuery
- from openapi_client.models.default_value import DefaultValue
- from openapi_client.models.number_properties_only import NumberPropertiesOnly
- from openapi_client.models.pet import Pet
- from openapi_client.models.query import Query
- from openapi_client.models.string_enum_ref import StringEnumRef
- from openapi_client.models.tag import Tag
- from openapi_client.models.test_form_object_multipart_request_marker import TestFormObjectMultipartRequestMarker
- from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
- from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import models into model package
+# import models into model package
from openapi_client.models.bird import Bird
from openapi_client.models.category import Category
from openapi_client.models.data_query import DataQuery
@@ -49,8 +27,3 @@ from openapi_client.models.test_form_object_multipart_request_marker import Test
from openapi_client.models.test_query_style_deep_object_explode_true_object_all_of_query_object_parameter import TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/client/echo_api/python/pyproject.toml b/samples/client/echo_api/python/pyproject.toml
index fcf9c73b152..84c2c75e9f8 100644
--- a/samples/client/echo_api/python/pyproject.toml
+++ b/samples/client/echo_api/python/pyproject.toml
@@ -15,7 +15,6 @@ dependencies = [
"python-dateutil (>=2.8.2)",
"pydantic (>=2)",
"typing-extensions (>=4.7.1)",
- "lazy-imports (>=1,<2)"
]
[project.urls]
diff --git a/samples/client/echo_api/python/requirements.txt b/samples/client/echo_api/python/requirements.txt
index 867a4496cd4..6cbb2b98b16 100644
--- a/samples/client/echo_api/python/requirements.txt
+++ b/samples/client/echo_api/python/requirements.txt
@@ -2,4 +2,3 @@ urllib3 >= 2.1.0, < 3.0.0
python_dateutil >= 2.8.2
pydantic >= 2
typing-extensions >= 4.7.1
-lazy-imports >= 1, < 2
diff --git a/samples/client/echo_api/python/setup.py b/samples/client/echo_api/python/setup.py
index c7563af2915..5527d5073fe 100644
--- a/samples/client/echo_api/python/setup.py
+++ b/samples/client/echo_api/python/setup.py
@@ -29,7 +29,6 @@ REQUIRES = [
"python-dateutil >= 2.8.2",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
- "lazy-imports >= 1, < 2",
]
setup(
diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py
index 5fc37d48819..278f6dfecf4 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py
+++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/__init__.py
@@ -150,152 +150,7 @@ __all__ = [
"WithNestedOneOf",
]
-if __import__("typing").TYPE_CHECKING:
- # import apis into sdk package
- from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi
- from petstore_api.api.default_api import DefaultApi as DefaultApi
- from petstore_api.api.fake_api import FakeApi as FakeApi
- from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api as FakeClassnameTags123Api
- from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi as ImportTestDatetimeApi
- from petstore_api.api.pet_api import PetApi as PetApi
- from petstore_api.api.store_api import StoreApi as StoreApi
- from petstore_api.api.user_api import UserApi as UserApi
-
- # import ApiClient
- from petstore_api.api_response import ApiResponse as ApiResponse
- from petstore_api.api_client import ApiClient as ApiClient
- from petstore_api.configuration import Configuration as Configuration
- from petstore_api.exceptions import OpenApiException as OpenApiException
- from petstore_api.exceptions import ApiTypeError as ApiTypeError
- from petstore_api.exceptions import ApiValueError as ApiValueError
- from petstore_api.exceptions import ApiKeyError as ApiKeyError
- from petstore_api.exceptions import ApiAttributeError as ApiAttributeError
- from petstore_api.exceptions import ApiException as ApiException
- from petstore_api.signing import HttpSigningConfiguration as HttpSigningConfiguration
-
- # import models into sdk package
- from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType as AdditionalPropertiesAnyType
- from petstore_api.models.additional_properties_class import AdditionalPropertiesClass as AdditionalPropertiesClass
- from petstore_api.models.additional_properties_object import AdditionalPropertiesObject as AdditionalPropertiesObject
- from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly as AdditionalPropertiesWithDescriptionOnly
- from petstore_api.models.all_of_super_model import AllOfSuperModel as AllOfSuperModel
- from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef as AllOfWithSingleRef
- from petstore_api.models.animal import Animal as Animal
- from petstore_api.models.any_of_color import AnyOfColor as AnyOfColor
- from petstore_api.models.any_of_pig import AnyOfPig as AnyOfPig
- from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel as ArrayOfArrayOfModel
- from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly as ArrayOfArrayOfNumberOnly
- from petstore_api.models.array_of_number_only import ArrayOfNumberOnly as ArrayOfNumberOnly
- from petstore_api.models.array_test import ArrayTest as ArrayTest
- from petstore_api.models.base_discriminator import BaseDiscriminator as BaseDiscriminator
- from petstore_api.models.basque_pig import BasquePig as BasquePig
- from petstore_api.models.bathing import Bathing as Bathing
- from petstore_api.models.capitalization import Capitalization as Capitalization
- from petstore_api.models.cat import Cat as Cat
- from petstore_api.models.category import Category as Category
- from petstore_api.models.circular_all_of_ref import CircularAllOfRef as CircularAllOfRef
- from petstore_api.models.circular_reference_model import CircularReferenceModel as CircularReferenceModel
- from petstore_api.models.class_model import ClassModel as ClassModel
- from petstore_api.models.client import Client as Client
- from petstore_api.models.color import Color as Color
- from petstore_api.models.creature import Creature as Creature
- from petstore_api.models.creature_info import CreatureInfo as CreatureInfo
- from petstore_api.models.danish_pig import DanishPig as DanishPig
- from petstore_api.models.data_output_format import DataOutputFormat as DataOutputFormat
- from petstore_api.models.deprecated_object import DeprecatedObject as DeprecatedObject
- from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub as DiscriminatorAllOfSub
- from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper as DiscriminatorAllOfSuper
- from petstore_api.models.dog import Dog as Dog
- from petstore_api.models.dummy_model import DummyModel as DummyModel
- from petstore_api.models.enum_arrays import EnumArrays as EnumArrays
- from petstore_api.models.enum_class import EnumClass as EnumClass
- from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt as EnumNumberVendorExt
- from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue as EnumRefWithDefaultValue
- from petstore_api.models.enum_string1 import EnumString1 as EnumString1
- from petstore_api.models.enum_string2 import EnumString2 as EnumString2
- from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt as EnumStringVendorExt
- from petstore_api.models.enum_test import EnumTest as EnumTest
- from petstore_api.models.feeding import Feeding as Feeding
- from petstore_api.models.file import File as File
- from petstore_api.models.file_schema_test_class import FileSchemaTestClass as FileSchemaTestClass
- from petstore_api.models.first_ref import FirstRef as FirstRef
- from petstore_api.models.foo import Foo as Foo
- from petstore_api.models.foo_get_default_response import FooGetDefaultResponse as FooGetDefaultResponse
- from petstore_api.models.format_test import FormatTest as FormatTest
- from petstore_api.models.has_only_read_only import HasOnlyReadOnly as HasOnlyReadOnly
- from petstore_api.models.health_check_result import HealthCheckResult as HealthCheckResult
- from petstore_api.models.hunting_dog import HuntingDog as HuntingDog
- from petstore_api.models.info import Info as Info
- from petstore_api.models.inner_dict_with_property import InnerDictWithProperty as InnerDictWithProperty
- from petstore_api.models.input_all_of import InputAllOf as InputAllOf
- from petstore_api.models.int_or_string import IntOrString as IntOrString
- from petstore_api.models.list_class import ListClass as ListClass
- from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel as MapOfArrayOfModel
- from petstore_api.models.map_test import MapTest as MapTest
- from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass as MixedPropertiesAndAdditionalPropertiesClass
- from petstore_api.models.model200_response import Model200Response as Model200Response
- from petstore_api.models.model_api_response import ModelApiResponse as ModelApiResponse
- from petstore_api.models.model_field import ModelField as ModelField
- from petstore_api.models.model_return import ModelReturn as ModelReturn
- from petstore_api.models.multi_arrays import MultiArrays as MultiArrays
- from petstore_api.models.name import Name as Name
- from petstore_api.models.nullable_class import NullableClass as NullableClass
- from petstore_api.models.nullable_property import NullableProperty as NullableProperty
- from petstore_api.models.number_only import NumberOnly as NumberOnly
- from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties as ObjectToTestAdditionalProperties
- from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields as ObjectWithDeprecatedFields
- from petstore_api.models.one_of_enum_string import OneOfEnumString as OneOfEnumString
- from petstore_api.models.order import Order as Order
- from petstore_api.models.outer_composite import OuterComposite as OuterComposite
- from petstore_api.models.outer_enum import OuterEnum as OuterEnum
- from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue as OuterEnumDefaultValue
- from petstore_api.models.outer_enum_integer import OuterEnumInteger as OuterEnumInteger
- from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue as OuterEnumIntegerDefaultValue
- from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty as OuterObjectWithEnumProperty
- from petstore_api.models.parent import Parent as Parent
- from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict as ParentWithOptionalDict
- from petstore_api.models.pet import Pet as Pet
- from petstore_api.models.pig import Pig as Pig
- from petstore_api.models.pony_sizes import PonySizes as PonySizes
- from petstore_api.models.poop_cleaning import PoopCleaning as PoopCleaning
- from petstore_api.models.primitive_string import PrimitiveString as PrimitiveString
- from petstore_api.models.property_map import PropertyMap as PropertyMap
- from petstore_api.models.property_name_collision import PropertyNameCollision as PropertyNameCollision
- from petstore_api.models.read_only_first import ReadOnlyFirst as ReadOnlyFirst
- from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef as SecondCircularAllOfRef
- from petstore_api.models.second_ref import SecondRef as SecondRef
- from petstore_api.models.self_reference_model import SelfReferenceModel as SelfReferenceModel
- from petstore_api.models.single_ref_type import SingleRefType as SingleRefType
- from petstore_api.models.special_character_enum import SpecialCharacterEnum as SpecialCharacterEnum
- from petstore_api.models.special_model_name import SpecialModelName as SpecialModelName
- from petstore_api.models.special_name import SpecialName as SpecialName
- from petstore_api.models.tag import Tag as Tag
- from petstore_api.models.task import Task as Task
- from petstore_api.models.task_activity import TaskActivity as TaskActivity
- from petstore_api.models.test_enum import TestEnum as TestEnum
- from petstore_api.models.test_enum_with_default import TestEnumWithDefault as TestEnumWithDefault
- from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response as TestErrorResponsesWithModel400Response
- from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response as TestErrorResponsesWithModel404Response
- from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest as TestInlineFreeformAdditionalPropertiesRequest
- from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault as TestModelWithEnumDefault
- from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker as TestObjectForMultipartRequestsRequestMarker
- from petstore_api.models.tiger import Tiger as Tiger
- from petstore_api.models.type import Type as Type
- from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties as UnnamedDictWithAdditionalModelListProperties
- from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties as UnnamedDictWithAdditionalStringListProperties
- from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject as UploadFileWithAdditionalPropertiesRequestObject
- from petstore_api.models.user import User as User
- from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- ("__version__", __version__),
- ("__all__", __all__),
- """# import apis into sdk package
+# import apis into sdk package
from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi
from petstore_api.api.default_api import DefaultApi as DefaultApi
from petstore_api.api.fake_api import FakeApi as FakeApi
@@ -431,8 +286,3 @@ from petstore_api.models.upload_file_with_additional_properties_request_object i
from petstore_api.models.user import User as User
from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/__init__.py
index e77aed00eb5..79d2ab7dc93 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/__init__.py
+++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api/__init__.py
@@ -1,23 +1,6 @@
# flake8: noqa
-if __import__("typing").TYPE_CHECKING:
- # import apis into api package
- from petstore_api.api.another_fake_api import AnotherFakeApi
- from petstore_api.api.default_api import DefaultApi
- from petstore_api.api.fake_api import FakeApi
- from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
- from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi
- from petstore_api.api.pet_api import PetApi
- from petstore_api.api.store_api import StoreApi
- from petstore_api.api.user_api import UserApi
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import apis into api package
+# import apis into api package
from petstore_api.api.another_fake_api import AnotherFakeApi
from petstore_api.api.default_api import DefaultApi
from petstore_api.api.fake_api import FakeApi
@@ -27,8 +10,3 @@ from petstore_api.api.pet_api import PetApi
from petstore_api.api.store_api import StoreApi
from petstore_api.api.user_api import UserApi
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py
index 68a0bf95df1..f34d053a1b7 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py
+++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/__init__.py
@@ -12,129 +12,7 @@
Do not edit the class manually.
""" # noqa: E501
-
-if __import__("typing").TYPE_CHECKING:
- # import models into model package
- from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
- from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
- from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
- from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
- from petstore_api.models.all_of_super_model import AllOfSuperModel
- from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
- from petstore_api.models.animal import Animal
- from petstore_api.models.any_of_color import AnyOfColor
- from petstore_api.models.any_of_pig import AnyOfPig
- from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel
- from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
- from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
- from petstore_api.models.array_test import ArrayTest
- from petstore_api.models.base_discriminator import BaseDiscriminator
- from petstore_api.models.basque_pig import BasquePig
- from petstore_api.models.bathing import Bathing
- from petstore_api.models.capitalization import Capitalization
- from petstore_api.models.cat import Cat
- from petstore_api.models.category import Category
- from petstore_api.models.circular_all_of_ref import CircularAllOfRef
- from petstore_api.models.circular_reference_model import CircularReferenceModel
- from petstore_api.models.class_model import ClassModel
- from petstore_api.models.client import Client
- from petstore_api.models.color import Color
- from petstore_api.models.creature import Creature
- from petstore_api.models.creature_info import CreatureInfo
- from petstore_api.models.danish_pig import DanishPig
- from petstore_api.models.data_output_format import DataOutputFormat
- from petstore_api.models.deprecated_object import DeprecatedObject
- from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
- from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
- from petstore_api.models.dog import Dog
- from petstore_api.models.dummy_model import DummyModel
- from petstore_api.models.enum_arrays import EnumArrays
- from petstore_api.models.enum_class import EnumClass
- from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt
- from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue
- from petstore_api.models.enum_string1 import EnumString1
- from petstore_api.models.enum_string2 import EnumString2
- from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt
- from petstore_api.models.enum_test import EnumTest
- from petstore_api.models.feeding import Feeding
- from petstore_api.models.file import File
- from petstore_api.models.file_schema_test_class import FileSchemaTestClass
- from petstore_api.models.first_ref import FirstRef
- from petstore_api.models.foo import Foo
- from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
- from petstore_api.models.format_test import FormatTest
- from petstore_api.models.has_only_read_only import HasOnlyReadOnly
- from petstore_api.models.health_check_result import HealthCheckResult
- from petstore_api.models.hunting_dog import HuntingDog
- from petstore_api.models.info import Info
- from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
- from petstore_api.models.input_all_of import InputAllOf
- from petstore_api.models.int_or_string import IntOrString
- from petstore_api.models.list_class import ListClass
- from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel
- from petstore_api.models.map_test import MapTest
- from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
- from petstore_api.models.model200_response import Model200Response
- from petstore_api.models.model_api_response import ModelApiResponse
- from petstore_api.models.model_field import ModelField
- from petstore_api.models.model_return import ModelReturn
- from petstore_api.models.multi_arrays import MultiArrays
- from petstore_api.models.name import Name
- from petstore_api.models.nullable_class import NullableClass
- from petstore_api.models.nullable_property import NullableProperty
- from petstore_api.models.number_only import NumberOnly
- from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties
- from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
- from petstore_api.models.one_of_enum_string import OneOfEnumString
- from petstore_api.models.order import Order
- from petstore_api.models.outer_composite import OuterComposite
- from petstore_api.models.outer_enum import OuterEnum
- from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
- from petstore_api.models.outer_enum_integer import OuterEnumInteger
- from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
- from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
- from petstore_api.models.parent import Parent
- from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict
- from petstore_api.models.pet import Pet
- from petstore_api.models.pig import Pig
- from petstore_api.models.pony_sizes import PonySizes
- from petstore_api.models.poop_cleaning import PoopCleaning
- from petstore_api.models.primitive_string import PrimitiveString
- from petstore_api.models.property_map import PropertyMap
- from petstore_api.models.property_name_collision import PropertyNameCollision
- from petstore_api.models.read_only_first import ReadOnlyFirst
- from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
- from petstore_api.models.second_ref import SecondRef
- from petstore_api.models.self_reference_model import SelfReferenceModel
- from petstore_api.models.single_ref_type import SingleRefType
- from petstore_api.models.special_character_enum import SpecialCharacterEnum
- from petstore_api.models.special_model_name import SpecialModelName
- from petstore_api.models.special_name import SpecialName
- from petstore_api.models.tag import Tag
- from petstore_api.models.task import Task
- from petstore_api.models.task_activity import TaskActivity
- from petstore_api.models.test_enum import TestEnum
- from petstore_api.models.test_enum_with_default import TestEnumWithDefault
- from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response
- from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response
- from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
- from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault
- from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
- from petstore_api.models.tiger import Tiger
- from petstore_api.models.type import Type
- from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties
- from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties
- from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
- from petstore_api.models.user import User
- from petstore_api.models.with_nested_one_of import WithNestedOneOf
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import models into model package
+# import models into model package
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
@@ -248,8 +126,3 @@ from petstore_api.models.upload_file_with_additional_properties_request_object i
from petstore_api.models.user import User
from petstore_api.models.with_nested_one_of import WithNestedOneOf
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml b/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml
index 62e8d9e7587..fbafbe1e07a 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml
+++ b/samples/openapi3/client/petstore/python-aiohttp/pyproject.toml
@@ -19,7 +19,6 @@ pem = ">= 19.3.0"
pycryptodome = ">= 3.9.0"
pydantic = ">= 2"
typing-extensions = ">= 4.7.1"
-lazy-imports = ">= 1, < 2"
[tool.poetry.dev-dependencies]
pytest = ">= 7.2.1"
diff --git a/samples/openapi3/client/petstore/python-aiohttp/requirements.txt b/samples/openapi3/client/petstore/python-aiohttp/requirements.txt
index 7f4a9417db5..76b1f7272d1 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/requirements.txt
+++ b/samples/openapi3/client/petstore/python-aiohttp/requirements.txt
@@ -6,4 +6,3 @@ pem >= 19.3.0
pycryptodome >= 3.9.0
pydantic >= 2
typing-extensions >= 4.7.1
-lazy-imports >= 1, < 2
diff --git a/samples/openapi3/client/petstore/python-aiohttp/setup.py b/samples/openapi3/client/petstore/python-aiohttp/setup.py
index ebc4176945b..eab7be21eea 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/setup.py
+++ b/samples/openapi3/client/petstore/python-aiohttp/setup.py
@@ -32,7 +32,6 @@ REQUIRES = [
"pycryptodome >= 3.9.0",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
- "lazy-imports >= 1, < 2",
]
setup(
diff --git a/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py b/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py
index f957b61ee78..75a0d4bdbdc 100644
--- a/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py
+++ b/samples/openapi3/client/petstore/python-aiohttp/tests/test_api_client.py
@@ -13,11 +13,11 @@ class TestApiClient(unittest.IsolatedAsyncioTestCase):
async def test_ignore_operation_servers(self):
config = petstore_api.Configuration(host=HOST)
async with petstore_api.ApiClient(config) as client:
- user_api_instance = petstore_api.api.user_api.UserApi(client)
+ user_api_instance = petstore_api.UserApi(client)
config_ignore = petstore_api.Configuration(host=HOST, ignore_operation_servers=True)
client_ignore = petstore_api.ApiClient(config_ignore)
- user_api_instance_ignore = petstore_api.api.user_api.UserApi(client_ignore)
+ user_api_instance_ignore = petstore_api.UserApi(client_ignore)
params_to_serialize = {
'user': petstore_api.User(id=1, username='test'),
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml
new file mode 100644
index 00000000000..06d03df77f1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml
@@ -0,0 +1,34 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: petstore_api Python package
+
+on: [push, pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+ pip install -r test-requirements.txt
+ - name: Test with pytest
+ run: |
+ pytest --cov=petstore_api
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.gitignore b/samples/openapi3/client/petstore/python-lazyImports/.gitignore
new file mode 100644
index 00000000000..65b06b95540
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.gitignore
@@ -0,0 +1,66 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*,cover
+.hypothesis/
+venv/
+.venv/
+.python-version
+.pytest_cache
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Ipython Notebook
+.ipynb_checkpoints
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml
new file mode 100644
index 00000000000..eb65f62dea5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml
@@ -0,0 +1,31 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.gitlab.com/ee/ci/README.html
+# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
+
+stages:
+ - test
+
+.pytest:
+ stage: test
+ script:
+ - pip install -r requirements.txt
+ - pip install -r test-requirements.txt
+ - pytest --cov=petstore_api
+
+pytest-3.9:
+ extends: .pytest
+ image: python:3.9-alpine
+pytest-3.10:
+ extends: .pytest
+ image: python:3.10-alpine
+pytest-3.11:
+ extends: .pytest
+ image: python:3.11-alpine
+pytest-3.12:
+ extends: .pytest
+ image: python:3.12-alpine
+pytest-3.13:
+ extends: .pytest
+ image: python:3.13-alpine
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator-ignore b/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator/FILES
new file mode 100644
index 00000000000..6cbba41b5b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator/FILES
@@ -0,0 +1,263 @@
+.github/workflows/python.yml
+.gitignore
+.gitlab-ci.yml
+.travis.yml
+README.md
+docs/AdditionalPropertiesAnyType.md
+docs/AdditionalPropertiesClass.md
+docs/AdditionalPropertiesObject.md
+docs/AdditionalPropertiesWithDescriptionOnly.md
+docs/AllOfSuperModel.md
+docs/AllOfWithSingleRef.md
+docs/Animal.md
+docs/AnotherFakeApi.md
+docs/AnyOfColor.md
+docs/AnyOfPig.md
+docs/ArrayOfArrayOfModel.md
+docs/ArrayOfArrayOfNumberOnly.md
+docs/ArrayOfNumberOnly.md
+docs/ArrayTest.md
+docs/BaseDiscriminator.md
+docs/BasquePig.md
+docs/Bathing.md
+docs/Capitalization.md
+docs/Cat.md
+docs/Category.md
+docs/CircularAllOfRef.md
+docs/CircularReferenceModel.md
+docs/ClassModel.md
+docs/Client.md
+docs/Color.md
+docs/Creature.md
+docs/CreatureInfo.md
+docs/DanishPig.md
+docs/DataOutputFormat.md
+docs/DefaultApi.md
+docs/DeprecatedObject.md
+docs/DiscriminatorAllOfSub.md
+docs/DiscriminatorAllOfSuper.md
+docs/Dog.md
+docs/DummyModel.md
+docs/EnumArrays.md
+docs/EnumClass.md
+docs/EnumNumberVendorExt.md
+docs/EnumRefWithDefaultValue.md
+docs/EnumString1.md
+docs/EnumString2.md
+docs/EnumStringVendorExt.md
+docs/EnumTest.md
+docs/FakeApi.md
+docs/FakeClassnameTags123Api.md
+docs/Feeding.md
+docs/File.md
+docs/FileSchemaTestClass.md
+docs/FirstRef.md
+docs/Foo.md
+docs/FooGetDefaultResponse.md
+docs/FormatTest.md
+docs/HasOnlyReadOnly.md
+docs/HealthCheckResult.md
+docs/HuntingDog.md
+docs/ImportTestDatetimeApi.md
+docs/Info.md
+docs/InnerDictWithProperty.md
+docs/InputAllOf.md
+docs/IntOrString.md
+docs/ListClass.md
+docs/MapOfArrayOfModel.md
+docs/MapTest.md
+docs/MixedPropertiesAndAdditionalPropertiesClass.md
+docs/Model200Response.md
+docs/ModelApiResponse.md
+docs/ModelField.md
+docs/ModelReturn.md
+docs/MultiArrays.md
+docs/Name.md
+docs/NullableClass.md
+docs/NullableProperty.md
+docs/NumberOnly.md
+docs/ObjectToTestAdditionalProperties.md
+docs/ObjectWithDeprecatedFields.md
+docs/OneOfEnumString.md
+docs/Order.md
+docs/OuterComposite.md
+docs/OuterEnum.md
+docs/OuterEnumDefaultValue.md
+docs/OuterEnumInteger.md
+docs/OuterEnumIntegerDefaultValue.md
+docs/OuterObjectWithEnumProperty.md
+docs/Parent.md
+docs/ParentWithOptionalDict.md
+docs/Pet.md
+docs/PetApi.md
+docs/Pig.md
+docs/PonySizes.md
+docs/PoopCleaning.md
+docs/PrimitiveString.md
+docs/PropertyMap.md
+docs/PropertyNameCollision.md
+docs/ReadOnlyFirst.md
+docs/SecondCircularAllOfRef.md
+docs/SecondRef.md
+docs/SelfReferenceModel.md
+docs/SingleRefType.md
+docs/SpecialCharacterEnum.md
+docs/SpecialModelName.md
+docs/SpecialName.md
+docs/StoreApi.md
+docs/Tag.md
+docs/Task.md
+docs/TaskActivity.md
+docs/TestEnum.md
+docs/TestEnumWithDefault.md
+docs/TestErrorResponsesWithModel400Response.md
+docs/TestErrorResponsesWithModel404Response.md
+docs/TestInlineFreeformAdditionalPropertiesRequest.md
+docs/TestModelWithEnumDefault.md
+docs/TestObjectForMultipartRequestsRequestMarker.md
+docs/Tiger.md
+docs/Type.md
+docs/UnnamedDictWithAdditionalModelListProperties.md
+docs/UnnamedDictWithAdditionalStringListProperties.md
+docs/UploadFileWithAdditionalPropertiesRequestObject.md
+docs/User.md
+docs/UserApi.md
+docs/WithNestedOneOf.md
+git_push.sh
+petstore_api/__init__.py
+petstore_api/api/__init__.py
+petstore_api/api/another_fake_api.py
+petstore_api/api/default_api.py
+petstore_api/api/fake_api.py
+petstore_api/api/fake_classname_tags123_api.py
+petstore_api/api/import_test_datetime_api.py
+petstore_api/api/pet_api.py
+petstore_api/api/store_api.py
+petstore_api/api/user_api.py
+petstore_api/api_client.py
+petstore_api/api_response.py
+petstore_api/configuration.py
+petstore_api/exceptions.py
+petstore_api/models/__init__.py
+petstore_api/models/additional_properties_any_type.py
+petstore_api/models/additional_properties_class.py
+petstore_api/models/additional_properties_object.py
+petstore_api/models/additional_properties_with_description_only.py
+petstore_api/models/all_of_super_model.py
+petstore_api/models/all_of_with_single_ref.py
+petstore_api/models/animal.py
+petstore_api/models/any_of_color.py
+petstore_api/models/any_of_pig.py
+petstore_api/models/array_of_array_of_model.py
+petstore_api/models/array_of_array_of_number_only.py
+petstore_api/models/array_of_number_only.py
+petstore_api/models/array_test.py
+petstore_api/models/base_discriminator.py
+petstore_api/models/basque_pig.py
+petstore_api/models/bathing.py
+petstore_api/models/capitalization.py
+petstore_api/models/cat.py
+petstore_api/models/category.py
+petstore_api/models/circular_all_of_ref.py
+petstore_api/models/circular_reference_model.py
+petstore_api/models/class_model.py
+petstore_api/models/client.py
+petstore_api/models/color.py
+petstore_api/models/creature.py
+petstore_api/models/creature_info.py
+petstore_api/models/danish_pig.py
+petstore_api/models/data_output_format.py
+petstore_api/models/deprecated_object.py
+petstore_api/models/discriminator_all_of_sub.py
+petstore_api/models/discriminator_all_of_super.py
+petstore_api/models/dog.py
+petstore_api/models/dummy_model.py
+petstore_api/models/enum_arrays.py
+petstore_api/models/enum_class.py
+petstore_api/models/enum_number_vendor_ext.py
+petstore_api/models/enum_ref_with_default_value.py
+petstore_api/models/enum_string1.py
+petstore_api/models/enum_string2.py
+petstore_api/models/enum_string_vendor_ext.py
+petstore_api/models/enum_test.py
+petstore_api/models/feeding.py
+petstore_api/models/file.py
+petstore_api/models/file_schema_test_class.py
+petstore_api/models/first_ref.py
+petstore_api/models/foo.py
+petstore_api/models/foo_get_default_response.py
+petstore_api/models/format_test.py
+petstore_api/models/has_only_read_only.py
+petstore_api/models/health_check_result.py
+petstore_api/models/hunting_dog.py
+petstore_api/models/info.py
+petstore_api/models/inner_dict_with_property.py
+petstore_api/models/input_all_of.py
+petstore_api/models/int_or_string.py
+petstore_api/models/list_class.py
+petstore_api/models/map_of_array_of_model.py
+petstore_api/models/map_test.py
+petstore_api/models/mixed_properties_and_additional_properties_class.py
+petstore_api/models/model200_response.py
+petstore_api/models/model_api_response.py
+petstore_api/models/model_field.py
+petstore_api/models/model_return.py
+petstore_api/models/multi_arrays.py
+petstore_api/models/name.py
+petstore_api/models/nullable_class.py
+petstore_api/models/nullable_property.py
+petstore_api/models/number_only.py
+petstore_api/models/object_to_test_additional_properties.py
+petstore_api/models/object_with_deprecated_fields.py
+petstore_api/models/one_of_enum_string.py
+petstore_api/models/order.py
+petstore_api/models/outer_composite.py
+petstore_api/models/outer_enum.py
+petstore_api/models/outer_enum_default_value.py
+petstore_api/models/outer_enum_integer.py
+petstore_api/models/outer_enum_integer_default_value.py
+petstore_api/models/outer_object_with_enum_property.py
+petstore_api/models/parent.py
+petstore_api/models/parent_with_optional_dict.py
+petstore_api/models/pet.py
+petstore_api/models/pig.py
+petstore_api/models/pony_sizes.py
+petstore_api/models/poop_cleaning.py
+petstore_api/models/primitive_string.py
+petstore_api/models/property_map.py
+petstore_api/models/property_name_collision.py
+petstore_api/models/read_only_first.py
+petstore_api/models/second_circular_all_of_ref.py
+petstore_api/models/second_ref.py
+petstore_api/models/self_reference_model.py
+petstore_api/models/single_ref_type.py
+petstore_api/models/special_character_enum.py
+petstore_api/models/special_model_name.py
+petstore_api/models/special_name.py
+petstore_api/models/tag.py
+petstore_api/models/task.py
+petstore_api/models/task_activity.py
+petstore_api/models/test_enum.py
+petstore_api/models/test_enum_with_default.py
+petstore_api/models/test_error_responses_with_model400_response.py
+petstore_api/models/test_error_responses_with_model404_response.py
+petstore_api/models/test_inline_freeform_additional_properties_request.py
+petstore_api/models/test_model_with_enum_default.py
+petstore_api/models/test_object_for_multipart_requests_request_marker.py
+petstore_api/models/tiger.py
+petstore_api/models/type.py
+petstore_api/models/unnamed_dict_with_additional_model_list_properties.py
+petstore_api/models/unnamed_dict_with_additional_string_list_properties.py
+petstore_api/models/upload_file_with_additional_properties_request_object.py
+petstore_api/models/user.py
+petstore_api/models/with_nested_one_of.py
+petstore_api/py.typed
+petstore_api/rest.py
+petstore_api/signing.py
+pyproject.toml
+requirements.txt
+setup.cfg
+setup.py
+test-requirements.txt
+test/__init__.py
+tox.ini
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator/VERSION
new file mode 100644
index 00000000000..5e528295308
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.openapi-generator/VERSION
@@ -0,0 +1 @@
+7.16.0-SNAPSHOT
diff --git a/samples/openapi3/client/petstore/python-lazyImports/.travis.yml b/samples/openapi3/client/petstore/python-lazyImports/.travis.yml
new file mode 100644
index 00000000000..8d62304a94d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/.travis.yml
@@ -0,0 +1,17 @@
+# ref: https://docs.travis-ci.com/user/languages/python
+language: python
+python:
+ - "3.9"
+ - "3.10"
+ - "3.11"
+ - "3.12"
+ - "3.13"
+ # uncomment the following if needed
+ #- "3.13-dev" # 3.13 development branch
+ #- "nightly" # nightly build
+# command to install dependencies
+install:
+ - "pip install -r requirements.txt"
+ - "pip install -r test-requirements.txt"
+# command to run tests
+script: pytest --cov=petstore_api
diff --git a/samples/openapi3/client/petstore/python-lazyImports/README.md b/samples/openapi3/client/petstore/python-lazyImports/README.md
new file mode 100644
index 00000000000..47517933af1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/README.md
@@ -0,0 +1,317 @@
+# petstore-api
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- Package version: 1.0.0
+- Generator version: 7.16.0-SNAPSHOT
+- Build package: org.openapitools.codegen.languages.PythonClientCodegen
+
+## Requirements.
+
+Python 3.9+
+
+## Installation & Usage
+### pip install
+
+If the python package is hosted on a repository, you can install directly using:
+
+```sh
+pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
+```
+(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
+
+Then import the package:
+```python
+import petstore_api
+```
+
+### Setuptools
+
+Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
+
+```sh
+python setup.py install --user
+```
+(or `sudo python setup.py install` to install the package for all users)
+
+Then import the package:
+```python
+import petstore_api
+```
+
+### Tests
+
+Execute `pytest` to run the tests.
+
+## Getting Started
+
+Please follow the [installation procedure](#installation--usage) and then run the following:
+
+```python
+import datetime
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test special tags
+ api_response = api_instance.call_123_test_special_tags(client)
+ print("The response of AnotherFakeApi->call_123_test_special_tags:\n")
+ pprint(api_response)
+ except ApiException as e:
+ print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+*DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo |
+*FakeApi* | [**fake_any_type_request_body**](docs/FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body
+*FakeApi* | [**fake_enum_ref_query_parameter**](docs/FakeApi.md#fake_enum_ref_query_parameter) | **GET** /fake/enum_ref_query_parameter | test enum reference query parameter
+*FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+*FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fake_outer_string_serialize**](docs/FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+*FakeApi* | [**fake_property_enum_integer_serialize**](docs/FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+*FakeApi* | [**fake_ref_enum_string**](docs/FakeApi.md#fake_ref_enum_string) | **GET** /fake/ref_enum_string | test ref to enum string
+*FakeApi* | [**fake_return_boolean**](docs/FakeApi.md#fake_return_boolean) | **GET** /fake/return_boolean | test returning boolean
+*FakeApi* | [**fake_return_byte_like_json**](docs/FakeApi.md#fake_return_byte_like_json) | **GET** /fake/return_byte_like_json | test byte like json
+*FakeApi* | [**fake_return_enum**](docs/FakeApi.md#fake_return_enum) | **GET** /fake/return_enum | test returning enum
+*FakeApi* | [**fake_return_enum_like_json**](docs/FakeApi.md#fake_return_enum_like_json) | **GET** /fake/return_enum_like_json | test enum like json
+*FakeApi* | [**fake_return_float**](docs/FakeApi.md#fake_return_float) | **GET** /fake/return_float | test returning float
+*FakeApi* | [**fake_return_int**](docs/FakeApi.md#fake_return_int) | **GET** /fake/return_int | test returning int
+*FakeApi* | [**fake_return_list_of_objects**](docs/FakeApi.md#fake_return_list_of_objects) | **GET** /fake/return_list_of_object | test returning list of objects
+*FakeApi* | [**fake_return_str_like_json**](docs/FakeApi.md#fake_return_str_like_json) | **GET** /fake/return_str_like_json | test str like json
+*FakeApi* | [**fake_return_string**](docs/FakeApi.md#fake_return_string) | **GET** /fake/return_string | test returning string
+*FakeApi* | [**fake_uuid_example**](docs/FakeApi.md#fake_uuid_example) | **GET** /fake/uuid_example | test uuid example
+*FakeApi* | [**test_additional_properties_reference**](docs/FakeApi.md#test_additional_properties_reference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
+*FakeApi* | [**test_body_with_binary**](docs/FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+*FakeApi* | [**test_body_with_file_schema**](docs/FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+*FakeApi* | [**test_body_with_query_params**](docs/FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**test_client_model**](docs/FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**test_date_time_query_parameter**](docs/FakeApi.md#test_date_time_query_parameter) | **PUT** /fake/date-time-query-params |
+*FakeApi* | [**test_empty_and_non_empty_responses**](docs/FakeApi.md#test_empty_and_non_empty_responses) | **POST** /fake/empty_and_non_empty_responses | test empty and non-empty responses
+*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**test_error_responses_with_model**](docs/FakeApi.md#test_error_responses_with_model) | **POST** /fake/error_responses_with_model | test error responses with model
+*FakeApi* | [**test_group_parameters**](docs/FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+*FakeApi* | [**test_inline_additional_properties**](docs/FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**test_inline_freeform_additional_properties**](docs/FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
+*FakeApi* | [**test_json_form_data**](docs/FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeApi* | [**test_object_for_multipart_requests**](docs/FakeApi.md#test_object_for_multipart_requests) | **POST** /fake/object_for_multipart_requests |
+*FakeApi* | [**test_query_parameter_collection_format**](docs/FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+*FakeApi* | [**test_string_map_reference**](docs/FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map
+*FakeApi* | [**upload_file_with_additional_properties**](docs/FakeApi.md#upload_file_with_additional_properties) | **POST** /fake/upload_file_with_additional_properties | uploads a file and additional properties using multipart/form-data
+*FakeClassnameTags123Api* | [**test_classname**](docs/FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+*ImportTestDatetimeApi* | [**import_test_return_datetime**](docs/ImportTestDatetimeApi.md#import_test_return_datetime) | **GET** /import_test/return_datetime | test date time
+*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**upload_file_with_required_file**](docs/PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user
+*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+## Documentation For Models
+
+ - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
+ - [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md)
+ - [AllOfSuperModel](docs/AllOfSuperModel.md)
+ - [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
+ - [Animal](docs/Animal.md)
+ - [AnyOfColor](docs/AnyOfColor.md)
+ - [AnyOfPig](docs/AnyOfPig.md)
+ - [ArrayOfArrayOfModel](docs/ArrayOfArrayOfModel.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [BaseDiscriminator](docs/BaseDiscriminator.md)
+ - [BasquePig](docs/BasquePig.md)
+ - [Bathing](docs/Bathing.md)
+ - [Capitalization](docs/Capitalization.md)
+ - [Cat](docs/Cat.md)
+ - [Category](docs/Category.md)
+ - [CircularAllOfRef](docs/CircularAllOfRef.md)
+ - [CircularReferenceModel](docs/CircularReferenceModel.md)
+ - [ClassModel](docs/ClassModel.md)
+ - [Client](docs/Client.md)
+ - [Color](docs/Color.md)
+ - [Creature](docs/Creature.md)
+ - [CreatureInfo](docs/CreatureInfo.md)
+ - [DanishPig](docs/DanishPig.md)
+ - [DataOutputFormat](docs/DataOutputFormat.md)
+ - [DeprecatedObject](docs/DeprecatedObject.md)
+ - [DiscriminatorAllOfSub](docs/DiscriminatorAllOfSub.md)
+ - [DiscriminatorAllOfSuper](docs/DiscriminatorAllOfSuper.md)
+ - [Dog](docs/Dog.md)
+ - [DummyModel](docs/DummyModel.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumNumberVendorExt](docs/EnumNumberVendorExt.md)
+ - [EnumRefWithDefaultValue](docs/EnumRefWithDefaultValue.md)
+ - [EnumString1](docs/EnumString1.md)
+ - [EnumString2](docs/EnumString2.md)
+ - [EnumStringVendorExt](docs/EnumStringVendorExt.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [Feeding](docs/Feeding.md)
+ - [File](docs/File.md)
+ - [FileSchemaTestClass](docs/FileSchemaTestClass.md)
+ - [FirstRef](docs/FirstRef.md)
+ - [Foo](docs/Foo.md)
+ - [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [HealthCheckResult](docs/HealthCheckResult.md)
+ - [HuntingDog](docs/HuntingDog.md)
+ - [Info](docs/Info.md)
+ - [InnerDictWithProperty](docs/InnerDictWithProperty.md)
+ - [InputAllOf](docs/InputAllOf.md)
+ - [IntOrString](docs/IntOrString.md)
+ - [ListClass](docs/ListClass.md)
+ - [MapOfArrayOfModel](docs/MapOfArrayOfModel.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [ModelField](docs/ModelField.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [MultiArrays](docs/MultiArrays.md)
+ - [Name](docs/Name.md)
+ - [NullableClass](docs/NullableClass.md)
+ - [NullableProperty](docs/NullableProperty.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [ObjectToTestAdditionalProperties](docs/ObjectToTestAdditionalProperties.md)
+ - [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
+ - [OneOfEnumString](docs/OneOfEnumString.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
+ - [OuterEnumInteger](docs/OuterEnumInteger.md)
+ - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
+ - [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md)
+ - [Parent](docs/Parent.md)
+ - [ParentWithOptionalDict](docs/ParentWithOptionalDict.md)
+ - [Pet](docs/Pet.md)
+ - [Pig](docs/Pig.md)
+ - [PonySizes](docs/PonySizes.md)
+ - [PoopCleaning](docs/PoopCleaning.md)
+ - [PrimitiveString](docs/PrimitiveString.md)
+ - [PropertyMap](docs/PropertyMap.md)
+ - [PropertyNameCollision](docs/PropertyNameCollision.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [SecondCircularAllOfRef](docs/SecondCircularAllOfRef.md)
+ - [SecondRef](docs/SecondRef.md)
+ - [SelfReferenceModel](docs/SelfReferenceModel.md)
+ - [SingleRefType](docs/SingleRefType.md)
+ - [SpecialCharacterEnum](docs/SpecialCharacterEnum.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [SpecialName](docs/SpecialName.md)
+ - [Tag](docs/Tag.md)
+ - [Task](docs/Task.md)
+ - [TaskActivity](docs/TaskActivity.md)
+ - [TestEnum](docs/TestEnum.md)
+ - [TestEnumWithDefault](docs/TestEnumWithDefault.md)
+ - [TestErrorResponsesWithModel400Response](docs/TestErrorResponsesWithModel400Response.md)
+ - [TestErrorResponsesWithModel404Response](docs/TestErrorResponsesWithModel404Response.md)
+ - [TestInlineFreeformAdditionalPropertiesRequest](docs/TestInlineFreeformAdditionalPropertiesRequest.md)
+ - [TestModelWithEnumDefault](docs/TestModelWithEnumDefault.md)
+ - [TestObjectForMultipartRequestsRequestMarker](docs/TestObjectForMultipartRequestsRequestMarker.md)
+ - [Tiger](docs/Tiger.md)
+ - [Type](docs/Type.md)
+ - [UnnamedDictWithAdditionalModelListProperties](docs/UnnamedDictWithAdditionalModelListProperties.md)
+ - [UnnamedDictWithAdditionalStringListProperties](docs/UnnamedDictWithAdditionalStringListProperties.md)
+ - [UploadFileWithAdditionalPropertiesRequestObject](docs/UploadFileWithAdditionalPropertiesRequestObject.md)
+ - [User](docs/User.md)
+ - [WithNestedOneOf](docs/WithNestedOneOf.md)
+
+
+
+## Documentation For Authorization
+
+
+Authentication schemes defined for the API:
+
+### petstore_auth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - **write:pets**: modify pets in your account
+ - **read:pets**: read your pets
+
+
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+
+### api_key_query
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+
+### http_basic_test
+
+- **Type**: HTTP basic authentication
+
+
+### bearer_test
+
+- **Type**: Bearer authentication (JWT)
+
+
+### http_signature_test
+
+- **Type**: HTTP signature authentication
+
+
+## Author
+
+
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesAnyType.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesAnyType.md
new file mode 100644
index 00000000000..314cba3a614
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesAnyType.md
@@ -0,0 +1,29 @@
+# AdditionalPropertiesAnyType
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AdditionalPropertiesAnyType from a JSON string
+additional_properties_any_type_instance = AdditionalPropertiesAnyType.from_json(json)
+# print the JSON string representation of the object
+print(AdditionalPropertiesAnyType.to_json())
+
+# convert the object into a dict
+additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict()
+# create an instance of AdditionalPropertiesAnyType from a dict
+additional_properties_any_type_from_dict = AdditionalPropertiesAnyType.from_dict(additional_properties_any_type_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesClass.md
new file mode 100644
index 00000000000..8d4c08707f5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,30 @@
+# AdditionalPropertiesClass
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_property** | **Dict[str, str]** | | [optional]
+**map_of_map_property** | **Dict[str, Dict[str, str]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AdditionalPropertiesClass from a JSON string
+additional_properties_class_instance = AdditionalPropertiesClass.from_json(json)
+# print the JSON string representation of the object
+print(AdditionalPropertiesClass.to_json())
+
+# convert the object into a dict
+additional_properties_class_dict = additional_properties_class_instance.to_dict()
+# create an instance of AdditionalPropertiesClass from a dict
+additional_properties_class_from_dict = AdditionalPropertiesClass.from_dict(additional_properties_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesObject.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesObject.md
new file mode 100644
index 00000000000..d647ec64896
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesObject.md
@@ -0,0 +1,29 @@
+# AdditionalPropertiesObject
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AdditionalPropertiesObject from a JSON string
+additional_properties_object_instance = AdditionalPropertiesObject.from_json(json)
+# print the JSON string representation of the object
+print(AdditionalPropertiesObject.to_json())
+
+# convert the object into a dict
+additional_properties_object_dict = additional_properties_object_instance.to_dict()
+# create an instance of AdditionalPropertiesObject from a dict
+additional_properties_object_from_dict = AdditionalPropertiesObject.from_dict(additional_properties_object_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesWithDescriptionOnly.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesWithDescriptionOnly.md
new file mode 100644
index 00000000000..061f5524872
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AdditionalPropertiesWithDescriptionOnly.md
@@ -0,0 +1,29 @@
+# AdditionalPropertiesWithDescriptionOnly
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string
+additional_properties_with_description_only_instance = AdditionalPropertiesWithDescriptionOnly.from_json(json)
+# print the JSON string representation of the object
+print(AdditionalPropertiesWithDescriptionOnly.to_json())
+
+# convert the object into a dict
+additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict()
+# create an instance of AdditionalPropertiesWithDescriptionOnly from a dict
+additional_properties_with_description_only_from_dict = AdditionalPropertiesWithDescriptionOnly.from_dict(additional_properties_with_description_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AllOfSuperModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AllOfSuperModel.md
new file mode 100644
index 00000000000..421a1527f1e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AllOfSuperModel.md
@@ -0,0 +1,29 @@
+# AllOfSuperModel
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.all_of_super_model import AllOfSuperModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AllOfSuperModel from a JSON string
+all_of_super_model_instance = AllOfSuperModel.from_json(json)
+# print the JSON string representation of the object
+print(AllOfSuperModel.to_json())
+
+# convert the object into a dict
+all_of_super_model_dict = all_of_super_model_instance.to_dict()
+# create an instance of AllOfSuperModel from a dict
+all_of_super_model_from_dict = AllOfSuperModel.from_dict(all_of_super_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AllOfWithSingleRef.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AllOfWithSingleRef.md
new file mode 100644
index 00000000000..203a4b5da3d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AllOfWithSingleRef.md
@@ -0,0 +1,30 @@
+# AllOfWithSingleRef
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**username** | **str** | | [optional]
+**single_ref_type** | [**SingleRefType**](SingleRefType.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AllOfWithSingleRef from a JSON string
+all_of_with_single_ref_instance = AllOfWithSingleRef.from_json(json)
+# print the JSON string representation of the object
+print(AllOfWithSingleRef.to_json())
+
+# convert the object into a dict
+all_of_with_single_ref_dict = all_of_with_single_ref_instance.to_dict()
+# create an instance of AllOfWithSingleRef from a dict
+all_of_with_single_ref_from_dict = AllOfWithSingleRef.from_dict(all_of_with_single_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Animal.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Animal.md
new file mode 100644
index 00000000000..381d27b66e4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Animal.md
@@ -0,0 +1,30 @@
+# Animal
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | | [optional] [default to 'red']
+
+## Example
+
+```python
+from petstore_api.models.animal import Animal
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Animal from a JSON string
+animal_instance = Animal.from_json(json)
+# print the JSON string representation of the object
+print(Animal.to_json())
+
+# convert the object into a dict
+animal_dict = animal_instance.to_dict()
+# create an instance of Animal from a dict
+animal_from_dict = Animal.from_dict(animal_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AnotherFakeApi.md
new file mode 100644
index 00000000000..3ec02d261ee
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AnotherFakeApi.md
@@ -0,0 +1,77 @@
+# petstore_api.AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**call_123_test_special_tags**](AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+# **call_123_test_special_tags**
+> Client call_123_test_special_tags(client)
+
+To test special tags
+
+To test special tags and operation ID starting with number
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.client import Client
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.AnotherFakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test special tags
+ api_response = api_instance.call_123_test_special_tags(client)
+ print("The response of AnotherFakeApi->call_123_test_special_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AnyOfColor.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AnyOfColor.md
new file mode 100644
index 00000000000..6ed75dd7b48
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AnyOfColor.md
@@ -0,0 +1,29 @@
+# AnyOfColor
+
+Any of RGB array, RGBA array, or hex string.
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from petstore_api.models.any_of_color import AnyOfColor
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AnyOfColor from a JSON string
+any_of_color_instance = AnyOfColor.from_json(json)
+# print the JSON string representation of the object
+print(AnyOfColor.to_json())
+
+# convert the object into a dict
+any_of_color_dict = any_of_color_instance.to_dict()
+# create an instance of AnyOfColor from a dict
+any_of_color_from_dict = AnyOfColor.from_dict(any_of_color_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/AnyOfPig.md b/samples/openapi3/client/petstore/python-lazyImports/docs/AnyOfPig.md
new file mode 100644
index 00000000000..9367e226189
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/AnyOfPig.md
@@ -0,0 +1,31 @@
+# AnyOfPig
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.any_of_pig import AnyOfPig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AnyOfPig from a JSON string
+any_of_pig_instance = AnyOfPig.from_json(json)
+# print the JSON string representation of the object
+print(AnyOfPig.to_json())
+
+# convert the object into a dict
+any_of_pig_dict = any_of_pig_instance.to_dict()
+# create an instance of AnyOfPig from a dict
+any_of_pig_from_dict = AnyOfPig.from_dict(any_of_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfArrayOfModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfArrayOfModel.md
new file mode 100644
index 00000000000..f866863d53f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfArrayOfModel.md
@@ -0,0 +1,29 @@
+# ArrayOfArrayOfModel
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**another_property** | **List[List[Tag]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfArrayOfModel from a JSON string
+array_of_array_of_model_instance = ArrayOfArrayOfModel.from_json(json)
+# print the JSON string representation of the object
+print(ArrayOfArrayOfModel.to_json())
+
+# convert the object into a dict
+array_of_array_of_model_dict = array_of_array_of_model_instance.to_dict()
+# create an instance of ArrayOfArrayOfModel from a dict
+array_of_array_of_model_from_dict = ArrayOfArrayOfModel.from_dict(array_of_array_of_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 00000000000..32bd2dfbf1e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,29 @@
+# ArrayOfArrayOfNumberOnly
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_array_number** | **List[List[float]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfArrayOfNumberOnly from a JSON string
+array_of_array_of_number_only_instance = ArrayOfArrayOfNumberOnly.from_json(json)
+# print the JSON string representation of the object
+print(ArrayOfArrayOfNumberOnly.to_json())
+
+# convert the object into a dict
+array_of_array_of_number_only_dict = array_of_array_of_number_only_instance.to_dict()
+# create an instance of ArrayOfArrayOfNumberOnly from a dict
+array_of_array_of_number_only_from_dict = ArrayOfArrayOfNumberOnly.from_dict(array_of_array_of_number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfNumberOnly.md
new file mode 100644
index 00000000000..b814d759494
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,29 @@
+# ArrayOfNumberOnly
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_number** | **List[float]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayOfNumberOnly from a JSON string
+array_of_number_only_instance = ArrayOfNumberOnly.from_json(json)
+# print the JSON string representation of the object
+print(ArrayOfNumberOnly.to_json())
+
+# convert the object into a dict
+array_of_number_only_dict = array_of_number_only_instance.to_dict()
+# create an instance of ArrayOfNumberOnly from a dict
+array_of_number_only_from_dict = ArrayOfNumberOnly.from_dict(array_of_number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayTest.md
new file mode 100644
index 00000000000..ed871fae662
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ArrayTest.md
@@ -0,0 +1,32 @@
+# ArrayTest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**array_of_string** | **List[str]** | | [optional]
+**array_of_nullable_float** | **List[Optional[float]]** | | [optional]
+**array_array_of_integer** | **List[List[int]]** | | [optional]
+**array_array_of_model** | **List[List[ReadOnlyFirst]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.array_test import ArrayTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ArrayTest from a JSON string
+array_test_instance = ArrayTest.from_json(json)
+# print the JSON string representation of the object
+print(ArrayTest.to_json())
+
+# convert the object into a dict
+array_test_dict = array_test_instance.to_dict()
+# create an instance of ArrayTest from a dict
+array_test_from_dict = ArrayTest.from_dict(array_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/BaseDiscriminator.md b/samples/openapi3/client/petstore/python-lazyImports/docs/BaseDiscriminator.md
new file mode 100644
index 00000000000..fcdbeb032e6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/BaseDiscriminator.md
@@ -0,0 +1,29 @@
+# BaseDiscriminator
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type_name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.base_discriminator import BaseDiscriminator
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BaseDiscriminator from a JSON string
+base_discriminator_instance = BaseDiscriminator.from_json(json)
+# print the JSON string representation of the object
+print(BaseDiscriminator.to_json())
+
+# convert the object into a dict
+base_discriminator_dict = base_discriminator_instance.to_dict()
+# create an instance of BaseDiscriminator from a dict
+base_discriminator_from_dict = BaseDiscriminator.from_dict(base_discriminator_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/BasquePig.md b/samples/openapi3/client/petstore/python-lazyImports/docs/BasquePig.md
new file mode 100644
index 00000000000..ee28d628722
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/BasquePig.md
@@ -0,0 +1,30 @@
+# BasquePig
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.basque_pig import BasquePig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BasquePig from a JSON string
+basque_pig_instance = BasquePig.from_json(json)
+# print the JSON string representation of the object
+print(BasquePig.to_json())
+
+# convert the object into a dict
+basque_pig_dict = basque_pig_instance.to_dict()
+# create an instance of BasquePig from a dict
+basque_pig_from_dict = BasquePig.from_dict(basque_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Bathing.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Bathing.md
new file mode 100644
index 00000000000..6ad70e2f67c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Bathing.md
@@ -0,0 +1,31 @@
+# Bathing
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**task_name** | **str** | |
+**function_name** | **str** | |
+**content** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.bathing import Bathing
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Bathing from a JSON string
+bathing_instance = Bathing.from_json(json)
+# print the JSON string representation of the object
+print(Bathing.to_json())
+
+# convert the object into a dict
+bathing_dict = bathing_instance.to_dict()
+# create an instance of Bathing from a dict
+bathing_from_dict = Bathing.from_dict(bathing_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Capitalization.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Capitalization.md
new file mode 100644
index 00000000000..6f564a8ed8c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Capitalization.md
@@ -0,0 +1,34 @@
+# Capitalization
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**small_camel** | **str** | | [optional]
+**capital_camel** | **str** | | [optional]
+**small_snake** | **str** | | [optional]
+**capital_snake** | **str** | | [optional]
+**sca_eth_flow_points** | **str** | | [optional]
+**att_name** | **str** | Name of the pet | [optional]
+
+## Example
+
+```python
+from petstore_api.models.capitalization import Capitalization
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Capitalization from a JSON string
+capitalization_instance = Capitalization.from_json(json)
+# print the JSON string representation of the object
+print(Capitalization.to_json())
+
+# convert the object into a dict
+capitalization_dict = capitalization_instance.to_dict()
+# create an instance of Capitalization from a dict
+capitalization_from_dict = Capitalization.from_dict(capitalization_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Cat.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Cat.md
new file mode 100644
index 00000000000..d0e39efdb33
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Cat.md
@@ -0,0 +1,29 @@
+# Cat
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.cat import Cat
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Cat from a JSON string
+cat_instance = Cat.from_json(json)
+# print the JSON string representation of the object
+print(Cat.to_json())
+
+# convert the object into a dict
+cat_dict = cat_instance.to_dict()
+# create an instance of Cat from a dict
+cat_from_dict = Cat.from_dict(cat_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Category.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Category.md
new file mode 100644
index 00000000000..dbde14b7344
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Category.md
@@ -0,0 +1,30 @@
+# Category
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **str** | | [default to 'default-name']
+
+## Example
+
+```python
+from petstore_api.models.category import Category
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Category from a JSON string
+category_instance = Category.from_json(json)
+# print the JSON string representation of the object
+print(Category.to_json())
+
+# convert the object into a dict
+category_dict = category_instance.to_dict()
+# create an instance of Category from a dict
+category_from_dict = Category.from_dict(category_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/CircularAllOfRef.md b/samples/openapi3/client/petstore/python-lazyImports/docs/CircularAllOfRef.md
new file mode 100644
index 00000000000..65b171177e5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/CircularAllOfRef.md
@@ -0,0 +1,30 @@
+# CircularAllOfRef
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+**second_circular_all_of_ref** | [**List[SecondCircularAllOfRef]**](SecondCircularAllOfRef.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.circular_all_of_ref import CircularAllOfRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CircularAllOfRef from a JSON string
+circular_all_of_ref_instance = CircularAllOfRef.from_json(json)
+# print the JSON string representation of the object
+print(CircularAllOfRef.to_json())
+
+# convert the object into a dict
+circular_all_of_ref_dict = circular_all_of_ref_instance.to_dict()
+# create an instance of CircularAllOfRef from a dict
+circular_all_of_ref_from_dict = CircularAllOfRef.from_dict(circular_all_of_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/CircularReferenceModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/CircularReferenceModel.md
new file mode 100644
index 00000000000..87216f7273a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/CircularReferenceModel.md
@@ -0,0 +1,30 @@
+# CircularReferenceModel
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested** | [**FirstRef**](FirstRef.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.circular_reference_model import CircularReferenceModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CircularReferenceModel from a JSON string
+circular_reference_model_instance = CircularReferenceModel.from_json(json)
+# print the JSON string representation of the object
+print(CircularReferenceModel.to_json())
+
+# convert the object into a dict
+circular_reference_model_dict = circular_reference_model_instance.to_dict()
+# create an instance of CircularReferenceModel from a dict
+circular_reference_model_from_dict = CircularReferenceModel.from_dict(circular_reference_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ClassModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ClassModel.md
new file mode 100644
index 00000000000..ea76a5c157b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ClassModel.md
@@ -0,0 +1,30 @@
+# ClassModel
+
+Model for testing model with \"_class\" property
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_class** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.class_model import ClassModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ClassModel from a JSON string
+class_model_instance = ClassModel.from_json(json)
+# print the JSON string representation of the object
+print(ClassModel.to_json())
+
+# convert the object into a dict
+class_model_dict = class_model_instance.to_dict()
+# create an instance of ClassModel from a dict
+class_model_from_dict = ClassModel.from_dict(class_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Client.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Client.md
new file mode 100644
index 00000000000..22321c18915
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Client.md
@@ -0,0 +1,29 @@
+# Client
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.client import Client
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Client from a JSON string
+client_instance = Client.from_json(json)
+# print the JSON string representation of the object
+print(Client.to_json())
+
+# convert the object into a dict
+client_dict = client_instance.to_dict()
+# create an instance of Client from a dict
+client_from_dict = Client.from_dict(client_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Color.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Color.md
new file mode 100644
index 00000000000..9ac3ab2e91f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Color.md
@@ -0,0 +1,29 @@
+# Color
+
+RGB array, RGBA array, or hex string.
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from petstore_api.models.color import Color
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Color from a JSON string
+color_instance = Color.from_json(json)
+# print the JSON string representation of the object
+print(Color.to_json())
+
+# convert the object into a dict
+color_dict = color_instance.to_dict()
+# create an instance of Color from a dict
+color_from_dict = Color.from_dict(color_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Creature.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Creature.md
new file mode 100644
index 00000000000..a4710214c19
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Creature.md
@@ -0,0 +1,30 @@
+# Creature
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**info** | [**CreatureInfo**](CreatureInfo.md) | |
+**type** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.creature import Creature
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Creature from a JSON string
+creature_instance = Creature.from_json(json)
+# print the JSON string representation of the object
+print(Creature.to_json())
+
+# convert the object into a dict
+creature_dict = creature_instance.to_dict()
+# create an instance of Creature from a dict
+creature_from_dict = Creature.from_dict(creature_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/CreatureInfo.md b/samples/openapi3/client/petstore/python-lazyImports/docs/CreatureInfo.md
new file mode 100644
index 00000000000..db3b82bb9ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/CreatureInfo.md
@@ -0,0 +1,29 @@
+# CreatureInfo
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.creature_info import CreatureInfo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CreatureInfo from a JSON string
+creature_info_instance = CreatureInfo.from_json(json)
+# print the JSON string representation of the object
+print(CreatureInfo.to_json())
+
+# convert the object into a dict
+creature_info_dict = creature_info_instance.to_dict()
+# create an instance of CreatureInfo from a dict
+creature_info_from_dict = CreatureInfo.from_dict(creature_info_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DanishPig.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DanishPig.md
new file mode 100644
index 00000000000..16941388832
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DanishPig.md
@@ -0,0 +1,30 @@
+# DanishPig
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.danish_pig import DanishPig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DanishPig from a JSON string
+danish_pig_instance = DanishPig.from_json(json)
+# print the JSON string representation of the object
+print(DanishPig.to_json())
+
+# convert the object into a dict
+danish_pig_dict = danish_pig_instance.to_dict()
+# create an instance of DanishPig from a dict
+danish_pig_from_dict = DanishPig.from_dict(danish_pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DataOutputFormat.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DataOutputFormat.md
new file mode 100644
index 00000000000..d9df2a1cffd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DataOutputFormat.md
@@ -0,0 +1,14 @@
+# DataOutputFormat
+
+
+## Enum
+
+* `JSON` (value: `'JSON'`)
+
+* `CSV` (value: `'CSV'`)
+
+* `XML` (value: `'XML'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DefaultApi.md
new file mode 100644
index 00000000000..c70e69fa80e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DefaultApi.md
@@ -0,0 +1,68 @@
+# petstore_api.DefaultApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**foo_get**](DefaultApi.md#foo_get) | **GET** /foo |
+
+
+# **foo_get**
+> FooGetDefaultResponse foo_get()
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.DefaultApi(api_client)
+
+ try:
+ api_response = api_instance.foo_get()
+ print("The response of DefaultApi->foo_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling DefaultApi->foo_get: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | response | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DeprecatedObject.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DeprecatedObject.md
new file mode 100644
index 00000000000..6b362f379ba
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DeprecatedObject.md
@@ -0,0 +1,29 @@
+# DeprecatedObject
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.deprecated_object import DeprecatedObject
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DeprecatedObject from a JSON string
+deprecated_object_instance = DeprecatedObject.from_json(json)
+# print the JSON string representation of the object
+print(DeprecatedObject.to_json())
+
+# convert the object into a dict
+deprecated_object_dict = deprecated_object_instance.to_dict()
+# create an instance of DeprecatedObject from a dict
+deprecated_object_from_dict = DeprecatedObject.from_dict(deprecated_object_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DiscriminatorAllOfSub.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DiscriminatorAllOfSub.md
new file mode 100644
index 00000000000..f72b6e8e68c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DiscriminatorAllOfSub.md
@@ -0,0 +1,28 @@
+# DiscriminatorAllOfSub
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DiscriminatorAllOfSub from a JSON string
+discriminator_all_of_sub_instance = DiscriminatorAllOfSub.from_json(json)
+# print the JSON string representation of the object
+print(DiscriminatorAllOfSub.to_json())
+
+# convert the object into a dict
+discriminator_all_of_sub_dict = discriminator_all_of_sub_instance.to_dict()
+# create an instance of DiscriminatorAllOfSub from a dict
+discriminator_all_of_sub_from_dict = DiscriminatorAllOfSub.from_dict(discriminator_all_of_sub_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DiscriminatorAllOfSuper.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DiscriminatorAllOfSuper.md
new file mode 100644
index 00000000000..477c05bfc44
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DiscriminatorAllOfSuper.md
@@ -0,0 +1,29 @@
+# DiscriminatorAllOfSuper
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**element_type** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DiscriminatorAllOfSuper from a JSON string
+discriminator_all_of_super_instance = DiscriminatorAllOfSuper.from_json(json)
+# print the JSON string representation of the object
+print(DiscriminatorAllOfSuper.to_json())
+
+# convert the object into a dict
+discriminator_all_of_super_dict = discriminator_all_of_super_instance.to_dict()
+# create an instance of DiscriminatorAllOfSuper from a dict
+discriminator_all_of_super_from_dict = DiscriminatorAllOfSuper.from_dict(discriminator_all_of_super_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Dog.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Dog.md
new file mode 100644
index 00000000000..ed23f613d01
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Dog.md
@@ -0,0 +1,29 @@
+# Dog
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dog import Dog
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Dog from a JSON string
+dog_instance = Dog.from_json(json)
+# print the JSON string representation of the object
+print(Dog.to_json())
+
+# convert the object into a dict
+dog_dict = dog_instance.to_dict()
+# create an instance of Dog from a dict
+dog_from_dict = Dog.from_dict(dog_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/DummyModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/DummyModel.md
new file mode 100644
index 00000000000..01b675977f5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/DummyModel.md
@@ -0,0 +1,30 @@
+# DummyModel
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**category** | **str** | | [optional]
+**self_ref** | [**SelfReferenceModel**](SelfReferenceModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.dummy_model import DummyModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DummyModel from a JSON string
+dummy_model_instance = DummyModel.from_json(json)
+# print the JSON string representation of the object
+print(DummyModel.to_json())
+
+# convert the object into a dict
+dummy_model_dict = dummy_model_instance.to_dict()
+# create an instance of DummyModel from a dict
+dummy_model_from_dict = DummyModel.from_dict(dummy_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumArrays.md
new file mode 100644
index 00000000000..f44617497bc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumArrays.md
@@ -0,0 +1,30 @@
+# EnumArrays
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**just_symbol** | **str** | | [optional]
+**array_enum** | **List[str]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.enum_arrays import EnumArrays
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumArrays from a JSON string
+enum_arrays_instance = EnumArrays.from_json(json)
+# print the JSON string representation of the object
+print(EnumArrays.to_json())
+
+# convert the object into a dict
+enum_arrays_dict = enum_arrays_instance.to_dict()
+# create an instance of EnumArrays from a dict
+enum_arrays_from_dict = EnumArrays.from_dict(enum_arrays_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumClass.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumClass.md
new file mode 100644
index 00000000000..725b617bdad
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumClass.md
@@ -0,0 +1,14 @@
+# EnumClass
+
+
+## Enum
+
+* `ABC` (value: `'_abc'`)
+
+* `MINUS_EFG` (value: `'-efg'`)
+
+* `LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS` (value: `'(xyz)'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumNumberVendorExt.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumNumberVendorExt.md
new file mode 100644
index 00000000000..4c1572b1d27
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumNumberVendorExt.md
@@ -0,0 +1,14 @@
+# EnumNumberVendorExt
+
+
+## Enum
+
+* `FortyTwo` (value: `42`)
+
+* `Eigtheen` (value: `18`)
+
+* `FiftySix` (value: `56`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumRefWithDefaultValue.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumRefWithDefaultValue.md
new file mode 100644
index 00000000000..eeb0dc66969
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumRefWithDefaultValue.md
@@ -0,0 +1,29 @@
+# EnumRefWithDefaultValue
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to DataOutputFormat.JSON]
+
+## Example
+
+```python
+from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumRefWithDefaultValue from a JSON string
+enum_ref_with_default_value_instance = EnumRefWithDefaultValue.from_json(json)
+# print the JSON string representation of the object
+print(EnumRefWithDefaultValue.to_json())
+
+# convert the object into a dict
+enum_ref_with_default_value_dict = enum_ref_with_default_value_instance.to_dict()
+# create an instance of EnumRefWithDefaultValue from a dict
+enum_ref_with_default_value_from_dict = EnumRefWithDefaultValue.from_dict(enum_ref_with_default_value_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumString1.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumString1.md
new file mode 100644
index 00000000000..aa214538bca
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumString1.md
@@ -0,0 +1,12 @@
+# EnumString1
+
+
+## Enum
+
+* `A` (value: `'a'`)
+
+* `B` (value: `'b'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumString2.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumString2.md
new file mode 100644
index 00000000000..d1b49f8dddd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumString2.md
@@ -0,0 +1,12 @@
+# EnumString2
+
+
+## Enum
+
+* `C` (value: `'c'`)
+
+* `D` (value: `'d'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumStringVendorExt.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumStringVendorExt.md
new file mode 100644
index 00000000000..ce6077c18a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumStringVendorExt.md
@@ -0,0 +1,14 @@
+# EnumStringVendorExt
+
+
+## Enum
+
+* `FOO_XEnumVarname` (value: `'FOO'`)
+
+* `BarVar_XEnumVarname` (value: `'Bar'`)
+
+* `bazVar_XEnumVarname` (value: `'baz'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/EnumTest.md b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumTest.md
new file mode 100644
index 00000000000..9f96c605d88
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/EnumTest.md
@@ -0,0 +1,41 @@
+# EnumTest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enum_string** | **str** | | [optional]
+**enum_string_required** | **str** | |
+**enum_integer_default** | **int** | | [optional] [default to 5]
+**enum_integer** | **int** | | [optional]
+**enum_number** | **float** | | [optional]
+**enum_string_single_member** | **str** | | [optional]
+**enum_integer_single_member** | **int** | | [optional]
+**outer_enum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**outer_enum_integer** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
+**outer_enum_default_value** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] [default to OuterEnumDefaultValue.PLACED]
+**outer_enum_integer_default_value** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] [default to OuterEnumIntegerDefaultValue.NUMBER_0]
+**enum_number_vendor_ext** | [**EnumNumberVendorExt**](EnumNumberVendorExt.md) | | [optional]
+**enum_string_vendor_ext** | [**EnumStringVendorExt**](EnumStringVendorExt.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.enum_test import EnumTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EnumTest from a JSON string
+enum_test_instance = EnumTest.from_json(json)
+# print the JSON string representation of the object
+print(EnumTest.to_json())
+
+# convert the object into a dict
+enum_test_dict = enum_test_instance.to_dict()
+# create an instance of EnumTest from a dict
+enum_test_from_dict = EnumTest.from_dict(enum_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/FakeApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/FakeApi.md
new file mode 100644
index 00000000000..16bce5a2b49
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/FakeApi.md
@@ -0,0 +1,2540 @@
+# petstore_api.FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**fake_any_type_request_body**](FakeApi.md#fake_any_type_request_body) | **POST** /fake/any_type_body | test any type request body
+[**fake_enum_ref_query_parameter**](FakeApi.md#fake_enum_ref_query_parameter) | **GET** /fake/enum_ref_query_parameter | test enum reference query parameter
+[**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint
+[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication
+[**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean |
+[**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite |
+[**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number |
+[**fake_outer_string_serialize**](FakeApi.md#fake_outer_string_serialize) | **POST** /fake/outer/string |
+[**fake_property_enum_integer_serialize**](FakeApi.md#fake_property_enum_integer_serialize) | **POST** /fake/property/enum-int |
+[**fake_ref_enum_string**](FakeApi.md#fake_ref_enum_string) | **GET** /fake/ref_enum_string | test ref to enum string
+[**fake_return_boolean**](FakeApi.md#fake_return_boolean) | **GET** /fake/return_boolean | test returning boolean
+[**fake_return_byte_like_json**](FakeApi.md#fake_return_byte_like_json) | **GET** /fake/return_byte_like_json | test byte like json
+[**fake_return_enum**](FakeApi.md#fake_return_enum) | **GET** /fake/return_enum | test returning enum
+[**fake_return_enum_like_json**](FakeApi.md#fake_return_enum_like_json) | **GET** /fake/return_enum_like_json | test enum like json
+[**fake_return_float**](FakeApi.md#fake_return_float) | **GET** /fake/return_float | test returning float
+[**fake_return_int**](FakeApi.md#fake_return_int) | **GET** /fake/return_int | test returning int
+[**fake_return_list_of_objects**](FakeApi.md#fake_return_list_of_objects) | **GET** /fake/return_list_of_object | test returning list of objects
+[**fake_return_str_like_json**](FakeApi.md#fake_return_str_like_json) | **GET** /fake/return_str_like_json | test str like json
+[**fake_return_string**](FakeApi.md#fake_return_string) | **GET** /fake/return_string | test returning string
+[**fake_uuid_example**](FakeApi.md#fake_uuid_example) | **GET** /fake/uuid_example | test uuid example
+[**test_additional_properties_reference**](FakeApi.md#test_additional_properties_reference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
+[**test_body_with_binary**](FakeApi.md#test_body_with_binary) | **PUT** /fake/body-with-binary |
+[**test_body_with_file_schema**](FakeApi.md#test_body_with_file_schema) | **PUT** /fake/body-with-file-schema |
+[**test_body_with_query_params**](FakeApi.md#test_body_with_query_params) | **PUT** /fake/body-with-query-params |
+[**test_client_model**](FakeApi.md#test_client_model) | **PATCH** /fake | To test \"client\" model
+[**test_date_time_query_parameter**](FakeApi.md#test_date_time_query_parameter) | **PUT** /fake/date-time-query-params |
+[**test_empty_and_non_empty_responses**](FakeApi.md#test_empty_and_non_empty_responses) | **POST** /fake/empty_and_non_empty_responses | test empty and non-empty responses
+[**test_endpoint_parameters**](FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**test_error_responses_with_model**](FakeApi.md#test_error_responses_with_model) | **POST** /fake/error_responses_with_model | test error responses with model
+[**test_group_parameters**](FakeApi.md#test_group_parameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
+[**test_inline_additional_properties**](FakeApi.md#test_inline_additional_properties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**test_inline_freeform_additional_properties**](FakeApi.md#test_inline_freeform_additional_properties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
+[**test_json_form_data**](FakeApi.md#test_json_form_data) | **GET** /fake/jsonFormData | test json serialization of form data
+[**test_object_for_multipart_requests**](FakeApi.md#test_object_for_multipart_requests) | **POST** /fake/object_for_multipart_requests |
+[**test_query_parameter_collection_format**](FakeApi.md#test_query_parameter_collection_format) | **PUT** /fake/test-query-parameters |
+[**test_string_map_reference**](FakeApi.md#test_string_map_reference) | **POST** /fake/stringMap-reference | test referenced string map
+[**upload_file_with_additional_properties**](FakeApi.md#upload_file_with_additional_properties) | **POST** /fake/upload_file_with_additional_properties | uploads a file and additional properties using multipart/form-data
+
+
+# **fake_any_type_request_body**
+> fake_any_type_request_body(body=body)
+
+test any type request body
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = None # object | (optional)
+
+ try:
+ # test any type request body
+ api_instance.fake_any_type_request_body(body=body)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_any_type_request_body: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **object**| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_enum_ref_query_parameter**
+> fake_enum_ref_query_parameter(enum_ref=enum_ref)
+
+test enum reference query parameter
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ enum_ref = -efg # EnumClass | enum reference (optional) (default to -efg)
+
+ try:
+ # test enum reference query parameter
+ api_instance.fake_enum_ref_query_parameter(enum_ref=enum_ref)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_enum_ref_query_parameter: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enum_ref** | [**EnumClass**](.md)| enum reference | [optional] [default to -efg]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Get successful | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_health_get**
+> HealthCheckResult fake_health_get()
+
+Health check endpoint
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # Health check endpoint
+ api_response = api_instance.fake_health_get()
+ print("The response of FakeApi->fake_health_get:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_health_get: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**HealthCheckResult**](HealthCheckResult.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_http_signature_test**
+> fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+
+test http signature authentication
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.pet import Pet
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+from petstore_api import signing
+import datetime
+
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+ query_1 = 'query_1_example' # str | query parameter (optional)
+ header_1 = 'header_1_example' # str | header parameter (optional)
+
+ try:
+ # test http signature authentication
+ api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+ **query_1** | **str**| query parameter | [optional]
+ **header_1** | **str**| header parameter | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | The instance started successfully | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_boolean_serialize**
+> bool fake_outer_boolean_serialize(body=body)
+
+Test serialization of outer boolean types
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = True # bool | Input boolean as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_boolean_serialize(body=body)
+ print("The response of FakeApi->fake_outer_boolean_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_boolean_serialize: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **bool**| Input boolean as post body | [optional]
+
+### Return type
+
+**bool**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output boolean | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_composite_serialize**
+> OuterComposite fake_outer_composite_serialize(outer_composite=outer_composite)
+
+Test serialization of object with outer number type
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_composite_serialize(outer_composite=outer_composite)
+ print("The response of FakeApi->fake_outer_composite_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_composite_serialize: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outer_composite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output composite | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_number_serialize**
+> float fake_outer_number_serialize(body=body)
+
+Test serialization of outer number types
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 3.4 # float | Input number as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_number_serialize(body=body)
+ print("The response of FakeApi->fake_outer_number_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_number_serialize: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **float**| Input number as post body | [optional]
+
+### Return type
+
+**float**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output number | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_outer_string_serialize**
+> str fake_outer_string_serialize(body=body)
+
+Test serialization of outer string types
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = 'body_example' # str | Input string as post body (optional)
+
+ try:
+ api_response = api_instance.fake_outer_string_serialize(body=body)
+ print("The response of FakeApi->fake_outer_string_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_outer_string_serialize: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **str**| Input string as post body | [optional]
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output string | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_property_enum_integer_serialize**
+> OuterObjectWithEnumProperty fake_property_enum_integer_serialize(outer_object_with_enum_property, param=param)
+
+Test serialization of enum (int) properties with examples
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body
+ param = [petstore_api.OuterEnumInteger()] # List[OuterEnumInteger] | (optional)
+
+ try:
+ api_response = api_instance.fake_property_enum_integer_serialize(outer_object_with_enum_property, param=param)
+ print("The response of FakeApi->fake_property_enum_integer_serialize:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_property_enum_integer_serialize: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outer_object_with_enum_property** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
+ **param** | [**List[OuterEnumInteger]**](OuterEnumInteger.md)| | [optional]
+
+### Return type
+
+[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: */*
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Output enum (int) | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_ref_enum_string**
+> EnumClass fake_ref_enum_string()
+
+test ref to enum string
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test ref to enum string
+ api_response = api_instance.fake_ref_enum_string()
+ print("The response of FakeApi->fake_ref_enum_string:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_ref_enum_string: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+[**EnumClass**](EnumClass.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: plain/text
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_boolean**
+> bool fake_return_boolean()
+
+test returning boolean
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test returning boolean
+ api_response = api_instance.fake_return_boolean()
+ print("The response of FakeApi->fake_return_boolean:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_boolean: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**bool**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_byte_like_json**
+> bytearray fake_return_byte_like_json()
+
+test byte like json
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test byte like json
+ api_response = api_instance.fake_return_byte_like_json()
+ print("The response of FakeApi->fake_return_byte_like_json:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_byte_like_json: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**bytearray**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: plain/text
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_enum**
+> str fake_return_enum()
+
+test returning enum
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test returning enum
+ api_response = api_instance.fake_return_enum()
+ print("The response of FakeApi->fake_return_enum:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_enum: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_enum_like_json**
+> str fake_return_enum_like_json()
+
+test enum like json
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test enum like json
+ api_response = api_instance.fake_return_enum_like_json()
+ print("The response of FakeApi->fake_return_enum_like_json:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_enum_like_json: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: plain/text
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_float**
+> float fake_return_float()
+
+test returning float
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test returning float
+ api_response = api_instance.fake_return_float()
+ print("The response of FakeApi->fake_return_float:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_float: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**float**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_int**
+> int fake_return_int()
+
+test returning int
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test returning int
+ api_response = api_instance.fake_return_int()
+ print("The response of FakeApi->fake_return_int:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_int: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**int**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_list_of_objects**
+> List[List[Tag]] fake_return_list_of_objects()
+
+test returning list of objects
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.tag import Tag
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test returning list of objects
+ api_response = api_instance.fake_return_list_of_objects()
+ print("The response of FakeApi->fake_return_list_of_objects:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_list_of_objects: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**List[List[Tag]]**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_str_like_json**
+> str fake_return_str_like_json()
+
+test str like json
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test str like json
+ api_response = api_instance.fake_return_str_like_json()
+ print("The response of FakeApi->fake_return_str_like_json:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_str_like_json: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: plain/text
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_return_string**
+> str fake_return_string()
+
+test returning string
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test returning string
+ api_response = api_instance.fake_return_string()
+ print("The response of FakeApi->fake_return_string:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_return_string: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **fake_uuid_example**
+> fake_uuid_example(uuid_example)
+
+test uuid example
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ uuid_example = '84529ad2-2265-4e15-b76b-c17025d848f6' # str | uuid example
+
+ try:
+ # test uuid example
+ api_instance.fake_uuid_example(uuid_example)
+ except Exception as e:
+ print("Exception when calling FakeApi->fake_uuid_example: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **uuid_example** | **str**| uuid example |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Get successful | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_additional_properties_reference**
+> test_additional_properties_reference(request_body)
+
+test referenced additionalProperties
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ request_body = None # Dict[str, object] | request body
+
+ try:
+ # test referenced additionalProperties
+ api_instance.test_additional_properties_reference(request_body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_additional_properties_reference: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **request_body** | [**Dict[str, object]**](object.md)| request body |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_binary**
+> test_body_with_binary(body)
+
+For this test, the body has to be a binary file.
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ body = None # bytearray | image to upload
+
+ try:
+ api_instance.test_body_with_binary(body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_binary: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **bytearray**| image to upload |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: image/png
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_file_schema**
+> test_body_with_file_schema(file_schema_test_class)
+
+For this test, the body for this request must reference a schema named `File`.
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass |
+
+ try:
+ api_instance.test_body_with_file_schema(file_schema_test_class)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_body_with_query_params**
+> test_body_with_query_params(query, user)
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.user import User
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ query = 'query_example' # str |
+ user = petstore_api.User() # User |
+
+ try:
+ api_instance.test_body_with_query_params(query, user)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **str**| |
+ **user** | [**User**](User.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_client_model**
+> Client test_client_model(client)
+
+To test \"client\" model
+
+To test "client" model
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.client import Client
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test \"client\" model
+ api_response = api_instance.test_client_model(client)
+ print("The response of FakeApi->test_client_model:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_client_model: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_date_time_query_parameter**
+> test_date_time_query_parameter(date_time_query, str_query)
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ date_time_query = '2013-10-20T19:20:30+01:00' # datetime |
+ str_query = 'str_query_example' # str |
+
+ try:
+ api_instance.test_date_time_query_parameter(date_time_query, str_query)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_date_time_query_parameter: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **date_time_query** | **datetime**| |
+ **str_query** | **str**| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_empty_and_non_empty_responses**
+> test_empty_and_non_empty_responses()
+
+test empty and non-empty responses
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test empty and non-empty responses
+ api_instance.test_empty_and_non_empty_responses()
+ except Exception as e:
+ print("Exception when calling FakeApi->test_empty_and_non_empty_responses: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: text/plain
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Success, but no response content | - |
+**206** | Partial response content | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_endpoint_parameters**
+> test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, var_float=var_float, string=string, binary=binary, byte_with_max_length=byte_with_max_length, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters
+假端點
+偽のエンドポイント
+가짜 엔드 포인트
+
+
+### Example
+
+* Basic Authentication (http_basic_test):
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure HTTP basic authorization: http_basic_test
+configuration = petstore_api.Configuration(
+ username = os.environ["USERNAME"],
+ password = os.environ["PASSWORD"]
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ number = 3.4 # float | None
+ double = 3.4 # float | None
+ pattern_without_delimiter = 'pattern_without_delimiter_example' # str | None
+ byte = None # bytearray | None
+ integer = 56 # int | None (optional)
+ int32 = 56 # int | None (optional)
+ int64 = 56 # int | None (optional)
+ var_float = 3.4 # float | None (optional)
+ string = 'string_example' # str | None (optional)
+ binary = None # bytearray | None (optional)
+ byte_with_max_length = None # bytearray | None (optional)
+ var_date = '2013-10-20' # date | None (optional)
+ date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
+ password = 'password_example' # str | None (optional)
+ param_callback = 'param_callback_example' # str | None (optional)
+
+ try:
+ # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ api_instance.test_endpoint_parameters(number, double, pattern_without_delimiter, byte, integer=integer, int32=int32, int64=int64, var_float=var_float, string=string, binary=binary, byte_with_max_length=byte_with_max_length, var_date=var_date, date_time=date_time, password=password, param_callback=param_callback)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **float**| None |
+ **double** | **float**| None |
+ **pattern_without_delimiter** | **str**| None |
+ **byte** | **bytearray**| None |
+ **integer** | **int**| None | [optional]
+ **int32** | **int**| None | [optional]
+ **int64** | **int**| None | [optional]
+ **var_float** | **float**| None | [optional]
+ **string** | **str**| None | [optional]
+ **binary** | **bytearray**| None | [optional]
+ **byte_with_max_length** | **bytearray**| None | [optional]
+ **var_date** | **date**| None | [optional]
+ **date_time** | **datetime**| None | [optional]
+ **password** | **str**| None | [optional]
+ **param_callback** | **str**| None | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_error_responses_with_model**
+> test_error_responses_with_model()
+
+test error responses with model
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+
+ try:
+ # test error responses with model
+ api_instance.test_error_responses_with_model()
+ except Exception as e:
+ print("Exception when calling FakeApi->test_error_responses_with_model: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**204** | Success, but no response content | - |
+**400** | | - |
+**404** | | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_group_parameters**
+> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+
+Fake endpoint to test group parameters (optional)
+
+Fake endpoint to test group parameters (optional)
+
+### Example
+
+* Bearer (JWT) Authentication (bearer_test):
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure Bearer authorization (JWT): bearer_test
+configuration = petstore_api.Configuration(
+ access_token = os.environ["BEARER_TOKEN"]
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ required_string_group = 56 # int | Required String in group parameters
+ required_boolean_group = True # bool | Required Boolean in group parameters
+ required_int64_group = 56 # int | Required Integer in group parameters
+ string_group = 56 # int | String in group parameters (optional)
+ boolean_group = True # bool | Boolean in group parameters (optional)
+ int64_group = 56 # int | Integer in group parameters (optional)
+
+ try:
+ # Fake endpoint to test group parameters (optional)
+ api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **required_string_group** | **int**| Required String in group parameters |
+ **required_boolean_group** | **bool**| Required Boolean in group parameters |
+ **required_int64_group** | **int**| Required Integer in group parameters |
+ **string_group** | **int**| String in group parameters | [optional]
+ **boolean_group** | **bool**| Boolean in group parameters | [optional]
+ **int64_group** | **int**| Integer in group parameters | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[bearer_test](../README.md#bearer_test)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Someting wrong | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_inline_additional_properties**
+> test_inline_additional_properties(request_body)
+
+test inline additionalProperties
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ request_body = {'key': 'request_body_example'} # Dict[str, str] | request body
+
+ try:
+ # test inline additionalProperties
+ api_instance.test_inline_additional_properties(request_body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_inline_additional_properties: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **request_body** | [**Dict[str, str]**](str.md)| request body |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_inline_freeform_additional_properties**
+> test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request)
+
+test inline free-form additionalProperties
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ test_inline_freeform_additional_properties_request = petstore_api.TestInlineFreeformAdditionalPropertiesRequest() # TestInlineFreeformAdditionalPropertiesRequest | request body
+
+ try:
+ # test inline free-form additionalProperties
+ api_instance.test_inline_freeform_additional_properties(test_inline_freeform_additional_properties_request)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_inline_freeform_additional_properties: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **test_inline_freeform_additional_properties_request** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.md)| request body |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_json_form_data**
+> test_json_form_data(param, param2)
+
+test json serialization of form data
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ param = 'param_example' # str | field1
+ param2 = 'param2_example' # str | field2
+
+ try:
+ # test json serialization of form data
+ api_instance.test_json_form_data(param, param2)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_json_form_data: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **str**| field1 |
+ **param2** | **str**| field2 |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_object_for_multipart_requests**
+> test_object_for_multipart_requests(marker)
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ marker = petstore_api.TestObjectForMultipartRequestsRequestMarker() # TestObjectForMultipartRequestsRequestMarker |
+
+ try:
+ api_instance.test_object_for_multipart_requests(marker)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_object_for_multipart_requests: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **marker** | [**TestObjectForMultipartRequestsRequestMarker**](TestObjectForMultipartRequestsRequestMarker.md)| |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_query_parameter_collection_format**
+> test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
+
+To test the collection format in query parameters
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ pipe = ['pipe_example'] # List[str] |
+ ioutil = ['ioutil_example'] # List[str] |
+ http = ['http_example'] # List[str] |
+ url = ['url_example'] # List[str] |
+ context = ['context_example'] # List[str] |
+ allow_empty = 'allow_empty_example' # str |
+ language = {'key': 'language_example'} # Dict[str, str] | (optional)
+
+ try:
+ api_instance.test_query_parameter_collection_format(pipe, ioutil, http, url, context, allow_empty, language=language)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_query_parameter_collection_format: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pipe** | [**List[str]**](str.md)| |
+ **ioutil** | [**List[str]**](str.md)| |
+ **http** | [**List[str]**](str.md)| |
+ **url** | [**List[str]**](str.md)| |
+ **context** | [**List[str]**](str.md)| |
+ **allow_empty** | **str**| |
+ **language** | [**Dict[str, str]**](str.md)| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Success | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **test_string_map_reference**
+> test_string_map_reference(request_body)
+
+test referenced string map
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ request_body = {'key': 'request_body_example'} # Dict[str, str] | request body
+
+ try:
+ # test referenced string map
+ api_instance.test_string_map_reference(request_body)
+ except Exception as e:
+ print("Exception when calling FakeApi->test_string_map_reference: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **request_body** | [**Dict[str, str]**](str.md)| request body |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file_with_additional_properties**
+> ModelApiResponse upload_file_with_additional_properties(file, object=object, count=count)
+
+uploads a file and additional properties using multipart/form-data
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.model_api_response import ModelApiResponse
+from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeApi(api_client)
+ file = None # bytearray | file to upload
+ object = petstore_api.UploadFileWithAdditionalPropertiesRequestObject() # UploadFileWithAdditionalPropertiesRequestObject | (optional)
+ count = 56 # int | Integer count (optional)
+
+ try:
+ # uploads a file and additional properties using multipart/form-data
+ api_response = api_instance.upload_file_with_additional_properties(file, object=object, count=count)
+ print("The response of FakeApi->upload_file_with_additional_properties:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeApi->upload_file_with_additional_properties: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **file** | **bytearray**| file to upload |
+ **object** | [**UploadFileWithAdditionalPropertiesRequestObject**](UploadFileWithAdditionalPropertiesRequestObject.md)| | [optional]
+ **count** | **int**| Integer count | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-lazyImports/docs/FakeClassnameTags123Api.md
new file mode 100644
index 00000000000..5194f5a2eef
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,88 @@
+# petstore_api.FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**test_classname**](FakeClassnameTags123Api.md#test_classname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+# **test_classname**
+> Client test_classname(client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+
+* Api Key Authentication (api_key_query):
+
+```python
+import petstore_api
+from petstore_api.models.client import Client
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key_query
+configuration.api_key['api_key_query'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key_query'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.FakeClassnameTags123Api(api_client)
+ client = petstore_api.Client() # Client | client model
+
+ try:
+ # To test class name in snake case
+ api_response = api_instance.test_classname(client)
+ print("The response of FakeClassnameTags123Api->test_classname:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Feeding.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Feeding.md
new file mode 100644
index 00000000000..9f92b5d964d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Feeding.md
@@ -0,0 +1,31 @@
+# Feeding
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**task_name** | **str** | |
+**function_name** | **str** | |
+**content** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.feeding import Feeding
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Feeding from a JSON string
+feeding_instance = Feeding.from_json(json)
+# print the JSON string representation of the object
+print(Feeding.to_json())
+
+# convert the object into a dict
+feeding_dict = feeding_instance.to_dict()
+# create an instance of Feeding from a dict
+feeding_from_dict = Feeding.from_dict(feeding_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/File.md b/samples/openapi3/client/petstore/python-lazyImports/docs/File.md
new file mode 100644
index 00000000000..23f0567411c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/File.md
@@ -0,0 +1,30 @@
+# File
+
+Must be named `File` for test.
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**source_uri** | **str** | Test capitalization | [optional]
+
+## Example
+
+```python
+from petstore_api.models.file import File
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of File from a JSON string
+file_instance = File.from_json(json)
+# print the JSON string representation of the object
+print(File.to_json())
+
+# convert the object into a dict
+file_dict = file_instance.to_dict()
+# create an instance of File from a dict
+file_from_dict = File.from_dict(file_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-lazyImports/docs/FileSchemaTestClass.md
new file mode 100644
index 00000000000..e1118042a8e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/FileSchemaTestClass.md
@@ -0,0 +1,30 @@
+# FileSchemaTestClass
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**file** | [**File**](File.md) | | [optional]
+**files** | [**List[File]**](File.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FileSchemaTestClass from a JSON string
+file_schema_test_class_instance = FileSchemaTestClass.from_json(json)
+# print the JSON string representation of the object
+print(FileSchemaTestClass.to_json())
+
+# convert the object into a dict
+file_schema_test_class_dict = file_schema_test_class_instance.to_dict()
+# create an instance of FileSchemaTestClass from a dict
+file_schema_test_class_from_dict = FileSchemaTestClass.from_dict(file_schema_test_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/FirstRef.md b/samples/openapi3/client/petstore/python-lazyImports/docs/FirstRef.md
new file mode 100644
index 00000000000..94b8ddc5ac2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/FirstRef.md
@@ -0,0 +1,30 @@
+# FirstRef
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**category** | **str** | | [optional]
+**self_ref** | [**SecondRef**](SecondRef.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.first_ref import FirstRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FirstRef from a JSON string
+first_ref_instance = FirstRef.from_json(json)
+# print the JSON string representation of the object
+print(FirstRef.to_json())
+
+# convert the object into a dict
+first_ref_dict = first_ref_instance.to_dict()
+# create an instance of FirstRef from a dict
+first_ref_from_dict = FirstRef.from_dict(first_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Foo.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Foo.md
new file mode 100644
index 00000000000..f635b0daa6d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Foo.md
@@ -0,0 +1,29 @@
+# Foo
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [default to 'bar']
+
+## Example
+
+```python
+from petstore_api.models.foo import Foo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Foo from a JSON string
+foo_instance = Foo.from_json(json)
+# print the JSON string representation of the object
+print(Foo.to_json())
+
+# convert the object into a dict
+foo_dict = foo_instance.to_dict()
+# create an instance of Foo from a dict
+foo_from_dict = Foo.from_dict(foo_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/FooGetDefaultResponse.md b/samples/openapi3/client/petstore/python-lazyImports/docs/FooGetDefaultResponse.md
new file mode 100644
index 00000000000..8d84f795b00
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/FooGetDefaultResponse.md
@@ -0,0 +1,29 @@
+# FooGetDefaultResponse
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**string** | [**Foo**](Foo.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FooGetDefaultResponse from a JSON string
+foo_get_default_response_instance = FooGetDefaultResponse.from_json(json)
+# print the JSON string representation of the object
+print(FooGetDefaultResponse.to_json())
+
+# convert the object into a dict
+foo_get_default_response_dict = foo_get_default_response_instance.to_dict()
+# create an instance of FooGetDefaultResponse from a dict
+foo_get_default_response_from_dict = FooGetDefaultResponse.from_dict(foo_get_default_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/FormatTest.md b/samples/openapi3/client/petstore/python-lazyImports/docs/FormatTest.md
new file mode 100644
index 00000000000..6be7fc01757
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/FormatTest.md
@@ -0,0 +1,45 @@
+# FormatTest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **int** | | [optional]
+**int32** | **int** | | [optional]
+**int64** | **int** | | [optional]
+**number** | **float** | |
+**var_float** | **float** | | [optional]
+**double** | **float** | | [optional]
+**decimal** | **decimal.Decimal** | | [optional]
+**string** | **str** | | [optional]
+**string_with_double_quote_pattern** | **str** | | [optional]
+**byte** | **bytearray** | | [optional]
+**binary** | **bytearray** | | [optional]
+**var_date** | **date** | |
+**date_time** | **datetime** | | [optional]
+**uuid** | **str** | | [optional]
+**password** | **str** | |
+**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
+**pattern_with_digits_and_delimiter** | **str** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
+
+## Example
+
+```python
+from petstore_api.models.format_test import FormatTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of FormatTest from a JSON string
+format_test_instance = FormatTest.from_json(json)
+# print the JSON string representation of the object
+print(FormatTest.to_json())
+
+# convert the object into a dict
+format_test_dict = format_test_instance.to_dict()
+# create an instance of FormatTest from a dict
+format_test_from_dict = FormatTest.from_dict(format_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-lazyImports/docs/HasOnlyReadOnly.md
new file mode 100644
index 00000000000..fdc48781b15
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/HasOnlyReadOnly.md
@@ -0,0 +1,30 @@
+# HasOnlyReadOnly
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [readonly]
+**foo** | **str** | | [optional] [readonly]
+
+## Example
+
+```python
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HasOnlyReadOnly from a JSON string
+has_only_read_only_instance = HasOnlyReadOnly.from_json(json)
+# print the JSON string representation of the object
+print(HasOnlyReadOnly.to_json())
+
+# convert the object into a dict
+has_only_read_only_dict = has_only_read_only_instance.to_dict()
+# create an instance of HasOnlyReadOnly from a dict
+has_only_read_only_from_dict = HasOnlyReadOnly.from_dict(has_only_read_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-lazyImports/docs/HealthCheckResult.md
new file mode 100644
index 00000000000..d4a2b187167
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/HealthCheckResult.md
@@ -0,0 +1,30 @@
+# HealthCheckResult
+
+Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nullable_message** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.health_check_result import HealthCheckResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HealthCheckResult from a JSON string
+health_check_result_instance = HealthCheckResult.from_json(json)
+# print the JSON string representation of the object
+print(HealthCheckResult.to_json())
+
+# convert the object into a dict
+health_check_result_dict = health_check_result_instance.to_dict()
+# create an instance of HealthCheckResult from a dict
+health_check_result_from_dict = HealthCheckResult.from_dict(health_check_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/HuntingDog.md b/samples/openapi3/client/petstore/python-lazyImports/docs/HuntingDog.md
new file mode 100644
index 00000000000..6db6745dd02
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/HuntingDog.md
@@ -0,0 +1,29 @@
+# HuntingDog
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**is_trained** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.hunting_dog import HuntingDog
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of HuntingDog from a JSON string
+hunting_dog_instance = HuntingDog.from_json(json)
+# print the JSON string representation of the object
+print(HuntingDog.to_json())
+
+# convert the object into a dict
+hunting_dog_dict = hunting_dog_instance.to_dict()
+# create an instance of HuntingDog from a dict
+hunting_dog_from_dict = HuntingDog.from_dict(hunting_dog_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ImportTestDatetimeApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ImportTestDatetimeApi.md
new file mode 100644
index 00000000000..9e8e90a99a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ImportTestDatetimeApi.md
@@ -0,0 +1,70 @@
+# petstore_api.ImportTestDatetimeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**import_test_return_datetime**](ImportTestDatetimeApi.md#import_test_return_datetime) | **GET** /import_test/return_datetime | test date time
+
+
+# **import_test_return_datetime**
+> datetime import_test_return_datetime()
+
+test date time
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.ImportTestDatetimeApi(api_client)
+
+ try:
+ # test date time
+ api_response = api_instance.import_test_return_datetime()
+ print("The response of ImportTestDatetimeApi->import_test_return_datetime:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling ImportTestDatetimeApi->import_test_return_datetime: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**datetime**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | OK | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Info.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Info.md
new file mode 100644
index 00000000000..db88778a914
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Info.md
@@ -0,0 +1,29 @@
+# Info
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**val** | [**BaseDiscriminator**](BaseDiscriminator.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.info import Info
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Info from a JSON string
+info_instance = Info.from_json(json)
+# print the JSON string representation of the object
+print(Info.to_json())
+
+# convert the object into a dict
+info_dict = info_instance.to_dict()
+# create an instance of Info from a dict
+info_from_dict = Info.from_dict(info_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/InnerDictWithProperty.md b/samples/openapi3/client/petstore/python-lazyImports/docs/InnerDictWithProperty.md
new file mode 100644
index 00000000000..7b82ebb770b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/InnerDictWithProperty.md
@@ -0,0 +1,29 @@
+# InnerDictWithProperty
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**a_property** | **object** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of InnerDictWithProperty from a JSON string
+inner_dict_with_property_instance = InnerDictWithProperty.from_json(json)
+# print the JSON string representation of the object
+print(InnerDictWithProperty.to_json())
+
+# convert the object into a dict
+inner_dict_with_property_dict = inner_dict_with_property_instance.to_dict()
+# create an instance of InnerDictWithProperty from a dict
+inner_dict_with_property_from_dict = InnerDictWithProperty.from_dict(inner_dict_with_property_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/InputAllOf.md b/samples/openapi3/client/petstore/python-lazyImports/docs/InputAllOf.md
new file mode 100644
index 00000000000..45298f5308f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/InputAllOf.md
@@ -0,0 +1,29 @@
+# InputAllOf
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**some_data** | [**Dict[str, Tag]**](Tag.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.input_all_of import InputAllOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of InputAllOf from a JSON string
+input_all_of_instance = InputAllOf.from_json(json)
+# print the JSON string representation of the object
+print(InputAllOf.to_json())
+
+# convert the object into a dict
+input_all_of_dict = input_all_of_instance.to_dict()
+# create an instance of InputAllOf from a dict
+input_all_of_from_dict = InputAllOf.from_dict(input_all_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/IntOrString.md b/samples/openapi3/client/petstore/python-lazyImports/docs/IntOrString.md
new file mode 100644
index 00000000000..b4070b9a8c7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/IntOrString.md
@@ -0,0 +1,28 @@
+# IntOrString
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from petstore_api.models.int_or_string import IntOrString
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of IntOrString from a JSON string
+int_or_string_instance = IntOrString.from_json(json)
+# print the JSON string representation of the object
+print(IntOrString.to_json())
+
+# convert the object into a dict
+int_or_string_dict = int_or_string_instance.to_dict()
+# create an instance of IntOrString from a dict
+int_or_string_from_dict = IntOrString.from_dict(int_or_string_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ListClass.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ListClass.md
new file mode 100644
index 00000000000..01068b7d22c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ListClass.md
@@ -0,0 +1,29 @@
+# ListClass
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_123_list** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.list_class import ListClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ListClass from a JSON string
+list_class_instance = ListClass.from_json(json)
+# print the JSON string representation of the object
+print(ListClass.to_json())
+
+# convert the object into a dict
+list_class_dict = list_class_instance.to_dict()
+# create an instance of ListClass from a dict
+list_class_from_dict = ListClass.from_dict(list_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/MapOfArrayOfModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/MapOfArrayOfModel.md
new file mode 100644
index 00000000000..71a4ef66b68
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/MapOfArrayOfModel.md
@@ -0,0 +1,29 @@
+# MapOfArrayOfModel
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**shop_id_to_org_online_lip_map** | **Dict[str, List[Tag]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MapOfArrayOfModel from a JSON string
+map_of_array_of_model_instance = MapOfArrayOfModel.from_json(json)
+# print the JSON string representation of the object
+print(MapOfArrayOfModel.to_json())
+
+# convert the object into a dict
+map_of_array_of_model_dict = map_of_array_of_model_instance.to_dict()
+# create an instance of MapOfArrayOfModel from a dict
+map_of_array_of_model_from_dict = MapOfArrayOfModel.from_dict(map_of_array_of_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/MapTest.md b/samples/openapi3/client/petstore/python-lazyImports/docs/MapTest.md
new file mode 100644
index 00000000000..d04b82e9378
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/MapTest.md
@@ -0,0 +1,32 @@
+# MapTest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**map_map_of_string** | **Dict[str, Dict[str, str]]** | | [optional]
+**map_of_enum_string** | **Dict[str, str]** | | [optional]
+**direct_map** | **Dict[str, bool]** | | [optional]
+**indirect_map** | **Dict[str, bool]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.map_test import MapTest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MapTest from a JSON string
+map_test_instance = MapTest.from_json(json)
+# print the JSON string representation of the object
+print(MapTest.to_json())
+
+# convert the object into a dict
+map_test_dict = map_test_instance.to_dict()
+# create an instance of MapTest from a dict
+map_test_from_dict = MapTest.from_dict(map_test_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-lazyImports/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 00000000000..0dc994275d1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,31 @@
+# MixedPropertiesAndAdditionalPropertiesClass
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **str** | | [optional]
+**date_time** | **datetime** | | [optional]
+**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string
+mixed_properties_and_additional_properties_class_instance = MixedPropertiesAndAdditionalPropertiesClass.from_json(json)
+# print the JSON string representation of the object
+print(MixedPropertiesAndAdditionalPropertiesClass.to_json())
+
+# convert the object into a dict
+mixed_properties_and_additional_properties_class_dict = mixed_properties_and_additional_properties_class_instance.to_dict()
+# create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict
+mixed_properties_and_additional_properties_class_from_dict = MixedPropertiesAndAdditionalPropertiesClass.from_dict(mixed_properties_and_additional_properties_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Model200Response.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Model200Response.md
new file mode 100644
index 00000000000..7fdbdefc6ce
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Model200Response.md
@@ -0,0 +1,31 @@
+# Model200Response
+
+Model for testing model name starting with number
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | | [optional]
+**var_class** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model200_response import Model200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Model200Response from a JSON string
+model200_response_instance = Model200Response.from_json(json)
+# print the JSON string representation of the object
+print(Model200Response.to_json())
+
+# convert the object into a dict
+model200_response_dict = model200_response_instance.to_dict()
+# create an instance of Model200Response from a dict
+model200_response_from_dict = Model200Response.from_dict(model200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ModelApiResponse.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ModelApiResponse.md
new file mode 100644
index 00000000000..5ddc0db2a0f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ModelApiResponse.md
@@ -0,0 +1,31 @@
+# ModelApiResponse
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **int** | | [optional]
+**type** | **str** | | [optional]
+**message** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model_api_response import ModelApiResponse
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelApiResponse from a JSON string
+model_api_response_instance = ModelApiResponse.from_json(json)
+# print the JSON string representation of the object
+print(ModelApiResponse.to_json())
+
+# convert the object into a dict
+model_api_response_dict = model_api_response_instance.to_dict()
+# create an instance of ModelApiResponse from a dict
+model_api_response_from_dict = ModelApiResponse.from_dict(model_api_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ModelField.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ModelField.md
new file mode 100644
index 00000000000..9073b5dbdb0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ModelField.md
@@ -0,0 +1,29 @@
+# ModelField
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_field** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model_field import ModelField
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelField from a JSON string
+model_field_instance = ModelField.from_json(json)
+# print the JSON string representation of the object
+print(ModelField.to_json())
+
+# convert the object into a dict
+model_field_dict = model_field_instance.to_dict()
+# create an instance of ModelField from a dict
+model_field_from_dict = ModelField.from_dict(model_field_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ModelReturn.md
new file mode 100644
index 00000000000..7d327053b0c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ModelReturn.md
@@ -0,0 +1,30 @@
+# ModelReturn
+
+Model for testing reserved words
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_return** | **int** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.model_return import ModelReturn
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ModelReturn from a JSON string
+model_return_instance = ModelReturn.from_json(json)
+# print the JSON string representation of the object
+print(ModelReturn.to_json())
+
+# convert the object into a dict
+model_return_dict = model_return_instance.to_dict()
+# create an instance of ModelReturn from a dict
+model_return_from_dict = ModelReturn.from_dict(model_return_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/MultiArrays.md b/samples/openapi3/client/petstore/python-lazyImports/docs/MultiArrays.md
new file mode 100644
index 00000000000..fea5139e7e7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/MultiArrays.md
@@ -0,0 +1,30 @@
+# MultiArrays
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**tags** | [**List[Tag]**](Tag.md) | | [optional]
+**files** | [**List[File]**](File.md) | Another array of objects in addition to tags (mypy check to not to reuse the same iterator) | [optional]
+
+## Example
+
+```python
+from petstore_api.models.multi_arrays import MultiArrays
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MultiArrays from a JSON string
+multi_arrays_instance = MultiArrays.from_json(json)
+# print the JSON string representation of the object
+print(MultiArrays.to_json())
+
+# convert the object into a dict
+multi_arrays_dict = multi_arrays_instance.to_dict()
+# create an instance of MultiArrays from a dict
+multi_arrays_from_dict = MultiArrays.from_dict(multi_arrays_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Name.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Name.md
new file mode 100644
index 00000000000..5a04ec1ada0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Name.md
@@ -0,0 +1,33 @@
+# Name
+
+Model for testing model name same as property name
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **int** | |
+**snake_case** | **int** | | [optional] [readonly]
+**var_property** | **str** | | [optional]
+**var_123_number** | **int** | | [optional] [readonly]
+
+## Example
+
+```python
+from petstore_api.models.name import Name
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Name from a JSON string
+name_instance = Name.from_json(json)
+# print the JSON string representation of the object
+print(Name.to_json())
+
+# convert the object into a dict
+name_dict = name_instance.to_dict()
+# create an instance of Name from a dict
+name_from_dict = Name.from_dict(name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/NullableClass.md b/samples/openapi3/client/petstore/python-lazyImports/docs/NullableClass.md
new file mode 100644
index 00000000000..0387dcc2c67
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/NullableClass.md
@@ -0,0 +1,41 @@
+# NullableClass
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**required_integer_prop** | **int** | |
+**integer_prop** | **int** | | [optional]
+**number_prop** | **float** | | [optional]
+**boolean_prop** | **bool** | | [optional]
+**string_prop** | **str** | | [optional]
+**date_prop** | **date** | | [optional]
+**datetime_prop** | **datetime** | | [optional]
+**array_nullable_prop** | **List[object]** | | [optional]
+**array_and_items_nullable_prop** | **List[Optional[object]]** | | [optional]
+**array_items_nullable** | **List[Optional[object]]** | | [optional]
+**object_nullable_prop** | **Dict[str, object]** | | [optional]
+**object_and_items_nullable_prop** | **Dict[str, Optional[object]]** | | [optional]
+**object_items_nullable** | **Dict[str, Optional[object]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.nullable_class import NullableClass
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NullableClass from a JSON string
+nullable_class_instance = NullableClass.from_json(json)
+# print the JSON string representation of the object
+print(NullableClass.to_json())
+
+# convert the object into a dict
+nullable_class_dict = nullable_class_instance.to_dict()
+# create an instance of NullableClass from a dict
+nullable_class_from_dict = NullableClass.from_dict(nullable_class_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/NullableProperty.md b/samples/openapi3/client/petstore/python-lazyImports/docs/NullableProperty.md
new file mode 100644
index 00000000000..30edaf4844b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/NullableProperty.md
@@ -0,0 +1,30 @@
+# NullableProperty
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | |
+**name** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.nullable_property import NullableProperty
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NullableProperty from a JSON string
+nullable_property_instance = NullableProperty.from_json(json)
+# print the JSON string representation of the object
+print(NullableProperty.to_json())
+
+# convert the object into a dict
+nullable_property_dict = nullable_property_instance.to_dict()
+# create an instance of NullableProperty from a dict
+nullable_property_from_dict = NullableProperty.from_dict(nullable_property_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-lazyImports/docs/NumberOnly.md
new file mode 100644
index 00000000000..415dd25585d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/NumberOnly.md
@@ -0,0 +1,29 @@
+# NumberOnly
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**just_number** | **float** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.number_only import NumberOnly
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NumberOnly from a JSON string
+number_only_instance = NumberOnly.from_json(json)
+# print the JSON string representation of the object
+print(NumberOnly.to_json())
+
+# convert the object into a dict
+number_only_dict = number_only_instance.to_dict()
+# create an instance of NumberOnly from a dict
+number_only_from_dict = NumberOnly.from_dict(number_only_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ObjectToTestAdditionalProperties.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ObjectToTestAdditionalProperties.md
new file mode 100644
index 00000000000..f6bc34c98e6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ObjectToTestAdditionalProperties.md
@@ -0,0 +1,30 @@
+# ObjectToTestAdditionalProperties
+
+Minimal object
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_property** | **bool** | Property | [optional] [default to False]
+
+## Example
+
+```python
+from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ObjectToTestAdditionalProperties from a JSON string
+object_to_test_additional_properties_instance = ObjectToTestAdditionalProperties.from_json(json)
+# print the JSON string representation of the object
+print(ObjectToTestAdditionalProperties.to_json())
+
+# convert the object into a dict
+object_to_test_additional_properties_dict = object_to_test_additional_properties_instance.to_dict()
+# create an instance of ObjectToTestAdditionalProperties from a dict
+object_to_test_additional_properties_from_dict = ObjectToTestAdditionalProperties.from_dict(object_to_test_additional_properties_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ObjectWithDeprecatedFields.md
new file mode 100644
index 00000000000..6dbd2ace04f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ObjectWithDeprecatedFields.md
@@ -0,0 +1,32 @@
+# ObjectWithDeprecatedFields
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | **str** | | [optional]
+**id** | **float** | | [optional]
+**deprecated_ref** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
+**bars** | **List[str]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ObjectWithDeprecatedFields from a JSON string
+object_with_deprecated_fields_instance = ObjectWithDeprecatedFields.from_json(json)
+# print the JSON string representation of the object
+print(ObjectWithDeprecatedFields.to_json())
+
+# convert the object into a dict
+object_with_deprecated_fields_dict = object_with_deprecated_fields_instance.to_dict()
+# create an instance of ObjectWithDeprecatedFields from a dict
+object_with_deprecated_fields_from_dict = ObjectWithDeprecatedFields.from_dict(object_with_deprecated_fields_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OneOfEnumString.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OneOfEnumString.md
new file mode 100644
index 00000000000..1d385c09293
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OneOfEnumString.md
@@ -0,0 +1,29 @@
+# OneOfEnumString
+
+oneOf enum strings
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from petstore_api.models.one_of_enum_string import OneOfEnumString
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OneOfEnumString from a JSON string
+one_of_enum_string_instance = OneOfEnumString.from_json(json)
+# print the JSON string representation of the object
+print(OneOfEnumString.to_json())
+
+# convert the object into a dict
+one_of_enum_string_dict = one_of_enum_string_instance.to_dict()
+# create an instance of OneOfEnumString from a dict
+one_of_enum_string_from_dict = OneOfEnumString.from_dict(one_of_enum_string_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Order.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Order.md
new file mode 100644
index 00000000000..00526b8d04b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Order.md
@@ -0,0 +1,34 @@
+# Order
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**pet_id** | **int** | | [optional]
+**quantity** | **int** | | [optional]
+**ship_date** | **datetime** | | [optional]
+**status** | **str** | Order Status | [optional]
+**complete** | **bool** | | [optional] [default to False]
+
+## Example
+
+```python
+from petstore_api.models.order import Order
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Order from a JSON string
+order_instance = Order.from_json(json)
+# print the JSON string representation of the object
+print(Order.to_json())
+
+# convert the object into a dict
+order_dict = order_instance.to_dict()
+# create an instance of Order from a dict
+order_from_dict = Order.from_dict(order_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OuterComposite.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterComposite.md
new file mode 100644
index 00000000000..c8242c2d265
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterComposite.md
@@ -0,0 +1,31 @@
+# OuterComposite
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**my_number** | **float** | | [optional]
+**my_string** | **str** | | [optional]
+**my_boolean** | **bool** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.outer_composite import OuterComposite
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OuterComposite from a JSON string
+outer_composite_instance = OuterComposite.from_json(json)
+# print the JSON string representation of the object
+print(OuterComposite.to_json())
+
+# convert the object into a dict
+outer_composite_dict = outer_composite_instance.to_dict()
+# create an instance of OuterComposite from a dict
+outer_composite_from_dict = OuterComposite.from_dict(outer_composite_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnum.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnum.md
new file mode 100644
index 00000000000..9ba4f91069a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnum.md
@@ -0,0 +1,14 @@
+# OuterEnum
+
+
+## Enum
+
+* `PLACED` (value: `'placed'`)
+
+* `APPROVED` (value: `'approved'`)
+
+* `DELIVERED` (value: `'delivered'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumDefaultValue.md
new file mode 100644
index 00000000000..0c97f8c9cb6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumDefaultValue.md
@@ -0,0 +1,14 @@
+# OuterEnumDefaultValue
+
+
+## Enum
+
+* `PLACED` (value: `'placed'`)
+
+* `APPROVED` (value: `'approved'`)
+
+* `DELIVERED` (value: `'delivered'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumInteger.md
new file mode 100644
index 00000000000..052b5163814
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumInteger.md
@@ -0,0 +1,14 @@
+# OuterEnumInteger
+
+
+## Enum
+
+* `NUMBER_0` (value: `0`)
+
+* `NUMBER_1` (value: `1`)
+
+* `NUMBER_2` (value: `2`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumIntegerDefaultValue.md
new file mode 100644
index 00000000000..66cd0abdb0a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterEnumIntegerDefaultValue.md
@@ -0,0 +1,16 @@
+# OuterEnumIntegerDefaultValue
+
+
+## Enum
+
+* `NUMBER_MINUS_1` (value: `-1`)
+
+* `NUMBER_0` (value: `0`)
+
+* `NUMBER_1` (value: `1`)
+
+* `NUMBER_2` (value: `2`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterObjectWithEnumProperty.md
new file mode 100644
index 00000000000..6137dbd98da
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/OuterObjectWithEnumProperty.md
@@ -0,0 +1,30 @@
+# OuterObjectWithEnumProperty
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**str_value** | [**OuterEnum**](OuterEnum.md) | | [optional]
+**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | |
+
+## Example
+
+```python
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of OuterObjectWithEnumProperty from a JSON string
+outer_object_with_enum_property_instance = OuterObjectWithEnumProperty.from_json(json)
+# print the JSON string representation of the object
+print(OuterObjectWithEnumProperty.to_json())
+
+# convert the object into a dict
+outer_object_with_enum_property_dict = outer_object_with_enum_property_instance.to_dict()
+# create an instance of OuterObjectWithEnumProperty from a dict
+outer_object_with_enum_property_from_dict = OuterObjectWithEnumProperty.from_dict(outer_object_with_enum_property_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Parent.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Parent.md
new file mode 100644
index 00000000000..7387f9250aa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Parent.md
@@ -0,0 +1,29 @@
+# Parent
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**optional_dict** | [**Dict[str, InnerDictWithProperty]**](InnerDictWithProperty.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.parent import Parent
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Parent from a JSON string
+parent_instance = Parent.from_json(json)
+# print the JSON string representation of the object
+print(Parent.to_json())
+
+# convert the object into a dict
+parent_dict = parent_instance.to_dict()
+# create an instance of Parent from a dict
+parent_from_dict = Parent.from_dict(parent_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ParentWithOptionalDict.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ParentWithOptionalDict.md
new file mode 100644
index 00000000000..bfc8688ea26
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ParentWithOptionalDict.md
@@ -0,0 +1,29 @@
+# ParentWithOptionalDict
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**optional_dict** | [**Dict[str, InnerDictWithProperty]**](InnerDictWithProperty.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ParentWithOptionalDict from a JSON string
+parent_with_optional_dict_instance = ParentWithOptionalDict.from_json(json)
+# print the JSON string representation of the object
+print(ParentWithOptionalDict.to_json())
+
+# convert the object into a dict
+parent_with_optional_dict_dict = parent_with_optional_dict_instance.to_dict()
+# create an instance of ParentWithOptionalDict from a dict
+parent_with_optional_dict_from_dict = ParentWithOptionalDict.from_dict(parent_with_optional_dict_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Pet.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Pet.md
new file mode 100644
index 00000000000..5329cf2fb92
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Pet.md
@@ -0,0 +1,34 @@
+# Pet
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **str** | |
+**photo_urls** | **List[str]** | |
+**tags** | [**List[Tag]**](Tag.md) | | [optional]
+**status** | **str** | pet status in the store | [optional]
+
+## Example
+
+```python
+from petstore_api.models.pet import Pet
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Pet from a JSON string
+pet_instance = Pet.from_json(json)
+# print the JSON string representation of the object
+print(Pet.to_json())
+
+# convert the object into a dict
+pet_dict = pet_instance.to_dict()
+# create an instance of Pet from a dict
+pet_from_dict = Pet.from_dict(pet_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/PetApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/PetApi.md
new file mode 100644
index 00000000000..05c547865af
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/PetApi.md
@@ -0,0 +1,962 @@
+# petstore_api.PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
+[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
+[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
+[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
+[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
+[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
+[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**upload_file_with_required_file**](PetApi.md#upload_file_with_required_file) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+# **add_pet**
+> add_pet(pet)
+
+Add a new pet to the store
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.models.pet import Pet
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+from petstore_api import signing
+import datetime
+
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Add a new pet to the store
+ api_instance.add_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->add_pet: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successful operation | - |
+**405** | Invalid input | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_pet**
+> delete_pet(pet_id, api_key=api_key)
+
+Deletes a pet
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | Pet id to delete
+ api_key = 'api_key_example' # str | (optional)
+
+ try:
+ # Deletes a pet
+ api_instance.delete_pet(pet_id, api_key=api_key)
+ except Exception as e:
+ print("Exception when calling PetApi->delete_pet: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| Pet id to delete |
+ **api_key** | **str**| | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successful operation | - |
+**400** | Invalid pet value | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_status**
+> List[Pet] find_pets_by_status(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.models.pet import Pet
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+from petstore_api import signing
+import datetime
+
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ status = ['status_example'] # List[str] | Status values that need to be considered for filter
+
+ try:
+ # Finds Pets by status
+ api_response = api_instance.find_pets_by_status(status)
+ print("The response of PetApi->find_pets_by_status:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_status: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List[str]**](str.md)| Status values that need to be considered for filter |
+
+### Return type
+
+[**List[Pet]**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid status value | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **find_pets_by_tags**
+> List[Pet] find_pets_by_tags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.models.pet import Pet
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+from petstore_api import signing
+import datetime
+
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ tags = ['tags_example'] # List[str] | Tags to filter by
+
+ try:
+ # Finds Pets by tags
+ api_response = api_instance.find_pets_by_tags(tags)
+ print("The response of PetApi->find_pets_by_tags:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->find_pets_by_tags: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List[str]**](str.md)| Tags to filter by |
+
+### Return type
+
+[**List[Pet]**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid tag value | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_pet_by_id**
+> Pet get_pet_by_id(pet_id)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+
+* Api Key Authentication (api_key):
+
+```python
+import petstore_api
+from petstore_api.models.pet import Pet
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to return
+
+ try:
+ # Find pet by ID
+ api_response = api_instance.get_pet_by_id(pet_id)
+ print("The response of PetApi->get_pet_by_id:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->get_pet_by_id: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Pet not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet**
+> update_pet(pet)
+
+Update an existing pet
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.models.pet import Pet
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Configure HTTP message signature: http_signature_test
+# The HTTP Signature Header mechanism that can be used by a client to
+# authenticate the sender of a message and ensure that particular headers
+# have not been modified in transit.
+#
+# You can specify the signing key-id, private key path, signing scheme,
+# signing algorithm, list of signed headers and signature max validity.
+# The 'key_id' parameter is an opaque string that the API server can use
+# to lookup the client and validate the signature.
+# The 'private_key_path' parameter should be the path to a file that
+# contains a DER or base-64 encoded private key.
+# The 'private_key_passphrase' parameter is optional. Set the passphrase
+# if the private key is encrypted.
+# The 'signed_headers' parameter is used to specify the list of
+# HTTP headers included when generating the signature for the message.
+# You can specify HTTP headers that you want to protect with a cryptographic
+# signature. Note that proxies may add, modify or remove HTTP headers
+# for legitimate reasons, so you should only add headers that you know
+# will not be modified. For example, if you want to protect the HTTP request
+# body, you can specify the Digest header. In that case, the client calculates
+# the digest of the HTTP request body and includes the digest in the message
+# signature.
+# The 'signature_max_validity' parameter is optional. It is configured as a
+# duration to express when the signature ceases to be valid. The client calculates
+# the expiration date every time it generates the cryptographic signature
+# of an HTTP request. The API server may have its own security policy
+# that controls the maximum validity of the signature. The client max validity
+# must be lower than the server max validity.
+# The time on the client and server must be synchronized, otherwise the
+# server may reject the client signature.
+#
+# The client must use a combination of private key, signing scheme,
+# signing algorithm and hash algorithm that matches the security policy of
+# the API server.
+#
+# See petstore_api.signing for a list of all supported parameters.
+from petstore_api import signing
+import datetime
+
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2",
+ signing_info = petstore_api.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'private_key.pem',
+ private_key_passphrase = 'YOUR_PASSPHRASE',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ hash_algorithm = petstore_api.signing.SCHEME_RSA_SHA256,
+ signed_headers = [
+ petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'Content-Length',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store
+
+ try:
+ # Update an existing pet
+ api_instance.update_pet(pet)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Pet not found | - |
+**405** | Validation exception | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_pet_with_form**
+> update_pet_with_form(pet_id, name=name, status=status)
+
+Updates a pet in the store with form data
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet that needs to be updated
+ name = 'name_example' # str | Updated name of the pet (optional)
+ status = 'status_example' # str | Updated status of the pet (optional)
+
+ try:
+ # Updates a pet in the store with form data
+ api_instance.update_pet_with_form(pet_id, name=name, status=status)
+ except Exception as e:
+ print("Exception when calling PetApi->update_pet_with_form: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet that needs to be updated |
+ **name** | **str**| Updated name of the pet | [optional]
+ **status** | **str**| Updated status of the pet | [optional]
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | Successful operation | - |
+**405** | Invalid input | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file**
+> ModelApiResponse upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+
+uploads an image
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.models.model_api_response import ModelApiResponse
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+ additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+ file = None # bytearray | file to upload (optional)
+
+ try:
+ # uploads an image
+ api_response = api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
+ print("The response of PetApi->upload_file:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->upload_file: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+ **file** | **bytearray**| file to upload | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **upload_file_with_required_file**
+> ModelApiResponse upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+
+uploads an image (required)
+
+
+
+### Example
+
+* OAuth Authentication (petstore_auth):
+
+```python
+import petstore_api
+from petstore_api.models.model_api_response import ModelApiResponse
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+configuration.access_token = os.environ["ACCESS_TOKEN"]
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.PetApi(api_client)
+ pet_id = 56 # int | ID of pet to update
+ required_file = None # bytearray | file to upload
+ additional_metadata = 'additional_metadata_example' # str | Additional data to pass to server (optional)
+
+ try:
+ # uploads an image (required)
+ api_response = api_instance.upload_file_with_required_file(pet_id, required_file, additional_metadata=additional_metadata)
+ print("The response of PetApi->upload_file_with_required_file:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling PetApi->upload_file_with_required_file: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet_id** | **int**| ID of pet to update |
+ **required_file** | **bytearray**| file to upload |
+ **additional_metadata** | **str**| Additional data to pass to server | [optional]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Pig.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Pig.md
new file mode 100644
index 00000000000..62593067608
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Pig.md
@@ -0,0 +1,31 @@
+# Pig
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**class_name** | **str** | |
+**color** | **str** | |
+**size** | **int** | |
+
+## Example
+
+```python
+from petstore_api.models.pig import Pig
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Pig from a JSON string
+pig_instance = Pig.from_json(json)
+# print the JSON string representation of the object
+print(Pig.to_json())
+
+# convert the object into a dict
+pig_dict = pig_instance.to_dict()
+# create an instance of Pig from a dict
+pig_from_dict = Pig.from_dict(pig_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/PonySizes.md b/samples/openapi3/client/petstore/python-lazyImports/docs/PonySizes.md
new file mode 100644
index 00000000000..ced44c87206
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/PonySizes.md
@@ -0,0 +1,29 @@
+# PonySizes
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**type** | [**Type**](Type.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.pony_sizes import PonySizes
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PonySizes from a JSON string
+pony_sizes_instance = PonySizes.from_json(json)
+# print the JSON string representation of the object
+print(PonySizes.to_json())
+
+# convert the object into a dict
+pony_sizes_dict = pony_sizes_instance.to_dict()
+# create an instance of PonySizes from a dict
+pony_sizes_from_dict = PonySizes.from_dict(pony_sizes_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/PoopCleaning.md b/samples/openapi3/client/petstore/python-lazyImports/docs/PoopCleaning.md
new file mode 100644
index 00000000000..8f9c25e0831
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/PoopCleaning.md
@@ -0,0 +1,31 @@
+# PoopCleaning
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**task_name** | **str** | |
+**function_name** | **str** | |
+**content** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.poop_cleaning import PoopCleaning
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PoopCleaning from a JSON string
+poop_cleaning_instance = PoopCleaning.from_json(json)
+# print the JSON string representation of the object
+print(PoopCleaning.to_json())
+
+# convert the object into a dict
+poop_cleaning_dict = poop_cleaning_instance.to_dict()
+# create an instance of PoopCleaning from a dict
+poop_cleaning_from_dict = PoopCleaning.from_dict(poop_cleaning_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/PrimitiveString.md b/samples/openapi3/client/petstore/python-lazyImports/docs/PrimitiveString.md
new file mode 100644
index 00000000000..85ceb632e16
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/PrimitiveString.md
@@ -0,0 +1,29 @@
+# PrimitiveString
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**value** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.primitive_string import PrimitiveString
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PrimitiveString from a JSON string
+primitive_string_instance = PrimitiveString.from_json(json)
+# print the JSON string representation of the object
+print(PrimitiveString.to_json())
+
+# convert the object into a dict
+primitive_string_dict = primitive_string_instance.to_dict()
+# create an instance of PrimitiveString from a dict
+primitive_string_from_dict = PrimitiveString.from_dict(primitive_string_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/PropertyMap.md b/samples/openapi3/client/petstore/python-lazyImports/docs/PropertyMap.md
new file mode 100644
index 00000000000..a55a0e5c6f0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/PropertyMap.md
@@ -0,0 +1,29 @@
+# PropertyMap
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**some_data** | [**Dict[str, Tag]**](Tag.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.property_map import PropertyMap
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PropertyMap from a JSON string
+property_map_instance = PropertyMap.from_json(json)
+# print the JSON string representation of the object
+print(PropertyMap.to_json())
+
+# convert the object into a dict
+property_map_dict = property_map_instance.to_dict()
+# create an instance of PropertyMap from a dict
+property_map_from_dict = PropertyMap.from_dict(property_map_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/PropertyNameCollision.md b/samples/openapi3/client/petstore/python-lazyImports/docs/PropertyNameCollision.md
new file mode 100644
index 00000000000..40c233670dd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/PropertyNameCollision.md
@@ -0,0 +1,31 @@
+# PropertyNameCollision
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**underscore_type** | **str** | | [optional]
+**type** | **str** | | [optional]
+**type_with_underscore** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.property_name_collision import PropertyNameCollision
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PropertyNameCollision from a JSON string
+property_name_collision_instance = PropertyNameCollision.from_json(json)
+# print the JSON string representation of the object
+print(PropertyNameCollision.to_json())
+
+# convert the object into a dict
+property_name_collision_dict = property_name_collision_instance.to_dict()
+# create an instance of PropertyNameCollision from a dict
+property_name_collision_from_dict = PropertyNameCollision.from_dict(property_name_collision_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-lazyImports/docs/ReadOnlyFirst.md
new file mode 100644
index 00000000000..686ec5da41c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/ReadOnlyFirst.md
@@ -0,0 +1,30 @@
+# ReadOnlyFirst
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **str** | | [optional] [readonly]
+**baz** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.read_only_first import ReadOnlyFirst
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ReadOnlyFirst from a JSON string
+read_only_first_instance = ReadOnlyFirst.from_json(json)
+# print the JSON string representation of the object
+print(ReadOnlyFirst.to_json())
+
+# convert the object into a dict
+read_only_first_dict = read_only_first_instance.to_dict()
+# create an instance of ReadOnlyFirst from a dict
+read_only_first_from_dict = ReadOnlyFirst.from_dict(read_only_first_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SecondCircularAllOfRef.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SecondCircularAllOfRef.md
new file mode 100644
index 00000000000..65ebdd4c7e1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SecondCircularAllOfRef.md
@@ -0,0 +1,30 @@
+# SecondCircularAllOfRef
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+**circular_all_of_ref** | [**List[CircularAllOfRef]**](CircularAllOfRef.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SecondCircularAllOfRef from a JSON string
+second_circular_all_of_ref_instance = SecondCircularAllOfRef.from_json(json)
+# print the JSON string representation of the object
+print(SecondCircularAllOfRef.to_json())
+
+# convert the object into a dict
+second_circular_all_of_ref_dict = second_circular_all_of_ref_instance.to_dict()
+# create an instance of SecondCircularAllOfRef from a dict
+second_circular_all_of_ref_from_dict = SecondCircularAllOfRef.from_dict(second_circular_all_of_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SecondRef.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SecondRef.md
new file mode 100644
index 00000000000..dfb1a0ac6db
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SecondRef.md
@@ -0,0 +1,30 @@
+# SecondRef
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**category** | **str** | | [optional]
+**circular_ref** | [**CircularReferenceModel**](CircularReferenceModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.second_ref import SecondRef
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SecondRef from a JSON string
+second_ref_instance = SecondRef.from_json(json)
+# print the JSON string representation of the object
+print(SecondRef.to_json())
+
+# convert the object into a dict
+second_ref_dict = second_ref_instance.to_dict()
+# create an instance of SecondRef from a dict
+second_ref_from_dict = SecondRef.from_dict(second_ref_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SelfReferenceModel.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SelfReferenceModel.md
new file mode 100644
index 00000000000..208cdac04b6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SelfReferenceModel.md
@@ -0,0 +1,30 @@
+# SelfReferenceModel
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested** | [**DummyModel**](DummyModel.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.self_reference_model import SelfReferenceModel
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SelfReferenceModel from a JSON string
+self_reference_model_instance = SelfReferenceModel.from_json(json)
+# print the JSON string representation of the object
+print(SelfReferenceModel.to_json())
+
+# convert the object into a dict
+self_reference_model_dict = self_reference_model_instance.to_dict()
+# create an instance of SelfReferenceModel from a dict
+self_reference_model_from_dict = SelfReferenceModel.from_dict(self_reference_model_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SingleRefType.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SingleRefType.md
new file mode 100644
index 00000000000..8f0f60e5678
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SingleRefType.md
@@ -0,0 +1,12 @@
+# SingleRefType
+
+
+## Enum
+
+* `ADMIN` (value: `'admin'`)
+
+* `USER` (value: `'user'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialCharacterEnum.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialCharacterEnum.md
new file mode 100644
index 00000000000..71a3affc4fe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialCharacterEnum.md
@@ -0,0 +1,28 @@
+# SpecialCharacterEnum
+
+
+## Enum
+
+* `ENUM_456` (value: `'456'`)
+
+* `ENUM_123ABC` (value: `'123abc'`)
+
+* `UNDERSCORE` (value: `'_'`)
+
+* `SPACE` (value: `' '`)
+
+* `AMPERSAND` (value: `'&'`)
+
+* `DOLLAR` (value: `'$'`)
+
+* `GREATER_THAN_EQUAL` (value: `'>='`)
+
+* `THIS_IS_EXCLAMATION` (value: `'this_is_!'`)
+
+* `IMPORT` (value: `'import'`)
+
+* `HELLO_WORLD` (value: `' hello world '`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialModelName.md
new file mode 100644
index 00000000000..35303f34efd
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialModelName.md
@@ -0,0 +1,29 @@
+# SpecialModelName
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**special_property_name** | **int** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.special_model_name import SpecialModelName
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SpecialModelName from a JSON string
+special_model_name_instance = SpecialModelName.from_json(json)
+# print the JSON string representation of the object
+print(SpecialModelName.to_json())
+
+# convert the object into a dict
+special_model_name_dict = special_model_name_instance.to_dict()
+# create an instance of SpecialModelName from a dict
+special_model_name_from_dict = SpecialModelName.from_dict(special_model_name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialName.md b/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialName.md
new file mode 100644
index 00000000000..ccc550b16e3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/SpecialName.md
@@ -0,0 +1,31 @@
+# SpecialName
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**var_property** | **int** | | [optional]
+**var_async** | [**Category**](Category.md) | | [optional]
+**var_schema** | **str** | pet status in the store | [optional]
+
+## Example
+
+```python
+from petstore_api.models.special_name import SpecialName
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of SpecialName from a JSON string
+special_name_instance = SpecialName.from_json(json)
+# print the JSON string representation of the object
+print(SpecialName.to_json())
+
+# convert the object into a dict
+special_name_dict = special_name_instance.to_dict()
+# create an instance of SpecialName from a dict
+special_name_from_dict = SpecialName.from_dict(special_name_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/StoreApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/StoreApi.md
new file mode 100644
index 00000000000..19d6a89e5b9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/StoreApi.md
@@ -0,0 +1,291 @@
+# petstore_api.StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status
+[**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet
+
+
+# **delete_order**
+> delete_order(order_id)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 'order_id_example' # str | ID of the order that needs to be deleted
+
+ try:
+ # Delete purchase order by ID
+ api_instance.delete_order(order_id)
+ except Exception as e:
+ print("Exception when calling StoreApi->delete_order: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order_id** | **str**| ID of the order that needs to be deleted |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid ID supplied | - |
+**404** | Order not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_inventory**
+> Dict[str, int] get_inventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+
+* Api Key Authentication (api_key):
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+# The client must configure the authentication and authorization parameters
+# in accordance with the API server security policy.
+# Examples for each auth method are provided below, use the example that
+# satisfies your auth use case.
+
+# Configure API key authorization: api_key
+configuration.api_key['api_key'] = os.environ["API_KEY"]
+
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# configuration.api_key_prefix['api_key'] = 'Bearer'
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+
+ try:
+ # Returns pet inventories by status
+ api_response = api_instance.get_inventory()
+ print("The response of StoreApi->get_inventory:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->get_inventory: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+**Dict[str, int]**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_order_by_id**
+> Order get_order_by_id(order_id)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.order import Order
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order_id = 56 # int | ID of pet that needs to be fetched
+
+ try:
+ # Find purchase order by ID
+ api_response = api_instance.get_order_by_id(order_id)
+ print("The response of StoreApi->get_order_by_id:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->get_order_by_id: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order_id** | **int**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid ID supplied | - |
+**404** | Order not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **place_order**
+> Order place_order(order)
+
+Place an order for a pet
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.order import Order
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.StoreApi(api_client)
+ order = petstore_api.Order() # Order | order placed for purchasing the pet
+
+ try:
+ # Place an order for a pet
+ api_response = api_instance.place_order(order)
+ print("The response of StoreApi->place_order:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling StoreApi->place_order: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid Order | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Tag.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Tag.md
new file mode 100644
index 00000000000..4106d9cfe5d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Tag.md
@@ -0,0 +1,30 @@
+# Tag
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.tag import Tag
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Tag from a JSON string
+tag_instance = Tag.from_json(json)
+# print the JSON string representation of the object
+print(Tag.to_json())
+
+# convert the object into a dict
+tag_dict = tag_instance.to_dict()
+# create an instance of Tag from a dict
+tag_from_dict = Tag.from_dict(tag_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Task.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Task.md
new file mode 100644
index 00000000000..211ce76cdfe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Task.md
@@ -0,0 +1,31 @@
+# Task
+
+Used to test oneOf enums with only one string value.
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **str** | |
+**activity** | [**TaskActivity**](TaskActivity.md) | |
+
+## Example
+
+```python
+from petstore_api.models.task import Task
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Task from a JSON string
+task_instance = Task.from_json(json)
+# print the JSON string representation of the object
+print(Task.to_json())
+
+# convert the object into a dict
+task_dict = task_instance.to_dict()
+# create an instance of Task from a dict
+task_from_dict = Task.from_dict(task_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TaskActivity.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TaskActivity.md
new file mode 100644
index 00000000000..e905a477292
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TaskActivity.md
@@ -0,0 +1,31 @@
+# TaskActivity
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**task_name** | **str** | |
+**function_name** | **str** | |
+**content** | **str** | |
+
+## Example
+
+```python
+from petstore_api.models.task_activity import TaskActivity
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TaskActivity from a JSON string
+task_activity_instance = TaskActivity.from_json(json)
+# print the JSON string representation of the object
+print(TaskActivity.to_json())
+
+# convert the object into a dict
+task_activity_dict = task_activity_instance.to_dict()
+# create an instance of TaskActivity from a dict
+task_activity_from_dict = TaskActivity.from_dict(task_activity_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestEnum.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestEnum.md
new file mode 100644
index 00000000000..612b62bd4dc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestEnum.md
@@ -0,0 +1,16 @@
+# TestEnum
+
+
+## Enum
+
+* `ONE` (value: `'ONE'`)
+
+* `TWO` (value: `'TWO'`)
+
+* `THREE` (value: `'THREE'`)
+
+* `FOUR` (value: `'foUr'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestEnumWithDefault.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestEnumWithDefault.md
new file mode 100644
index 00000000000..ac8591c95c0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestEnumWithDefault.md
@@ -0,0 +1,14 @@
+# TestEnumWithDefault
+
+
+## Enum
+
+* `EIN` (value: `'EIN'`)
+
+* `ZWEI` (value: `'ZWEI'`)
+
+* `DREI` (value: `'DREI'`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestErrorResponsesWithModel400Response.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestErrorResponsesWithModel400Response.md
new file mode 100644
index 00000000000..be416bbad0f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestErrorResponsesWithModel400Response.md
@@ -0,0 +1,29 @@
+# TestErrorResponsesWithModel400Response
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**reason400** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TestErrorResponsesWithModel400Response from a JSON string
+test_error_responses_with_model400_response_instance = TestErrorResponsesWithModel400Response.from_json(json)
+# print the JSON string representation of the object
+print(TestErrorResponsesWithModel400Response.to_json())
+
+# convert the object into a dict
+test_error_responses_with_model400_response_dict = test_error_responses_with_model400_response_instance.to_dict()
+# create an instance of TestErrorResponsesWithModel400Response from a dict
+test_error_responses_with_model400_response_from_dict = TestErrorResponsesWithModel400Response.from_dict(test_error_responses_with_model400_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestErrorResponsesWithModel404Response.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestErrorResponsesWithModel404Response.md
new file mode 100644
index 00000000000..1c984f847bf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestErrorResponsesWithModel404Response.md
@@ -0,0 +1,29 @@
+# TestErrorResponsesWithModel404Response
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**reason404** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TestErrorResponsesWithModel404Response from a JSON string
+test_error_responses_with_model404_response_instance = TestErrorResponsesWithModel404Response.from_json(json)
+# print the JSON string representation of the object
+print(TestErrorResponsesWithModel404Response.to_json())
+
+# convert the object into a dict
+test_error_responses_with_model404_response_dict = test_error_responses_with_model404_response_instance.to_dict()
+# create an instance of TestErrorResponsesWithModel404Response from a dict
+test_error_responses_with_model404_response_from_dict = TestErrorResponsesWithModel404Response.from_dict(test_error_responses_with_model404_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestInlineFreeformAdditionalPropertiesRequest.md
new file mode 100644
index 00000000000..511132d689b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestInlineFreeformAdditionalPropertiesRequest.md
@@ -0,0 +1,29 @@
+# TestInlineFreeformAdditionalPropertiesRequest
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**some_property** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string
+test_inline_freeform_additional_properties_request_instance = TestInlineFreeformAdditionalPropertiesRequest.from_json(json)
+# print the JSON string representation of the object
+print(TestInlineFreeformAdditionalPropertiesRequest.to_json())
+
+# convert the object into a dict
+test_inline_freeform_additional_properties_request_dict = test_inline_freeform_additional_properties_request_instance.to_dict()
+# create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict
+test_inline_freeform_additional_properties_request_from_dict = TestInlineFreeformAdditionalPropertiesRequest.from_dict(test_inline_freeform_additional_properties_request_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestModelWithEnumDefault.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestModelWithEnumDefault.md
new file mode 100644
index 00000000000..7d46e86deba
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestModelWithEnumDefault.md
@@ -0,0 +1,33 @@
+# TestModelWithEnumDefault
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**test_enum** | [**TestEnum**](TestEnum.md) | |
+**test_string** | **str** | | [optional]
+**test_enum_with_default** | [**TestEnumWithDefault**](TestEnumWithDefault.md) | | [optional] [default to TestEnumWithDefault.ZWEI]
+**test_string_with_default** | **str** | | [optional] [default to 'ahoy matey']
+**test_inline_defined_enum_with_default** | **str** | | [optional] [default to 'B']
+
+## Example
+
+```python
+from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TestModelWithEnumDefault from a JSON string
+test_model_with_enum_default_instance = TestModelWithEnumDefault.from_json(json)
+# print the JSON string representation of the object
+print(TestModelWithEnumDefault.to_json())
+
+# convert the object into a dict
+test_model_with_enum_default_dict = test_model_with_enum_default_instance.to_dict()
+# create an instance of TestModelWithEnumDefault from a dict
+test_model_with_enum_default_from_dict = TestModelWithEnumDefault.from_dict(test_model_with_enum_default_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/TestObjectForMultipartRequestsRequestMarker.md b/samples/openapi3/client/petstore/python-lazyImports/docs/TestObjectForMultipartRequestsRequestMarker.md
new file mode 100644
index 00000000000..ff0ca9ee00a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/TestObjectForMultipartRequestsRequestMarker.md
@@ -0,0 +1,29 @@
+# TestObjectForMultipartRequestsRequestMarker
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TestObjectForMultipartRequestsRequestMarker from a JSON string
+test_object_for_multipart_requests_request_marker_instance = TestObjectForMultipartRequestsRequestMarker.from_json(json)
+# print the JSON string representation of the object
+print(TestObjectForMultipartRequestsRequestMarker.to_json())
+
+# convert the object into a dict
+test_object_for_multipart_requests_request_marker_dict = test_object_for_multipart_requests_request_marker_instance.to_dict()
+# create an instance of TestObjectForMultipartRequestsRequestMarker from a dict
+test_object_for_multipart_requests_request_marker_from_dict = TestObjectForMultipartRequestsRequestMarker.from_dict(test_object_for_multipart_requests_request_marker_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Tiger.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Tiger.md
new file mode 100644
index 00000000000..f1cf2133f0f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Tiger.md
@@ -0,0 +1,29 @@
+# Tiger
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**skill** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.tiger import Tiger
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Tiger from a JSON string
+tiger_instance = Tiger.from_json(json)
+# print the JSON string representation of the object
+print(Tiger.to_json())
+
+# convert the object into a dict
+tiger_dict = tiger_instance.to_dict()
+# create an instance of Tiger from a dict
+tiger_from_dict = Tiger.from_dict(tiger_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/Type.md b/samples/openapi3/client/petstore/python-lazyImports/docs/Type.md
new file mode 100644
index 00000000000..f7ff2903a72
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/Type.md
@@ -0,0 +1,16 @@
+# Type
+
+
+## Enum
+
+* `NUMBER_2_DOT_0` (value: `2.0`)
+
+* `NUMBER_1_DOT_0` (value: `1.0`)
+
+* `NUMBER_0_DOT_5` (value: `0.5`)
+
+* `NUMBER_0_DOT_25` (value: `0.25`)
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/UnnamedDictWithAdditionalModelListProperties.md b/samples/openapi3/client/petstore/python-lazyImports/docs/UnnamedDictWithAdditionalModelListProperties.md
new file mode 100644
index 00000000000..68cd00ab0a7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/UnnamedDictWithAdditionalModelListProperties.md
@@ -0,0 +1,29 @@
+# UnnamedDictWithAdditionalModelListProperties
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**dict_property** | **Dict[str, List[CreatureInfo]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UnnamedDictWithAdditionalModelListProperties from a JSON string
+unnamed_dict_with_additional_model_list_properties_instance = UnnamedDictWithAdditionalModelListProperties.from_json(json)
+# print the JSON string representation of the object
+print(UnnamedDictWithAdditionalModelListProperties.to_json())
+
+# convert the object into a dict
+unnamed_dict_with_additional_model_list_properties_dict = unnamed_dict_with_additional_model_list_properties_instance.to_dict()
+# create an instance of UnnamedDictWithAdditionalModelListProperties from a dict
+unnamed_dict_with_additional_model_list_properties_from_dict = UnnamedDictWithAdditionalModelListProperties.from_dict(unnamed_dict_with_additional_model_list_properties_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/UnnamedDictWithAdditionalStringListProperties.md b/samples/openapi3/client/petstore/python-lazyImports/docs/UnnamedDictWithAdditionalStringListProperties.md
new file mode 100644
index 00000000000..045b0e22ad0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/UnnamedDictWithAdditionalStringListProperties.md
@@ -0,0 +1,29 @@
+# UnnamedDictWithAdditionalStringListProperties
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**dict_property** | **Dict[str, List[str]]** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UnnamedDictWithAdditionalStringListProperties from a JSON string
+unnamed_dict_with_additional_string_list_properties_instance = UnnamedDictWithAdditionalStringListProperties.from_json(json)
+# print the JSON string representation of the object
+print(UnnamedDictWithAdditionalStringListProperties.to_json())
+
+# convert the object into a dict
+unnamed_dict_with_additional_string_list_properties_dict = unnamed_dict_with_additional_string_list_properties_instance.to_dict()
+# create an instance of UnnamedDictWithAdditionalStringListProperties from a dict
+unnamed_dict_with_additional_string_list_properties_from_dict = UnnamedDictWithAdditionalStringListProperties.from_dict(unnamed_dict_with_additional_string_list_properties_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/UploadFileWithAdditionalPropertiesRequestObject.md b/samples/openapi3/client/petstore/python-lazyImports/docs/UploadFileWithAdditionalPropertiesRequestObject.md
new file mode 100644
index 00000000000..14102778037
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/UploadFileWithAdditionalPropertiesRequestObject.md
@@ -0,0 +1,30 @@
+# UploadFileWithAdditionalPropertiesRequestObject
+
+Additional object
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **str** | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of UploadFileWithAdditionalPropertiesRequestObject from a JSON string
+upload_file_with_additional_properties_request_object_instance = UploadFileWithAdditionalPropertiesRequestObject.from_json(json)
+# print the JSON string representation of the object
+print(UploadFileWithAdditionalPropertiesRequestObject.to_json())
+
+# convert the object into a dict
+upload_file_with_additional_properties_request_object_dict = upload_file_with_additional_properties_request_object_instance.to_dict()
+# create an instance of UploadFileWithAdditionalPropertiesRequestObject from a dict
+upload_file_with_additional_properties_request_object_from_dict = UploadFileWithAdditionalPropertiesRequestObject.from_dict(upload_file_with_additional_properties_request_object_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/User.md b/samples/openapi3/client/petstore/python-lazyImports/docs/User.md
new file mode 100644
index 00000000000..c45d26d2704
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/User.md
@@ -0,0 +1,36 @@
+# User
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **int** | | [optional]
+**username** | **str** | | [optional]
+**first_name** | **str** | | [optional]
+**last_name** | **str** | | [optional]
+**email** | **str** | | [optional]
+**password** | **str** | | [optional]
+**phone** | **str** | | [optional]
+**user_status** | **int** | User Status | [optional]
+
+## Example
+
+```python
+from petstore_api.models.user import User
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of User from a JSON string
+user_instance = User.from_json(json)
+# print the JSON string representation of the object
+print(User.to_json())
+
+# convert the object into a dict
+user_dict = user_instance.to_dict()
+# create an instance of User from a dict
+user_from_dict = User.from_dict(user_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/UserApi.md b/samples/openapi3/client/petstore/python-lazyImports/docs/UserApi.md
new file mode 100644
index 00000000000..a1e152924c0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/UserApi.md
@@ -0,0 +1,550 @@
+# petstore_api.UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**create_user**](UserApi.md#create_user) | **POST** /user | Create user
+[**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array
+[**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array
+[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user
+[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name
+[**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system
+[**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session
+[**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user
+
+
+# **create_user**
+> create_user(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.user import User
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = petstore_api.User() # User | Created user object
+
+ try:
+ # Create user
+ api_instance.create_user(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_user: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**User**](User.md)| Created user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **create_users_with_array_input**
+> create_users_with_array_input(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.user import User
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # List[User] | List of user object
+
+ try:
+ # Creates list of users with given input array
+ api_instance.create_users_with_array_input(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List[User]**](User.md)| List of user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **create_users_with_list_input**
+> create_users_with_list_input(user)
+
+Creates list of users with given input array
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.user import User
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ user = [petstore_api.User()] # List[User] | List of user object
+
+ try:
+ # Creates list of users with given input array
+ api_instance.create_users_with_list_input(user)
+ except Exception as e:
+ print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List[User]**](User.md)| List of user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **delete_user**
+> delete_user(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be deleted
+
+ try:
+ # Delete user
+ api_instance.delete_user(username)
+ except Exception as e:
+ print("Exception when calling UserApi->delete_user: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The name that needs to be deleted |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **get_user_by_name**
+> User get_user_by_name(username)
+
+Get user by user name
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.user import User
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing.
+
+ try:
+ # Get user by user name
+ api_response = api_instance.get_user_by_name(username)
+ print("The response of UserApi->get_user_by_name:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling UserApi->get_user_by_name: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | - |
+**400** | Invalid username supplied | - |
+**404** | User not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **login_user**
+> str login_user(username, password)
+
+Logs user into the system
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | The user name for login
+ password = 'password_example' # str | The password for login in clear text
+
+ try:
+ # Logs user into the system
+ api_response = api_instance.login_user(username, password)
+ print("The response of UserApi->login_user:\n")
+ pprint(api_response)
+ except Exception as e:
+ print("Exception when calling UserApi->login_user: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| The user name for login |
+ **password** | **str**| The password for login in clear text |
+
+### Return type
+
+**str**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
|
+**400** | Invalid username/password supplied | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **logout_user**
+> logout_user()
+
+Logs out current logged in user session
+
+
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+
+ try:
+ # Logs out current logged in user session
+ api_instance.logout_user()
+ except Exception as e:
+ print("Exception when calling UserApi->logout_user: %s\n" % e)
+```
+
+
+
+### Parameters
+
+This endpoint does not need any parameter.
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**0** | successful operation | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+# **update_user**
+> update_user(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+
+
+```python
+import petstore_api
+from petstore_api.models.user import User
+from petstore_api.rest import ApiException
+from pprint import pprint
+
+# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
+# See configuration.py for a list of all supported configuration parameters.
+configuration = petstore_api.Configuration(
+ host = "http://petstore.swagger.io:80/v2"
+)
+
+
+# Enter a context with an instance of the API client
+with petstore_api.ApiClient(configuration) as api_client:
+ # Create an instance of the API class
+ api_instance = petstore_api.UserApi(api_client)
+ username = 'username_example' # str | name that need to be deleted
+ user = petstore_api.User() # User | Updated user object
+
+ try:
+ # Updated user
+ api_instance.update_user(username, user)
+ except Exception as e:
+ print("Exception when calling UserApi->update_user: %s\n" % e)
+```
+
+
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **str**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+void (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------|------------------|
+**400** | Invalid user supplied | - |
+**404** | User not found | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/docs/WithNestedOneOf.md b/samples/openapi3/client/petstore/python-lazyImports/docs/WithNestedOneOf.md
new file mode 100644
index 00000000000..e7bbbc28fc2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/docs/WithNestedOneOf.md
@@ -0,0 +1,31 @@
+# WithNestedOneOf
+
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**size** | **int** | | [optional]
+**nested_pig** | [**Pig**](Pig.md) | | [optional]
+**nested_oneof_enum_string** | [**OneOfEnumString**](OneOfEnumString.md) | | [optional]
+
+## Example
+
+```python
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WithNestedOneOf from a JSON string
+with_nested_one_of_instance = WithNestedOneOf.from_json(json)
+# print the JSON string representation of the object
+print(WithNestedOneOf.to_json())
+
+# convert the object into a dict
+with_nested_one_of_dict = with_nested_one_of_instance.to_dict()
+# create an instance of WithNestedOneOf from a dict
+with_nested_one_of_from_dict = WithNestedOneOf.from_dict(with_nested_one_of_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/git_push.sh b/samples/openapi3/client/petstore/python-lazyImports/git_push.sh
new file mode 100644
index 00000000000..f53a75d4fab
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/git_push.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+git_host=$4
+
+if [ "$git_host" = "" ]; then
+ git_host="github.com"
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
+fi
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=$(git remote)
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/__init__.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/__init__.py
new file mode 100644
index 00000000000..5fc37d48819
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/__init__.py
@@ -0,0 +1,438 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+__version__ = "1.0.0"
+
+# Define package exports
+__all__ = [
+ "AnotherFakeApi",
+ "DefaultApi",
+ "FakeApi",
+ "FakeClassnameTags123Api",
+ "ImportTestDatetimeApi",
+ "PetApi",
+ "StoreApi",
+ "UserApi",
+ "ApiResponse",
+ "ApiClient",
+ "Configuration",
+ "OpenApiException",
+ "ApiTypeError",
+ "ApiValueError",
+ "ApiKeyError",
+ "ApiAttributeError",
+ "ApiException",
+ "HttpSigningConfiguration",
+ "AdditionalPropertiesAnyType",
+ "AdditionalPropertiesClass",
+ "AdditionalPropertiesObject",
+ "AdditionalPropertiesWithDescriptionOnly",
+ "AllOfSuperModel",
+ "AllOfWithSingleRef",
+ "Animal",
+ "AnyOfColor",
+ "AnyOfPig",
+ "ArrayOfArrayOfModel",
+ "ArrayOfArrayOfNumberOnly",
+ "ArrayOfNumberOnly",
+ "ArrayTest",
+ "BaseDiscriminator",
+ "BasquePig",
+ "Bathing",
+ "Capitalization",
+ "Cat",
+ "Category",
+ "CircularAllOfRef",
+ "CircularReferenceModel",
+ "ClassModel",
+ "Client",
+ "Color",
+ "Creature",
+ "CreatureInfo",
+ "DanishPig",
+ "DataOutputFormat",
+ "DeprecatedObject",
+ "DiscriminatorAllOfSub",
+ "DiscriminatorAllOfSuper",
+ "Dog",
+ "DummyModel",
+ "EnumArrays",
+ "EnumClass",
+ "EnumNumberVendorExt",
+ "EnumRefWithDefaultValue",
+ "EnumString1",
+ "EnumString2",
+ "EnumStringVendorExt",
+ "EnumTest",
+ "Feeding",
+ "File",
+ "FileSchemaTestClass",
+ "FirstRef",
+ "Foo",
+ "FooGetDefaultResponse",
+ "FormatTest",
+ "HasOnlyReadOnly",
+ "HealthCheckResult",
+ "HuntingDog",
+ "Info",
+ "InnerDictWithProperty",
+ "InputAllOf",
+ "IntOrString",
+ "ListClass",
+ "MapOfArrayOfModel",
+ "MapTest",
+ "MixedPropertiesAndAdditionalPropertiesClass",
+ "Model200Response",
+ "ModelApiResponse",
+ "ModelField",
+ "ModelReturn",
+ "MultiArrays",
+ "Name",
+ "NullableClass",
+ "NullableProperty",
+ "NumberOnly",
+ "ObjectToTestAdditionalProperties",
+ "ObjectWithDeprecatedFields",
+ "OneOfEnumString",
+ "Order",
+ "OuterComposite",
+ "OuterEnum",
+ "OuterEnumDefaultValue",
+ "OuterEnumInteger",
+ "OuterEnumIntegerDefaultValue",
+ "OuterObjectWithEnumProperty",
+ "Parent",
+ "ParentWithOptionalDict",
+ "Pet",
+ "Pig",
+ "PonySizes",
+ "PoopCleaning",
+ "PrimitiveString",
+ "PropertyMap",
+ "PropertyNameCollision",
+ "ReadOnlyFirst",
+ "SecondCircularAllOfRef",
+ "SecondRef",
+ "SelfReferenceModel",
+ "SingleRefType",
+ "SpecialCharacterEnum",
+ "SpecialModelName",
+ "SpecialName",
+ "Tag",
+ "Task",
+ "TaskActivity",
+ "TestEnum",
+ "TestEnumWithDefault",
+ "TestErrorResponsesWithModel400Response",
+ "TestErrorResponsesWithModel404Response",
+ "TestInlineFreeformAdditionalPropertiesRequest",
+ "TestModelWithEnumDefault",
+ "TestObjectForMultipartRequestsRequestMarker",
+ "Tiger",
+ "Type",
+ "UnnamedDictWithAdditionalModelListProperties",
+ "UnnamedDictWithAdditionalStringListProperties",
+ "UploadFileWithAdditionalPropertiesRequestObject",
+ "User",
+ "WithNestedOneOf",
+]
+
+if __import__("typing").TYPE_CHECKING:
+ # import apis into sdk package
+ from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi
+ from petstore_api.api.default_api import DefaultApi as DefaultApi
+ from petstore_api.api.fake_api import FakeApi as FakeApi
+ from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api as FakeClassnameTags123Api
+ from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi as ImportTestDatetimeApi
+ from petstore_api.api.pet_api import PetApi as PetApi
+ from petstore_api.api.store_api import StoreApi as StoreApi
+ from petstore_api.api.user_api import UserApi as UserApi
+
+ # import ApiClient
+ from petstore_api.api_response import ApiResponse as ApiResponse
+ from petstore_api.api_client import ApiClient as ApiClient
+ from petstore_api.configuration import Configuration as Configuration
+ from petstore_api.exceptions import OpenApiException as OpenApiException
+ from petstore_api.exceptions import ApiTypeError as ApiTypeError
+ from petstore_api.exceptions import ApiValueError as ApiValueError
+ from petstore_api.exceptions import ApiKeyError as ApiKeyError
+ from petstore_api.exceptions import ApiAttributeError as ApiAttributeError
+ from petstore_api.exceptions import ApiException as ApiException
+ from petstore_api.signing import HttpSigningConfiguration as HttpSigningConfiguration
+
+ # import models into sdk package
+ from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType as AdditionalPropertiesAnyType
+ from petstore_api.models.additional_properties_class import AdditionalPropertiesClass as AdditionalPropertiesClass
+ from petstore_api.models.additional_properties_object import AdditionalPropertiesObject as AdditionalPropertiesObject
+ from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly as AdditionalPropertiesWithDescriptionOnly
+ from petstore_api.models.all_of_super_model import AllOfSuperModel as AllOfSuperModel
+ from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef as AllOfWithSingleRef
+ from petstore_api.models.animal import Animal as Animal
+ from petstore_api.models.any_of_color import AnyOfColor as AnyOfColor
+ from petstore_api.models.any_of_pig import AnyOfPig as AnyOfPig
+ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel as ArrayOfArrayOfModel
+ from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly as ArrayOfArrayOfNumberOnly
+ from petstore_api.models.array_of_number_only import ArrayOfNumberOnly as ArrayOfNumberOnly
+ from petstore_api.models.array_test import ArrayTest as ArrayTest
+ from petstore_api.models.base_discriminator import BaseDiscriminator as BaseDiscriminator
+ from petstore_api.models.basque_pig import BasquePig as BasquePig
+ from petstore_api.models.bathing import Bathing as Bathing
+ from petstore_api.models.capitalization import Capitalization as Capitalization
+ from petstore_api.models.cat import Cat as Cat
+ from petstore_api.models.category import Category as Category
+ from petstore_api.models.circular_all_of_ref import CircularAllOfRef as CircularAllOfRef
+ from petstore_api.models.circular_reference_model import CircularReferenceModel as CircularReferenceModel
+ from petstore_api.models.class_model import ClassModel as ClassModel
+ from petstore_api.models.client import Client as Client
+ from petstore_api.models.color import Color as Color
+ from petstore_api.models.creature import Creature as Creature
+ from petstore_api.models.creature_info import CreatureInfo as CreatureInfo
+ from petstore_api.models.danish_pig import DanishPig as DanishPig
+ from petstore_api.models.data_output_format import DataOutputFormat as DataOutputFormat
+ from petstore_api.models.deprecated_object import DeprecatedObject as DeprecatedObject
+ from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub as DiscriminatorAllOfSub
+ from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper as DiscriminatorAllOfSuper
+ from petstore_api.models.dog import Dog as Dog
+ from petstore_api.models.dummy_model import DummyModel as DummyModel
+ from petstore_api.models.enum_arrays import EnumArrays as EnumArrays
+ from petstore_api.models.enum_class import EnumClass as EnumClass
+ from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt as EnumNumberVendorExt
+ from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue as EnumRefWithDefaultValue
+ from petstore_api.models.enum_string1 import EnumString1 as EnumString1
+ from petstore_api.models.enum_string2 import EnumString2 as EnumString2
+ from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt as EnumStringVendorExt
+ from petstore_api.models.enum_test import EnumTest as EnumTest
+ from petstore_api.models.feeding import Feeding as Feeding
+ from petstore_api.models.file import File as File
+ from petstore_api.models.file_schema_test_class import FileSchemaTestClass as FileSchemaTestClass
+ from petstore_api.models.first_ref import FirstRef as FirstRef
+ from petstore_api.models.foo import Foo as Foo
+ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse as FooGetDefaultResponse
+ from petstore_api.models.format_test import FormatTest as FormatTest
+ from petstore_api.models.has_only_read_only import HasOnlyReadOnly as HasOnlyReadOnly
+ from petstore_api.models.health_check_result import HealthCheckResult as HealthCheckResult
+ from petstore_api.models.hunting_dog import HuntingDog as HuntingDog
+ from petstore_api.models.info import Info as Info
+ from petstore_api.models.inner_dict_with_property import InnerDictWithProperty as InnerDictWithProperty
+ from petstore_api.models.input_all_of import InputAllOf as InputAllOf
+ from petstore_api.models.int_or_string import IntOrString as IntOrString
+ from petstore_api.models.list_class import ListClass as ListClass
+ from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel as MapOfArrayOfModel
+ from petstore_api.models.map_test import MapTest as MapTest
+ from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass as MixedPropertiesAndAdditionalPropertiesClass
+ from petstore_api.models.model200_response import Model200Response as Model200Response
+ from petstore_api.models.model_api_response import ModelApiResponse as ModelApiResponse
+ from petstore_api.models.model_field import ModelField as ModelField
+ from petstore_api.models.model_return import ModelReturn as ModelReturn
+ from petstore_api.models.multi_arrays import MultiArrays as MultiArrays
+ from petstore_api.models.name import Name as Name
+ from petstore_api.models.nullable_class import NullableClass as NullableClass
+ from petstore_api.models.nullable_property import NullableProperty as NullableProperty
+ from petstore_api.models.number_only import NumberOnly as NumberOnly
+ from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties as ObjectToTestAdditionalProperties
+ from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields as ObjectWithDeprecatedFields
+ from petstore_api.models.one_of_enum_string import OneOfEnumString as OneOfEnumString
+ from petstore_api.models.order import Order as Order
+ from petstore_api.models.outer_composite import OuterComposite as OuterComposite
+ from petstore_api.models.outer_enum import OuterEnum as OuterEnum
+ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue as OuterEnumDefaultValue
+ from petstore_api.models.outer_enum_integer import OuterEnumInteger as OuterEnumInteger
+ from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue as OuterEnumIntegerDefaultValue
+ from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty as OuterObjectWithEnumProperty
+ from petstore_api.models.parent import Parent as Parent
+ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict as ParentWithOptionalDict
+ from petstore_api.models.pet import Pet as Pet
+ from petstore_api.models.pig import Pig as Pig
+ from petstore_api.models.pony_sizes import PonySizes as PonySizes
+ from petstore_api.models.poop_cleaning import PoopCleaning as PoopCleaning
+ from petstore_api.models.primitive_string import PrimitiveString as PrimitiveString
+ from petstore_api.models.property_map import PropertyMap as PropertyMap
+ from petstore_api.models.property_name_collision import PropertyNameCollision as PropertyNameCollision
+ from petstore_api.models.read_only_first import ReadOnlyFirst as ReadOnlyFirst
+ from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef as SecondCircularAllOfRef
+ from petstore_api.models.second_ref import SecondRef as SecondRef
+ from petstore_api.models.self_reference_model import SelfReferenceModel as SelfReferenceModel
+ from petstore_api.models.single_ref_type import SingleRefType as SingleRefType
+ from petstore_api.models.special_character_enum import SpecialCharacterEnum as SpecialCharacterEnum
+ from petstore_api.models.special_model_name import SpecialModelName as SpecialModelName
+ from petstore_api.models.special_name import SpecialName as SpecialName
+ from petstore_api.models.tag import Tag as Tag
+ from petstore_api.models.task import Task as Task
+ from petstore_api.models.task_activity import TaskActivity as TaskActivity
+ from petstore_api.models.test_enum import TestEnum as TestEnum
+ from petstore_api.models.test_enum_with_default import TestEnumWithDefault as TestEnumWithDefault
+ from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response as TestErrorResponsesWithModel400Response
+ from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response as TestErrorResponsesWithModel404Response
+ from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest as TestInlineFreeformAdditionalPropertiesRequest
+ from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault as TestModelWithEnumDefault
+ from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker as TestObjectForMultipartRequestsRequestMarker
+ from petstore_api.models.tiger import Tiger as Tiger
+ from petstore_api.models.type import Type as Type
+ from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties as UnnamedDictWithAdditionalModelListProperties
+ from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties as UnnamedDictWithAdditionalStringListProperties
+ from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject as UploadFileWithAdditionalPropertiesRequestObject
+ from petstore_api.models.user import User as User
+ from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf
+
+else:
+ from lazy_imports import LazyModule, as_package, load
+
+ load(
+ LazyModule(
+ *as_package(__file__),
+ ("__version__", __version__),
+ ("__all__", __all__),
+ """# import apis into sdk package
+from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi as DefaultApi
+from petstore_api.api.fake_api import FakeApi as FakeApi
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api as FakeClassnameTags123Api
+from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi as ImportTestDatetimeApi
+from petstore_api.api.pet_api import PetApi as PetApi
+from petstore_api.api.store_api import StoreApi as StoreApi
+from petstore_api.api.user_api import UserApi as UserApi
+
+# import ApiClient
+from petstore_api.api_response import ApiResponse as ApiResponse
+from petstore_api.api_client import ApiClient as ApiClient
+from petstore_api.configuration import Configuration as Configuration
+from petstore_api.exceptions import OpenApiException as OpenApiException
+from petstore_api.exceptions import ApiTypeError as ApiTypeError
+from petstore_api.exceptions import ApiValueError as ApiValueError
+from petstore_api.exceptions import ApiKeyError as ApiKeyError
+from petstore_api.exceptions import ApiAttributeError as ApiAttributeError
+from petstore_api.exceptions import ApiException as ApiException
+from petstore_api.signing import HttpSigningConfiguration as HttpSigningConfiguration
+
+# import models into sdk package
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType as AdditionalPropertiesAnyType
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass as AdditionalPropertiesClass
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject as AdditionalPropertiesObject
+from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly as AdditionalPropertiesWithDescriptionOnly
+from petstore_api.models.all_of_super_model import AllOfSuperModel as AllOfSuperModel
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef as AllOfWithSingleRef
+from petstore_api.models.animal import Animal as Animal
+from petstore_api.models.any_of_color import AnyOfColor as AnyOfColor
+from petstore_api.models.any_of_pig import AnyOfPig as AnyOfPig
+from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel as ArrayOfArrayOfModel
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly as ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly as ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest as ArrayTest
+from petstore_api.models.base_discriminator import BaseDiscriminator as BaseDiscriminator
+from petstore_api.models.basque_pig import BasquePig as BasquePig
+from petstore_api.models.bathing import Bathing as Bathing
+from petstore_api.models.capitalization import Capitalization as Capitalization
+from petstore_api.models.cat import Cat as Cat
+from petstore_api.models.category import Category as Category
+from petstore_api.models.circular_all_of_ref import CircularAllOfRef as CircularAllOfRef
+from petstore_api.models.circular_reference_model import CircularReferenceModel as CircularReferenceModel
+from petstore_api.models.class_model import ClassModel as ClassModel
+from petstore_api.models.client import Client as Client
+from petstore_api.models.color import Color as Color
+from petstore_api.models.creature import Creature as Creature
+from petstore_api.models.creature_info import CreatureInfo as CreatureInfo
+from petstore_api.models.danish_pig import DanishPig as DanishPig
+from petstore_api.models.data_output_format import DataOutputFormat as DataOutputFormat
+from petstore_api.models.deprecated_object import DeprecatedObject as DeprecatedObject
+from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub as DiscriminatorAllOfSub
+from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper as DiscriminatorAllOfSuper
+from petstore_api.models.dog import Dog as Dog
+from petstore_api.models.dummy_model import DummyModel as DummyModel
+from petstore_api.models.enum_arrays import EnumArrays as EnumArrays
+from petstore_api.models.enum_class import EnumClass as EnumClass
+from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt as EnumNumberVendorExt
+from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue as EnumRefWithDefaultValue
+from petstore_api.models.enum_string1 import EnumString1 as EnumString1
+from petstore_api.models.enum_string2 import EnumString2 as EnumString2
+from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt as EnumStringVendorExt
+from petstore_api.models.enum_test import EnumTest as EnumTest
+from petstore_api.models.feeding import Feeding as Feeding
+from petstore_api.models.file import File as File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass as FileSchemaTestClass
+from petstore_api.models.first_ref import FirstRef as FirstRef
+from petstore_api.models.foo import Foo as Foo
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse as FooGetDefaultResponse
+from petstore_api.models.format_test import FormatTest as FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly as HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult as HealthCheckResult
+from petstore_api.models.hunting_dog import HuntingDog as HuntingDog
+from petstore_api.models.info import Info as Info
+from petstore_api.models.inner_dict_with_property import InnerDictWithProperty as InnerDictWithProperty
+from petstore_api.models.input_all_of import InputAllOf as InputAllOf
+from petstore_api.models.int_or_string import IntOrString as IntOrString
+from petstore_api.models.list_class import ListClass as ListClass
+from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel as MapOfArrayOfModel
+from petstore_api.models.map_test import MapTest as MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass as MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response as Model200Response
+from petstore_api.models.model_api_response import ModelApiResponse as ModelApiResponse
+from petstore_api.models.model_field import ModelField as ModelField
+from petstore_api.models.model_return import ModelReturn as ModelReturn
+from petstore_api.models.multi_arrays import MultiArrays as MultiArrays
+from petstore_api.models.name import Name as Name
+from petstore_api.models.nullable_class import NullableClass as NullableClass
+from petstore_api.models.nullable_property import NullableProperty as NullableProperty
+from petstore_api.models.number_only import NumberOnly as NumberOnly
+from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties as ObjectToTestAdditionalProperties
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields as ObjectWithDeprecatedFields
+from petstore_api.models.one_of_enum_string import OneOfEnumString as OneOfEnumString
+from petstore_api.models.order import Order as Order
+from petstore_api.models.outer_composite import OuterComposite as OuterComposite
+from petstore_api.models.outer_enum import OuterEnum as OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue as OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger as OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue as OuterEnumIntegerDefaultValue
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty as OuterObjectWithEnumProperty
+from petstore_api.models.parent import Parent as Parent
+from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict as ParentWithOptionalDict
+from petstore_api.models.pet import Pet as Pet
+from petstore_api.models.pig import Pig as Pig
+from petstore_api.models.pony_sizes import PonySizes as PonySizes
+from petstore_api.models.poop_cleaning import PoopCleaning as PoopCleaning
+from petstore_api.models.primitive_string import PrimitiveString as PrimitiveString
+from petstore_api.models.property_map import PropertyMap as PropertyMap
+from petstore_api.models.property_name_collision import PropertyNameCollision as PropertyNameCollision
+from petstore_api.models.read_only_first import ReadOnlyFirst as ReadOnlyFirst
+from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef as SecondCircularAllOfRef
+from petstore_api.models.second_ref import SecondRef as SecondRef
+from petstore_api.models.self_reference_model import SelfReferenceModel as SelfReferenceModel
+from petstore_api.models.single_ref_type import SingleRefType as SingleRefType
+from petstore_api.models.special_character_enum import SpecialCharacterEnum as SpecialCharacterEnum
+from petstore_api.models.special_model_name import SpecialModelName as SpecialModelName
+from petstore_api.models.special_name import SpecialName as SpecialName
+from petstore_api.models.tag import Tag as Tag
+from petstore_api.models.task import Task as Task
+from petstore_api.models.task_activity import TaskActivity as TaskActivity
+from petstore_api.models.test_enum import TestEnum as TestEnum
+from petstore_api.models.test_enum_with_default import TestEnumWithDefault as TestEnumWithDefault
+from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response as TestErrorResponsesWithModel400Response
+from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response as TestErrorResponsesWithModel404Response
+from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest as TestInlineFreeformAdditionalPropertiesRequest
+from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault as TestModelWithEnumDefault
+from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker as TestObjectForMultipartRequestsRequestMarker
+from petstore_api.models.tiger import Tiger as Tiger
+from petstore_api.models.type import Type as Type
+from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties as UnnamedDictWithAdditionalModelListProperties
+from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties as UnnamedDictWithAdditionalStringListProperties
+from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject as UploadFileWithAdditionalPropertiesRequestObject
+from petstore_api.models.user import User as User
+from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf
+
+""",
+ name=__name__,
+ doc=__doc__,
+ )
+ )
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/__init__.py
new file mode 100644
index 00000000000..e77aed00eb5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/__init__.py
@@ -0,0 +1,34 @@
+# flake8: noqa
+
+if __import__("typing").TYPE_CHECKING:
+ # import apis into api package
+ from petstore_api.api.another_fake_api import AnotherFakeApi
+ from petstore_api.api.default_api import DefaultApi
+ from petstore_api.api.fake_api import FakeApi
+ from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+ from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi
+ from petstore_api.api.pet_api import PetApi
+ from petstore_api.api.store_api import StoreApi
+ from petstore_api.api.user_api import UserApi
+
+else:
+ from lazy_imports import LazyModule, as_package, load
+
+ load(
+ LazyModule(
+ *as_package(__file__),
+ """# import apis into api package
+from petstore_api.api.another_fake_api import AnotherFakeApi
+from petstore_api.api.default_api import DefaultApi
+from petstore_api.api.fake_api import FakeApi
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi
+from petstore_api.api.pet_api import PetApi
+from petstore_api.api.store_api import StoreApi
+from petstore_api.api.user_api import UserApi
+
+""",
+ name=__name__,
+ doc=__doc__,
+ )
+ )
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/another_fake_api.py
new file mode 100644
index 00000000000..07328c8975e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/another_fake_api.py
@@ -0,0 +1,311 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field
+from typing_extensions import Annotated
+from petstore_api.models.client import Client
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class AnotherFakeApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def call_123_test_special_tags(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Client:
+ """To test special tags
+
+ To test special tags and operation ID starting with number
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._call_123_test_special_tags_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def call_123_test_special_tags_with_http_info(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Client]:
+ """To test special tags
+
+ To test special tags and operation ID starting with number
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._call_123_test_special_tags_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def call_123_test_special_tags_without_preload_content(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """To test special tags
+
+ To test special tags and operation ID starting with number
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._call_123_test_special_tags_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _call_123_test_special_tags_serialize(
+ self,
+ client,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if client is not None:
+ _body_params = client
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PATCH',
+ resource_path='/another-fake/dummy',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/default_api.py
new file mode 100644
index 00000000000..3be576102f9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/default_api.py
@@ -0,0 +1,275 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class DefaultApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def foo_get(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> FooGetDefaultResponse:
+ """foo_get
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._foo_get_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def foo_get_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[FooGetDefaultResponse]:
+ """foo_get
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._foo_get_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def foo_get_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """foo_get
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._foo_get_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _foo_get_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/foo',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/fake_api.py
new file mode 100644
index 00000000000..c3eb9df6439
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/fake_api.py
@@ -0,0 +1,10120 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from datetime import date, datetime
+from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+from uuid import UUID
+from petstore_api.models.client import Client
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.model_api_response import ModelApiResponse
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.pet import Pet
+from petstore_api.models.tag import Tag
+from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
+from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
+from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
+from petstore_api.models.user import User
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class FakeApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def fake_any_type_request_body(
+ self,
+ body: Optional[Dict[str, Any]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test any type request body
+
+
+ :param body:
+ :type body: object
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_any_type_request_body_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_any_type_request_body_with_http_info(
+ self,
+ body: Optional[Dict[str, Any]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test any type request body
+
+
+ :param body:
+ :type body: object
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_any_type_request_body_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_any_type_request_body_without_preload_content(
+ self,
+ body: Optional[Dict[str, Any]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test any type request body
+
+
+ :param body:
+ :type body: object
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_any_type_request_body_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_any_type_request_body_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/any_type_body',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_enum_ref_query_parameter(
+ self,
+ enum_ref: Annotated[Optional[EnumClass], Field(description="enum reference")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test enum reference query parameter
+
+
+ :param enum_ref: enum reference
+ :type enum_ref: EnumClass
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_enum_ref_query_parameter_serialize(
+ enum_ref=enum_ref,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_enum_ref_query_parameter_with_http_info(
+ self,
+ enum_ref: Annotated[Optional[EnumClass], Field(description="enum reference")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test enum reference query parameter
+
+
+ :param enum_ref: enum reference
+ :type enum_ref: EnumClass
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_enum_ref_query_parameter_serialize(
+ enum_ref=enum_ref,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_enum_ref_query_parameter_without_preload_content(
+ self,
+ enum_ref: Annotated[Optional[EnumClass], Field(description="enum reference")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test enum reference query parameter
+
+
+ :param enum_ref: enum reference
+ :type enum_ref: EnumClass
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_enum_ref_query_parameter_serialize(
+ enum_ref=enum_ref,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_enum_ref_query_parameter_serialize(
+ self,
+ enum_ref,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if enum_ref is not None:
+
+ _query_params.append(('enum_ref', enum_ref.value))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/enum_ref_query_parameter',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_health_get(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> HealthCheckResult:
+ """Health check endpoint
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_health_get_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "HealthCheckResult",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_health_get_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[HealthCheckResult]:
+ """Health check endpoint
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_health_get_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "HealthCheckResult",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_health_get_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Health check endpoint
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_health_get_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "HealthCheckResult",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_health_get_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/health',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_http_signature_test(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ query_1: Annotated[Optional[StrictStr], Field(description="query parameter")] = None,
+ header_1: Annotated[Optional[StrictStr], Field(description="header parameter")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test http signature authentication
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_http_signature_test_serialize(
+ pet=pet,
+ query_1=query_1,
+ header_1=header_1,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_http_signature_test_with_http_info(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ query_1: Annotated[Optional[StrictStr], Field(description="query parameter")] = None,
+ header_1: Annotated[Optional[StrictStr], Field(description="header parameter")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test http signature authentication
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_http_signature_test_serialize(
+ pet=pet,
+ query_1=query_1,
+ header_1=header_1,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_http_signature_test_without_preload_content(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ query_1: Annotated[Optional[StrictStr], Field(description="query parameter")] = None,
+ header_1: Annotated[Optional[StrictStr], Field(description="header parameter")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test http signature authentication
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param query_1: query parameter
+ :type query_1: str
+ :param header_1: header parameter
+ :type header_1: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_http_signature_test_serialize(
+ pet=pet,
+ query_1=query_1,
+ header_1=header_1,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_http_signature_test_serialize(
+ self,
+ pet,
+ query_1,
+ header_1,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if query_1 is not None:
+
+ _query_params.append(('query_1', query_1))
+
+ # process the header parameters
+ if header_1 is not None:
+ _header_params['header_1'] = header_1
+ # process the form parameters
+ # process the body parameter
+ if pet is not None:
+ _body_params = pet
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json',
+ 'application/xml'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'http_signature_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/http-signature-test',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_outer_boolean_serialize(
+ self,
+ body: Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bool:
+ """fake_outer_boolean_serialize
+
+ Test serialization of outer boolean types
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_boolean_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bool",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_outer_boolean_serialize_with_http_info(
+ self,
+ body: Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bool]:
+ """fake_outer_boolean_serialize
+
+ Test serialization of outer boolean types
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_boolean_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bool",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_outer_boolean_serialize_without_preload_content(
+ self,
+ body: Annotated[Optional[StrictBool], Field(description="Input boolean as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """fake_outer_boolean_serialize
+
+ Test serialization of outer boolean types
+
+ :param body: Input boolean as post body
+ :type body: bool
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_boolean_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bool",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_outer_boolean_serialize_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ '*/*'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/outer/boolean',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_outer_composite_serialize(
+ self,
+ outer_composite: Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> OuterComposite:
+ """fake_outer_composite_serialize
+
+ Test serialization of object with outer number type
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_composite_serialize_serialize(
+ outer_composite=outer_composite,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "OuterComposite",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_outer_composite_serialize_with_http_info(
+ self,
+ outer_composite: Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[OuterComposite]:
+ """fake_outer_composite_serialize
+
+ Test serialization of object with outer number type
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_composite_serialize_serialize(
+ outer_composite=outer_composite,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "OuterComposite",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_outer_composite_serialize_without_preload_content(
+ self,
+ outer_composite: Annotated[Optional[OuterComposite], Field(description="Input composite as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """fake_outer_composite_serialize
+
+ Test serialization of object with outer number type
+
+ :param outer_composite: Input composite as post body
+ :type outer_composite: OuterComposite
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_composite_serialize_serialize(
+ outer_composite=outer_composite,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "OuterComposite",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_outer_composite_serialize_serialize(
+ self,
+ outer_composite,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if outer_composite is not None:
+ _body_params = outer_composite
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ '*/*'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/outer/composite',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_outer_number_serialize(
+ self,
+ body: Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> float:
+ """fake_outer_number_serialize
+
+ Test serialization of outer number types
+
+ :param body: Input number as post body
+ :type body: float
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_number_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "float",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_outer_number_serialize_with_http_info(
+ self,
+ body: Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[float]:
+ """fake_outer_number_serialize
+
+ Test serialization of outer number types
+
+ :param body: Input number as post body
+ :type body: float
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_number_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "float",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_outer_number_serialize_without_preload_content(
+ self,
+ body: Annotated[Optional[StrictFloat], Field(description="Input number as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """fake_outer_number_serialize
+
+ Test serialization of outer number types
+
+ :param body: Input number as post body
+ :type body: float
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_number_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "float",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_outer_number_serialize_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ '*/*'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/outer/number',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_outer_string_serialize(
+ self,
+ body: Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> str:
+ """fake_outer_string_serialize
+
+ Test serialization of outer string types
+
+ :param body: Input string as post body
+ :type body: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_string_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_outer_string_serialize_with_http_info(
+ self,
+ body: Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[str]:
+ """fake_outer_string_serialize
+
+ Test serialization of outer string types
+
+ :param body: Input string as post body
+ :type body: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_string_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_outer_string_serialize_without_preload_content(
+ self,
+ body: Annotated[Optional[StrictStr], Field(description="Input string as post body")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """fake_outer_string_serialize
+
+ Test serialization of outer string types
+
+ :param body: Input string as post body
+ :type body: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_outer_string_serialize_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_outer_string_serialize_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ _body_params = body
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ '*/*'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/outer/string',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_property_enum_integer_serialize(
+ self,
+ outer_object_with_enum_property: Annotated[OuterObjectWithEnumProperty, Field(description="Input enum (int) as post body")],
+ param: Optional[List[OuterEnumInteger]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> OuterObjectWithEnumProperty:
+ """fake_property_enum_integer_serialize
+
+ Test serialization of enum (int) properties with examples
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param param:
+ :type param: List[OuterEnumInteger]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_property_enum_integer_serialize_serialize(
+ outer_object_with_enum_property=outer_object_with_enum_property,
+ param=param,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "OuterObjectWithEnumProperty",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_property_enum_integer_serialize_with_http_info(
+ self,
+ outer_object_with_enum_property: Annotated[OuterObjectWithEnumProperty, Field(description="Input enum (int) as post body")],
+ param: Optional[List[OuterEnumInteger]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[OuterObjectWithEnumProperty]:
+ """fake_property_enum_integer_serialize
+
+ Test serialization of enum (int) properties with examples
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param param:
+ :type param: List[OuterEnumInteger]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_property_enum_integer_serialize_serialize(
+ outer_object_with_enum_property=outer_object_with_enum_property,
+ param=param,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "OuterObjectWithEnumProperty",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_property_enum_integer_serialize_without_preload_content(
+ self,
+ outer_object_with_enum_property: Annotated[OuterObjectWithEnumProperty, Field(description="Input enum (int) as post body")],
+ param: Optional[List[OuterEnumInteger]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """fake_property_enum_integer_serialize
+
+ Test serialization of enum (int) properties with examples
+
+ :param outer_object_with_enum_property: Input enum (int) as post body (required)
+ :type outer_object_with_enum_property: OuterObjectWithEnumProperty
+ :param param:
+ :type param: List[OuterEnumInteger]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_property_enum_integer_serialize_serialize(
+ outer_object_with_enum_property=outer_object_with_enum_property,
+ param=param,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "OuterObjectWithEnumProperty",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_property_enum_integer_serialize_serialize(
+ self,
+ outer_object_with_enum_property,
+ param,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'param': 'multi',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if param is not None:
+
+ _query_params.append(('param', param))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if outer_object_with_enum_property is not None:
+ _body_params = outer_object_with_enum_property
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ '*/*'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/property/enum-int',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_ref_enum_string(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> EnumClass:
+ """test ref to enum string
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_ref_enum_string_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "EnumClass",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_ref_enum_string_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[EnumClass]:
+ """test ref to enum string
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_ref_enum_string_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "EnumClass",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_ref_enum_string_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test ref to enum string
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_ref_enum_string_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "EnumClass",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_ref_enum_string_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'plain/text'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/ref_enum_string',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_boolean(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bool:
+ """test returning boolean
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_boolean_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bool",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_boolean_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bool]:
+ """test returning boolean
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_boolean_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bool",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_boolean_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test returning boolean
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_boolean_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bool",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_boolean_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_boolean',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_byte_like_json(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> bytearray:
+ """test byte like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_byte_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_byte_like_json_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[bytearray]:
+ """test byte like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_byte_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_byte_like_json_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test byte like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_byte_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "bytearray",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_byte_like_json_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'plain/text'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_byte_like_json',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_enum(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> str:
+ """test returning enum
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_enum_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_enum_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[str]:
+ """test returning enum
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_enum_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_enum_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test returning enum
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_enum_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_enum_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_enum',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_enum_like_json(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> str:
+ """test enum like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_enum_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_enum_like_json_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[str]:
+ """test enum like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_enum_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_enum_like_json_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test enum like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_enum_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_enum_like_json_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'plain/text'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_enum_like_json',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_float(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> float:
+ """test returning float
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_float_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "float",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_float_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[float]:
+ """test returning float
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_float_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "float",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_float_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test returning float
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_float_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "float",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_float_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_float',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_int(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> int:
+ """test returning int
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_int_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "int",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_int_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[int]:
+ """test returning int
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_int_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "int",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_int_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test returning int
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_int_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "int",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_int_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_int',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_list_of_objects(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[List[Tag]]:
+ """test returning list of objects
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_list_of_objects_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[List[Tag]]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_list_of_objects_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[List[Tag]]]:
+ """test returning list of objects
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_list_of_objects_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[List[Tag]]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_list_of_objects_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test returning list of objects
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_list_of_objects_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[List[Tag]]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_list_of_objects_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_list_of_object',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_str_like_json(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> str:
+ """test str like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_str_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_str_like_json_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[str]:
+ """test str like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_str_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_str_like_json_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test str like json
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_str_like_json_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_str_like_json_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'plain/text'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_str_like_json',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_return_string(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> str:
+ """test returning string
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_string_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_return_string_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[str]:
+ """test returning string
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_string_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_return_string_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test returning string
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_return_string_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_return_string_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/return_string',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def fake_uuid_example(
+ self,
+ uuid_example: Annotated[UUID, Field(description="uuid example")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test uuid example
+
+
+ :param uuid_example: uuid example (required)
+ :type uuid_example: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_uuid_example_serialize(
+ uuid_example=uuid_example,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def fake_uuid_example_with_http_info(
+ self,
+ uuid_example: Annotated[UUID, Field(description="uuid example")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test uuid example
+
+
+ :param uuid_example: uuid example (required)
+ :type uuid_example: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_uuid_example_serialize(
+ uuid_example=uuid_example,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def fake_uuid_example_without_preload_content(
+ self,
+ uuid_example: Annotated[UUID, Field(description="uuid example")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test uuid example
+
+
+ :param uuid_example: uuid example (required)
+ :type uuid_example: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._fake_uuid_example_serialize(
+ uuid_example=uuid_example,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _fake_uuid_example_serialize(
+ self,
+ uuid_example,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if uuid_example is not None:
+
+ _query_params.append(('uuid_example', uuid_example))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/uuid_example',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_additional_properties_reference(
+ self,
+ request_body: Annotated[Dict[str, Any], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test referenced additionalProperties
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, object]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_additional_properties_reference_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_additional_properties_reference_with_http_info(
+ self,
+ request_body: Annotated[Dict[str, Any], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test referenced additionalProperties
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, object]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_additional_properties_reference_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_additional_properties_reference_without_preload_content(
+ self,
+ request_body: Annotated[Dict[str, Any], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test referenced additionalProperties
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, object]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_additional_properties_reference_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_additional_properties_reference_serialize(
+ self,
+ request_body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if request_body is not None:
+ _body_params = request_body
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/additionalProperties-reference',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_body_with_binary(
+ self,
+ body: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="image to upload")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test_body_with_binary
+
+ For this test, the body has to be a binary file.
+
+ :param body: image to upload (required)
+ :type body: bytearray
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_binary_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_body_with_binary_with_http_info(
+ self,
+ body: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="image to upload")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test_body_with_binary
+
+ For this test, the body has to be a binary file.
+
+ :param body: image to upload (required)
+ :type body: bytearray
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_binary_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_body_with_binary_without_preload_content(
+ self,
+ body: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="image to upload")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test_body_with_binary
+
+ For this test, the body has to be a binary file.
+
+ :param body: image to upload (required)
+ :type body: bytearray
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_binary_serialize(
+ body=body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_body_with_binary_serialize(
+ self,
+ body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if body is not None:
+ # convert to byte array if the input is a file name (str)
+ if isinstance(body, str):
+ with open(body, "rb") as _fp:
+ _body_params = _fp.read()
+ elif isinstance(body, tuple):
+ # drop the filename from the tuple
+ _body_params = body[1]
+ else:
+ _body_params = body
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'image/png'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/fake/body-with-binary',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_body_with_file_schema(
+ self,
+ file_schema_test_class: FileSchemaTestClass,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test_body_with_file_schema
+
+ For this test, the body for this request must reference a schema named `File`.
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_file_schema_serialize(
+ file_schema_test_class=file_schema_test_class,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_body_with_file_schema_with_http_info(
+ self,
+ file_schema_test_class: FileSchemaTestClass,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test_body_with_file_schema
+
+ For this test, the body for this request must reference a schema named `File`.
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_file_schema_serialize(
+ file_schema_test_class=file_schema_test_class,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_body_with_file_schema_without_preload_content(
+ self,
+ file_schema_test_class: FileSchemaTestClass,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test_body_with_file_schema
+
+ For this test, the body for this request must reference a schema named `File`.
+
+ :param file_schema_test_class: (required)
+ :type file_schema_test_class: FileSchemaTestClass
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_file_schema_serialize(
+ file_schema_test_class=file_schema_test_class,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_body_with_file_schema_serialize(
+ self,
+ file_schema_test_class,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if file_schema_test_class is not None:
+ _body_params = file_schema_test_class
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/fake/body-with-file-schema',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_body_with_query_params(
+ self,
+ query: StrictStr,
+ user: User,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test_body_with_query_params
+
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_query_params_serialize(
+ query=query,
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_body_with_query_params_with_http_info(
+ self,
+ query: StrictStr,
+ user: User,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test_body_with_query_params
+
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_query_params_serialize(
+ query=query,
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_body_with_query_params_without_preload_content(
+ self,
+ query: StrictStr,
+ user: User,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test_body_with_query_params
+
+
+ :param query: (required)
+ :type query: str
+ :param user: (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_body_with_query_params_serialize(
+ query=query,
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_body_with_query_params_serialize(
+ self,
+ query,
+ user,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if query is not None:
+
+ _query_params.append(('query', query))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if user is not None:
+ _body_params = user
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/fake/body-with-query-params',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_client_model(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Client:
+ """To test \"client\" model
+
+ To test \"client\" model
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_client_model_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_client_model_with_http_info(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Client]:
+ """To test \"client\" model
+
+ To test \"client\" model
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_client_model_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_client_model_without_preload_content(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """To test \"client\" model
+
+ To test \"client\" model
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_client_model_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_client_model_serialize(
+ self,
+ client,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if client is not None:
+ _body_params = client
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PATCH',
+ resource_path='/fake',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_date_time_query_parameter(
+ self,
+ date_time_query: datetime,
+ str_query: StrictStr,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test_date_time_query_parameter
+
+
+ :param date_time_query: (required)
+ :type date_time_query: datetime
+ :param str_query: (required)
+ :type str_query: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_date_time_query_parameter_serialize(
+ date_time_query=date_time_query,
+ str_query=str_query,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_date_time_query_parameter_with_http_info(
+ self,
+ date_time_query: datetime,
+ str_query: StrictStr,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test_date_time_query_parameter
+
+
+ :param date_time_query: (required)
+ :type date_time_query: datetime
+ :param str_query: (required)
+ :type str_query: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_date_time_query_parameter_serialize(
+ date_time_query=date_time_query,
+ str_query=str_query,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_date_time_query_parameter_without_preload_content(
+ self,
+ date_time_query: datetime,
+ str_query: StrictStr,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test_date_time_query_parameter
+
+
+ :param date_time_query: (required)
+ :type date_time_query: datetime
+ :param str_query: (required)
+ :type str_query: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_date_time_query_parameter_serialize(
+ date_time_query=date_time_query,
+ str_query=str_query,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_date_time_query_parameter_serialize(
+ self,
+ date_time_query,
+ str_query,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if date_time_query is not None:
+ if isinstance(date_time_query, datetime):
+ _query_params.append(
+ (
+ 'date_time_query',
+ date_time_query.strftime(
+ self.api_client.configuration.datetime_format
+ )
+ )
+ )
+ else:
+ _query_params.append(('date_time_query', date_time_query))
+
+ if str_query is not None:
+
+ _query_params.append(('str_query', str_query))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/fake/date-time-query-params',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_empty_and_non_empty_responses(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test empty and non-empty responses
+
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_empty_and_non_empty_responses_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '206': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_empty_and_non_empty_responses_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test empty and non-empty responses
+
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_empty_and_non_empty_responses_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '206': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_empty_and_non_empty_responses_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test empty and non-empty responses
+
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_empty_and_non_empty_responses_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '206': "str",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_empty_and_non_empty_responses_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'text/plain'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/empty_and_non_empty_responses',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_endpoint_parameters(
+ self,
+ number: Annotated[float, Field(le=543.2, strict=True, ge=32.1, description="None")],
+ double: Annotated[float, Field(le=123.4, strict=True, ge=67.8, description="None")],
+ pattern_without_delimiter: Annotated[str, Field(strict=True, description="None")],
+ byte: Annotated[Union[StrictBytes, StrictStr], Field(description="None")],
+ integer: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=10)]], Field(description="None")] = None,
+ int32: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=20)]], Field(description="None")] = None,
+ int64: Annotated[Optional[StrictInt], Field(description="None")] = None,
+ var_float: Annotated[Optional[Annotated[float, Field(le=987.6, strict=True)]], Field(description="None")] = None,
+ string: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="None")] = None,
+ binary: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="None")] = None,
+ byte_with_max_length: Annotated[Optional[Union[Annotated[bytes, Field(strict=True, max_length=64)], Annotated[str, Field(strict=True, max_length=64)]]], Field(description="None")] = None,
+ var_date: Annotated[Optional[date], Field(description="None")] = None,
+ date_time: Annotated[Optional[datetime], Field(description="None")] = None,
+ password: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=64)]], Field(description="None")] = None,
+ param_callback: Annotated[Optional[StrictStr], Field(description="None")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: bytearray
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param var_float: None
+ :type var_float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: bytearray
+ :param byte_with_max_length: None
+ :type byte_with_max_length: bytearray
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_endpoint_parameters_serialize(
+ number=number,
+ double=double,
+ pattern_without_delimiter=pattern_without_delimiter,
+ byte=byte,
+ integer=integer,
+ int32=int32,
+ int64=int64,
+ var_float=var_float,
+ string=string,
+ binary=binary,
+ byte_with_max_length=byte_with_max_length,
+ var_date=var_date,
+ date_time=date_time,
+ password=password,
+ param_callback=param_callback,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_endpoint_parameters_with_http_info(
+ self,
+ number: Annotated[float, Field(le=543.2, strict=True, ge=32.1, description="None")],
+ double: Annotated[float, Field(le=123.4, strict=True, ge=67.8, description="None")],
+ pattern_without_delimiter: Annotated[str, Field(strict=True, description="None")],
+ byte: Annotated[Union[StrictBytes, StrictStr], Field(description="None")],
+ integer: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=10)]], Field(description="None")] = None,
+ int32: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=20)]], Field(description="None")] = None,
+ int64: Annotated[Optional[StrictInt], Field(description="None")] = None,
+ var_float: Annotated[Optional[Annotated[float, Field(le=987.6, strict=True)]], Field(description="None")] = None,
+ string: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="None")] = None,
+ binary: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="None")] = None,
+ byte_with_max_length: Annotated[Optional[Union[Annotated[bytes, Field(strict=True, max_length=64)], Annotated[str, Field(strict=True, max_length=64)]]], Field(description="None")] = None,
+ var_date: Annotated[Optional[date], Field(description="None")] = None,
+ date_time: Annotated[Optional[datetime], Field(description="None")] = None,
+ password: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=64)]], Field(description="None")] = None,
+ param_callback: Annotated[Optional[StrictStr], Field(description="None")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: bytearray
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param var_float: None
+ :type var_float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: bytearray
+ :param byte_with_max_length: None
+ :type byte_with_max_length: bytearray
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_endpoint_parameters_serialize(
+ number=number,
+ double=double,
+ pattern_without_delimiter=pattern_without_delimiter,
+ byte=byte,
+ integer=integer,
+ int32=int32,
+ int64=int64,
+ var_float=var_float,
+ string=string,
+ binary=binary,
+ byte_with_max_length=byte_with_max_length,
+ var_date=var_date,
+ date_time=date_time,
+ password=password,
+ param_callback=param_callback,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_endpoint_parameters_without_preload_content(
+ self,
+ number: Annotated[float, Field(le=543.2, strict=True, ge=32.1, description="None")],
+ double: Annotated[float, Field(le=123.4, strict=True, ge=67.8, description="None")],
+ pattern_without_delimiter: Annotated[str, Field(strict=True, description="None")],
+ byte: Annotated[Union[StrictBytes, StrictStr], Field(description="None")],
+ integer: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=10)]], Field(description="None")] = None,
+ int32: Annotated[Optional[Annotated[int, Field(le=200, strict=True, ge=20)]], Field(description="None")] = None,
+ int64: Annotated[Optional[StrictInt], Field(description="None")] = None,
+ var_float: Annotated[Optional[Annotated[float, Field(le=987.6, strict=True)]], Field(description="None")] = None,
+ string: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="None")] = None,
+ binary: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="None")] = None,
+ byte_with_max_length: Annotated[Optional[Union[Annotated[bytes, Field(strict=True, max_length=64)], Annotated[str, Field(strict=True, max_length=64)]]], Field(description="None")] = None,
+ var_date: Annotated[Optional[date], Field(description="None")] = None,
+ date_time: Annotated[Optional[datetime], Field(description="None")] = None,
+ password: Annotated[Optional[Annotated[str, Field(min_length=10, strict=True, max_length=64)]], Field(description="None")] = None,
+ param_callback: Annotated[Optional[StrictStr], Field(description="None")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+ :param number: None (required)
+ :type number: float
+ :param double: None (required)
+ :type double: float
+ :param pattern_without_delimiter: None (required)
+ :type pattern_without_delimiter: str
+ :param byte: None (required)
+ :type byte: bytearray
+ :param integer: None
+ :type integer: int
+ :param int32: None
+ :type int32: int
+ :param int64: None
+ :type int64: int
+ :param var_float: None
+ :type var_float: float
+ :param string: None
+ :type string: str
+ :param binary: None
+ :type binary: bytearray
+ :param byte_with_max_length: None
+ :type byte_with_max_length: bytearray
+ :param var_date: None
+ :type var_date: date
+ :param date_time: None
+ :type date_time: datetime
+ :param password: None
+ :type password: str
+ :param param_callback: None
+ :type param_callback: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_endpoint_parameters_serialize(
+ number=number,
+ double=double,
+ pattern_without_delimiter=pattern_without_delimiter,
+ byte=byte,
+ integer=integer,
+ int32=int32,
+ int64=int64,
+ var_float=var_float,
+ string=string,
+ binary=binary,
+ byte_with_max_length=byte_with_max_length,
+ var_date=var_date,
+ date_time=date_time,
+ password=password,
+ param_callback=param_callback,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_endpoint_parameters_serialize(
+ self,
+ number,
+ double,
+ pattern_without_delimiter,
+ byte,
+ integer,
+ int32,
+ int64,
+ var_float,
+ string,
+ binary,
+ byte_with_max_length,
+ var_date,
+ date_time,
+ password,
+ param_callback,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if integer is not None:
+ _form_params.append(('integer', integer))
+ if int32 is not None:
+ _form_params.append(('int32', int32))
+ if int64 is not None:
+ _form_params.append(('int64', int64))
+ if number is not None:
+ _form_params.append(('number', number))
+ if var_float is not None:
+ _form_params.append(('float', var_float))
+ if double is not None:
+ _form_params.append(('double', double))
+ if string is not None:
+ _form_params.append(('string', string))
+ if pattern_without_delimiter is not None:
+ _form_params.append(('pattern_without_delimiter', pattern_without_delimiter))
+ if byte is not None:
+ _form_params.append(('byte', byte))
+ if binary is not None:
+ _files['binary'] = binary
+ if byte_with_max_length is not None:
+ _form_params.append(('byte_with_max_length', byte_with_max_length))
+ if var_date is not None:
+ _form_params.append(('date', var_date))
+ if date_time is not None:
+ _form_params.append(('dateTime', date_time))
+ if password is not None:
+ _form_params.append(('password', password))
+ if param_callback is not None:
+ _form_params.append(('callback', param_callback))
+ # process the body parameter
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/x-www-form-urlencoded'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'http_basic_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_error_responses_with_model(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test error responses with model
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_error_responses_with_model_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '400': "TestErrorResponsesWithModel400Response",
+ '404': "TestErrorResponsesWithModel404Response",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_error_responses_with_model_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test error responses with model
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_error_responses_with_model_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '400': "TestErrorResponsesWithModel400Response",
+ '404': "TestErrorResponsesWithModel404Response",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_error_responses_with_model_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test error responses with model
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_error_responses_with_model_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '204': None,
+ '400': "TestErrorResponsesWithModel400Response",
+ '404': "TestErrorResponsesWithModel404Response",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_error_responses_with_model_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/error_responses_with_model',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_group_parameters(
+ self,
+ required_string_group: Annotated[StrictInt, Field(description="Required String in group parameters")],
+ required_boolean_group: Annotated[StrictBool, Field(description="Required Boolean in group parameters")],
+ required_int64_group: Annotated[StrictInt, Field(description="Required Integer in group parameters")],
+ string_group: Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None,
+ boolean_group: Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None,
+ int64_group: Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Fake endpoint to test group parameters (optional)
+
+ Fake endpoint to test group parameters (optional)
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_group_parameters_serialize(
+ required_string_group=required_string_group,
+ required_boolean_group=required_boolean_group,
+ required_int64_group=required_int64_group,
+ string_group=string_group,
+ boolean_group=boolean_group,
+ int64_group=int64_group,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_group_parameters_with_http_info(
+ self,
+ required_string_group: Annotated[StrictInt, Field(description="Required String in group parameters")],
+ required_boolean_group: Annotated[StrictBool, Field(description="Required Boolean in group parameters")],
+ required_int64_group: Annotated[StrictInt, Field(description="Required Integer in group parameters")],
+ string_group: Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None,
+ boolean_group: Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None,
+ int64_group: Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Fake endpoint to test group parameters (optional)
+
+ Fake endpoint to test group parameters (optional)
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_group_parameters_serialize(
+ required_string_group=required_string_group,
+ required_boolean_group=required_boolean_group,
+ required_int64_group=required_int64_group,
+ string_group=string_group,
+ boolean_group=boolean_group,
+ int64_group=int64_group,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_group_parameters_without_preload_content(
+ self,
+ required_string_group: Annotated[StrictInt, Field(description="Required String in group parameters")],
+ required_boolean_group: Annotated[StrictBool, Field(description="Required Boolean in group parameters")],
+ required_int64_group: Annotated[StrictInt, Field(description="Required Integer in group parameters")],
+ string_group: Annotated[Optional[StrictInt], Field(description="String in group parameters")] = None,
+ boolean_group: Annotated[Optional[StrictBool], Field(description="Boolean in group parameters")] = None,
+ int64_group: Annotated[Optional[StrictInt], Field(description="Integer in group parameters")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Fake endpoint to test group parameters (optional)
+
+ Fake endpoint to test group parameters (optional)
+
+ :param required_string_group: Required String in group parameters (required)
+ :type required_string_group: int
+ :param required_boolean_group: Required Boolean in group parameters (required)
+ :type required_boolean_group: bool
+ :param required_int64_group: Required Integer in group parameters (required)
+ :type required_int64_group: int
+ :param string_group: String in group parameters
+ :type string_group: int
+ :param boolean_group: Boolean in group parameters
+ :type boolean_group: bool
+ :param int64_group: Integer in group parameters
+ :type int64_group: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_group_parameters_serialize(
+ required_string_group=required_string_group,
+ required_boolean_group=required_boolean_group,
+ required_int64_group=required_int64_group,
+ string_group=string_group,
+ boolean_group=boolean_group,
+ int64_group=int64_group,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_group_parameters_serialize(
+ self,
+ required_string_group,
+ required_boolean_group,
+ required_int64_group,
+ string_group,
+ boolean_group,
+ int64_group,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if required_string_group is not None:
+
+ _query_params.append(('required_string_group', required_string_group))
+
+ if required_int64_group is not None:
+
+ _query_params.append(('required_int64_group', required_int64_group))
+
+ if string_group is not None:
+
+ _query_params.append(('string_group', string_group))
+
+ if int64_group is not None:
+
+ _query_params.append(('int64_group', int64_group))
+
+ # process the header parameters
+ if required_boolean_group is not None:
+ _header_params['required_boolean_group'] = required_boolean_group
+ if boolean_group is not None:
+ _header_params['boolean_group'] = boolean_group
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'bearer_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/fake',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_inline_additional_properties(
+ self,
+ request_body: Annotated[Dict[str, StrictStr], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test inline additionalProperties
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_inline_additional_properties_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_inline_additional_properties_with_http_info(
+ self,
+ request_body: Annotated[Dict[str, StrictStr], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test inline additionalProperties
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_inline_additional_properties_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_inline_additional_properties_without_preload_content(
+ self,
+ request_body: Annotated[Dict[str, StrictStr], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test inline additionalProperties
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_inline_additional_properties_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_inline_additional_properties_serialize(
+ self,
+ request_body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if request_body is not None:
+ _body_params = request_body
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/inline-additionalProperties',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_inline_freeform_additional_properties(
+ self,
+ test_inline_freeform_additional_properties_request: Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test inline free-form additionalProperties
+
+
+
+ :param test_inline_freeform_additional_properties_request: request body (required)
+ :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_inline_freeform_additional_properties_serialize(
+ test_inline_freeform_additional_properties_request=test_inline_freeform_additional_properties_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_inline_freeform_additional_properties_with_http_info(
+ self,
+ test_inline_freeform_additional_properties_request: Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test inline free-form additionalProperties
+
+
+
+ :param test_inline_freeform_additional_properties_request: request body (required)
+ :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_inline_freeform_additional_properties_serialize(
+ test_inline_freeform_additional_properties_request=test_inline_freeform_additional_properties_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_inline_freeform_additional_properties_without_preload_content(
+ self,
+ test_inline_freeform_additional_properties_request: Annotated[TestInlineFreeformAdditionalPropertiesRequest, Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test inline free-form additionalProperties
+
+
+
+ :param test_inline_freeform_additional_properties_request: request body (required)
+ :type test_inline_freeform_additional_properties_request: TestInlineFreeformAdditionalPropertiesRequest
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_inline_freeform_additional_properties_serialize(
+ test_inline_freeform_additional_properties_request=test_inline_freeform_additional_properties_request,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_inline_freeform_additional_properties_serialize(
+ self,
+ test_inline_freeform_additional_properties_request,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if test_inline_freeform_additional_properties_request is not None:
+ _body_params = test_inline_freeform_additional_properties_request
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/inline-freeform-additionalProperties',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_json_form_data(
+ self,
+ param: Annotated[StrictStr, Field(description="field1")],
+ param2: Annotated[StrictStr, Field(description="field2")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test json serialization of form data
+
+
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_json_form_data_serialize(
+ param=param,
+ param2=param2,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_json_form_data_with_http_info(
+ self,
+ param: Annotated[StrictStr, Field(description="field1")],
+ param2: Annotated[StrictStr, Field(description="field2")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test json serialization of form data
+
+
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_json_form_data_serialize(
+ param=param,
+ param2=param2,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_json_form_data_without_preload_content(
+ self,
+ param: Annotated[StrictStr, Field(description="field1")],
+ param2: Annotated[StrictStr, Field(description="field2")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test json serialization of form data
+
+
+
+ :param param: field1 (required)
+ :type param: str
+ :param param2: field2 (required)
+ :type param2: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_json_form_data_serialize(
+ param=param,
+ param2=param2,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_json_form_data_serialize(
+ self,
+ param,
+ param2,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if param is not None:
+ _form_params.append(('param', param))
+ if param2 is not None:
+ _form_params.append(('param2', param2))
+ # process the body parameter
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/x-www-form-urlencoded'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/fake/jsonFormData',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_object_for_multipart_requests(
+ self,
+ marker: TestObjectForMultipartRequestsRequestMarker,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test_object_for_multipart_requests
+
+
+ :param marker: (required)
+ :type marker: TestObjectForMultipartRequestsRequestMarker
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_object_for_multipart_requests_serialize(
+ marker=marker,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_object_for_multipart_requests_with_http_info(
+ self,
+ marker: TestObjectForMultipartRequestsRequestMarker,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test_object_for_multipart_requests
+
+
+ :param marker: (required)
+ :type marker: TestObjectForMultipartRequestsRequestMarker
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_object_for_multipart_requests_serialize(
+ marker=marker,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_object_for_multipart_requests_without_preload_content(
+ self,
+ marker: TestObjectForMultipartRequestsRequestMarker,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test_object_for_multipart_requests
+
+
+ :param marker: (required)
+ :type marker: TestObjectForMultipartRequestsRequestMarker
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_object_for_multipart_requests_serialize(
+ marker=marker,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_object_for_multipart_requests_serialize(
+ self,
+ marker,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if marker is not None:
+ _form_params.append(('marker', marker))
+ # process the body parameter
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'multipart/form-data'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/object_for_multipart_requests',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_query_parameter_collection_format(
+ self,
+ pipe: List[StrictStr],
+ ioutil: List[StrictStr],
+ http: List[StrictStr],
+ url: List[StrictStr],
+ context: List[StrictStr],
+ allow_empty: StrictStr,
+ language: Optional[Dict[str, StrictStr]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test_query_parameter_collection_format
+
+ To test the collection format in query parameters
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_query_parameter_collection_format_serialize(
+ pipe=pipe,
+ ioutil=ioutil,
+ http=http,
+ url=url,
+ context=context,
+ allow_empty=allow_empty,
+ language=language,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_query_parameter_collection_format_with_http_info(
+ self,
+ pipe: List[StrictStr],
+ ioutil: List[StrictStr],
+ http: List[StrictStr],
+ url: List[StrictStr],
+ context: List[StrictStr],
+ allow_empty: StrictStr,
+ language: Optional[Dict[str, StrictStr]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test_query_parameter_collection_format
+
+ To test the collection format in query parameters
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_query_parameter_collection_format_serialize(
+ pipe=pipe,
+ ioutil=ioutil,
+ http=http,
+ url=url,
+ context=context,
+ allow_empty=allow_empty,
+ language=language,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_query_parameter_collection_format_without_preload_content(
+ self,
+ pipe: List[StrictStr],
+ ioutil: List[StrictStr],
+ http: List[StrictStr],
+ url: List[StrictStr],
+ context: List[StrictStr],
+ allow_empty: StrictStr,
+ language: Optional[Dict[str, StrictStr]] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test_query_parameter_collection_format
+
+ To test the collection format in query parameters
+
+ :param pipe: (required)
+ :type pipe: List[str]
+ :param ioutil: (required)
+ :type ioutil: List[str]
+ :param http: (required)
+ :type http: List[str]
+ :param url: (required)
+ :type url: List[str]
+ :param context: (required)
+ :type context: List[str]
+ :param allow_empty: (required)
+ :type allow_empty: str
+ :param language:
+ :type language: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_query_parameter_collection_format_serialize(
+ pipe=pipe,
+ ioutil=ioutil,
+ http=http,
+ url=url,
+ context=context,
+ allow_empty=allow_empty,
+ language=language,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_query_parameter_collection_format_serialize(
+ self,
+ pipe,
+ ioutil,
+ http,
+ url,
+ context,
+ allow_empty,
+ language,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'pipe': 'pipes',
+ 'ioutil': 'csv',
+ 'http': 'ssv',
+ 'url': 'csv',
+ 'context': 'multi',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if pipe is not None:
+
+ _query_params.append(('pipe', pipe))
+
+ if ioutil is not None:
+
+ _query_params.append(('ioutil', ioutil))
+
+ if http is not None:
+
+ _query_params.append(('http', http))
+
+ if url is not None:
+
+ _query_params.append(('url', url))
+
+ if context is not None:
+
+ _query_params.append(('context', context))
+
+ if language is not None:
+
+ _query_params.append(('language', language))
+
+ if allow_empty is not None:
+
+ _query_params.append(('allowEmpty', allow_empty))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/fake/test-query-parameters',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def test_string_map_reference(
+ self,
+ request_body: Annotated[Dict[str, StrictStr], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """test referenced string map
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_string_map_reference_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_string_map_reference_with_http_info(
+ self,
+ request_body: Annotated[Dict[str, StrictStr], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """test referenced string map
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_string_map_reference_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_string_map_reference_without_preload_content(
+ self,
+ request_body: Annotated[Dict[str, StrictStr], Field(description="request body")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test referenced string map
+
+
+
+ :param request_body: request body (required)
+ :type request_body: Dict[str, str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_string_map_reference_serialize(
+ request_body=request_body,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_string_map_reference_serialize(
+ self,
+ request_body,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if request_body is not None:
+ _body_params = request_body
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/stringMap-reference',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def upload_file_with_additional_properties(
+ self,
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")],
+ object: Optional[UploadFileWithAdditionalPropertiesRequestObject] = None,
+ count: Annotated[Optional[StrictInt], Field(description="Integer count")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ModelApiResponse:
+ """uploads a file and additional properties using multipart/form-data
+
+
+
+ :param file: file to upload (required)
+ :type file: bytearray
+ :param object:
+ :type object: UploadFileWithAdditionalPropertiesRequestObject
+ :param count: Integer count
+ :type count: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_with_additional_properties_serialize(
+ file=file,
+ object=object,
+ count=count,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def upload_file_with_additional_properties_with_http_info(
+ self,
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")],
+ object: Optional[UploadFileWithAdditionalPropertiesRequestObject] = None,
+ count: Annotated[Optional[StrictInt], Field(description="Integer count")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[ModelApiResponse]:
+ """uploads a file and additional properties using multipart/form-data
+
+
+
+ :param file: file to upload (required)
+ :type file: bytearray
+ :param object:
+ :type object: UploadFileWithAdditionalPropertiesRequestObject
+ :param count: Integer count
+ :type count: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_with_additional_properties_serialize(
+ file=file,
+ object=object,
+ count=count,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def upload_file_with_additional_properties_without_preload_content(
+ self,
+ file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")],
+ object: Optional[UploadFileWithAdditionalPropertiesRequestObject] = None,
+ count: Annotated[Optional[StrictInt], Field(description="Integer count")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """uploads a file and additional properties using multipart/form-data
+
+
+
+ :param file: file to upload (required)
+ :type file: bytearray
+ :param object:
+ :type object: UploadFileWithAdditionalPropertiesRequestObject
+ :param count: Integer count
+ :type count: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_with_additional_properties_serialize(
+ file=file,
+ object=object,
+ count=count,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _upload_file_with_additional_properties_serialize(
+ self,
+ file,
+ object,
+ count,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if file is not None:
+ _files['file'] = file
+ if object is not None:
+ _form_params.append(('object', object))
+ if count is not None:
+ _form_params.append(('count', count))
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'multipart/form-data'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/upload_file_with_additional_properties',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/fake_classname_tags123_api.py
new file mode 100644
index 00000000000..558590bab2d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/fake_classname_tags123_api.py
@@ -0,0 +1,312 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field
+from typing_extensions import Annotated
+from petstore_api.models.client import Client
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class FakeClassnameTags123Api:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def test_classname(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Client:
+ """To test class name in snake case
+
+ To test class name in snake case
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_classname_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def test_classname_with_http_info(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Client]:
+ """To test class name in snake case
+
+ To test class name in snake case
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_classname_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def test_classname_without_preload_content(
+ self,
+ client: Annotated[Client, Field(description="client model")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """To test class name in snake case
+
+ To test class name in snake case
+
+ :param client: client model (required)
+ :type client: Client
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._test_classname_serialize(
+ client=client,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Client",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _test_classname_serialize(
+ self,
+ client,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if client is not None:
+ _body_params = client
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'api_key_query'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PATCH',
+ resource_path='/fake_classname_test',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/import_test_datetime_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/import_test_datetime_api.py
new file mode 100644
index 00000000000..6d9829ac664
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/import_test_datetime_api.py
@@ -0,0 +1,278 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from datetime import datetime
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class ImportTestDatetimeApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def import_test_return_datetime(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> datetime:
+ """test date time
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._import_test_return_datetime_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "datetime",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def import_test_return_datetime_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[datetime]:
+ """test date time
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._import_test_return_datetime_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "datetime",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def import_test_return_datetime_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """test date time
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._import_test_return_datetime_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "datetime",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _import_test_return_datetime_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/import_test/return_datetime',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/pet_api.py
new file mode 100644
index 00000000000..5925ad96e7e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/pet_api.py
@@ -0,0 +1,2579 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator
+from typing import List, Optional, Tuple, Union
+from typing_extensions import Annotated
+from petstore_api.models.model_api_response import ModelApiResponse
+from petstore_api.models.pet import Pet
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class PetApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def add_pet(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Add a new pet to the store
+
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._add_pet_serialize(
+ pet=pet,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def add_pet_with_http_info(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Add a new pet to the store
+
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._add_pet_serialize(
+ pet=pet,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def add_pet_without_preload_content(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Add a new pet to the store
+
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._add_pet_serialize(
+ pet=pet,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _add_pet_serialize(
+ self,
+ pet,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if pet is not None:
+ _body_params = pet
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json',
+ 'application/xml'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth',
+ 'http_signature_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/pet',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_pet(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="Pet id to delete")],
+ api_key: Optional[StrictStr] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Deletes a pet
+
+
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_pet_serialize(
+ pet_id=pet_id,
+ api_key=api_key,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_pet_with_http_info(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="Pet id to delete")],
+ api_key: Optional[StrictStr] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Deletes a pet
+
+
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_pet_serialize(
+ pet_id=pet_id,
+ api_key=api_key,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def delete_pet_without_preload_content(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="Pet id to delete")],
+ api_key: Optional[StrictStr] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Deletes a pet
+
+
+
+ :param pet_id: Pet id to delete (required)
+ :type pet_id: int
+ :param api_key:
+ :type api_key: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_pet_serialize(
+ pet_id=pet_id,
+ api_key=api_key,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_pet_serialize(
+ self,
+ pet_id,
+ api_key,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if pet_id is not None:
+ _path_params['petId'] = pet_id
+ # process the query parameters
+ # process the header parameters
+ if api_key is not None:
+ _header_params['api_key'] = api_key
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/pet/{petId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def find_pets_by_status(
+ self,
+ status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[Pet]:
+ """Finds Pets by status
+
+ Multiple status values can be provided with comma separated strings
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._find_pets_by_status_serialize(
+ status=status,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def find_pets_by_status_with_http_info(
+ self,
+ status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[Pet]]:
+ """Finds Pets by status
+
+ Multiple status values can be provided with comma separated strings
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._find_pets_by_status_serialize(
+ status=status,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def find_pets_by_status_without_preload_content(
+ self,
+ status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Finds Pets by status
+
+ Multiple status values can be provided with comma separated strings
+
+ :param status: Status values that need to be considered for filter (required)
+ :type status: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._find_pets_by_status_serialize(
+ status=status,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _find_pets_by_status_serialize(
+ self,
+ status,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'status': 'csv',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if status is not None:
+
+ _query_params.append(('status', status))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth',
+ 'http_signature_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/pet/findByStatus',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def find_pets_by_tags(
+ self,
+ tags: Annotated[List[StrictStr], Field(description="Tags to filter by")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> List[Pet]:
+ """(Deprecated) Finds Pets by tags
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+ warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning)
+
+ _param = self._find_pets_by_tags_serialize(
+ tags=tags,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def find_pets_by_tags_with_http_info(
+ self,
+ tags: Annotated[List[StrictStr], Field(description="Tags to filter by")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[List[Pet]]:
+ """(Deprecated) Finds Pets by tags
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+ warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning)
+
+ _param = self._find_pets_by_tags_serialize(
+ tags=tags,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def find_pets_by_tags_without_preload_content(
+ self,
+ tags: Annotated[List[StrictStr], Field(description="Tags to filter by")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """(Deprecated) Finds Pets by tags
+
+ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+ :param tags: Tags to filter by (required)
+ :type tags: List[str]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+ warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning)
+
+ _param = self._find_pets_by_tags_serialize(
+ tags=tags,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "List[Pet]",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _find_pets_by_tags_serialize(
+ self,
+ tags,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'tags': 'csv',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if tags is not None:
+
+ _query_params.append(('tags', tags))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth',
+ 'http_signature_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/pet/findByTags',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_pet_by_id(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to return")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Pet:
+ """Find pet by ID
+
+ Returns a single pet
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_pet_by_id_serialize(
+ pet_id=pet_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Pet",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_pet_by_id_with_http_info(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to return")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Pet]:
+ """Find pet by ID
+
+ Returns a single pet
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_pet_by_id_serialize(
+ pet_id=pet_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Pet",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_pet_by_id_without_preload_content(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to return")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Find pet by ID
+
+ Returns a single pet
+
+ :param pet_id: ID of pet to return (required)
+ :type pet_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_pet_by_id_serialize(
+ pet_id=pet_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Pet",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_pet_by_id_serialize(
+ self,
+ pet_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if pet_id is not None:
+ _path_params['petId'] = pet_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'api_key'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/pet/{petId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_pet(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Update an existing pet
+
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_pet_serialize(
+ pet=pet,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '400': None,
+ '404': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_pet_with_http_info(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Update an existing pet
+
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_pet_serialize(
+ pet=pet,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '400': None,
+ '404': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def update_pet_without_preload_content(
+ self,
+ pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Update an existing pet
+
+
+
+ :param pet: Pet object that needs to be added to the store (required)
+ :type pet: Pet
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_pet_serialize(
+ pet=pet,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '400': None,
+ '404': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_pet_serialize(
+ self,
+ pet,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if pet is not None:
+ _body_params = pet
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json',
+ 'application/xml'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth',
+ 'http_signature_test'
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/pet',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_pet_with_form(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet that needs to be updated")],
+ name: Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None,
+ status: Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Updates a pet in the store with form data
+
+
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_pet_with_form_serialize(
+ pet_id=pet_id,
+ name=name,
+ status=status,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_pet_with_form_with_http_info(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet that needs to be updated")],
+ name: Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None,
+ status: Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Updates a pet in the store with form data
+
+
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_pet_with_form_serialize(
+ pet_id=pet_id,
+ name=name,
+ status=status,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def update_pet_with_form_without_preload_content(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet that needs to be updated")],
+ name: Annotated[Optional[StrictStr], Field(description="Updated name of the pet")] = None,
+ status: Annotated[Optional[StrictStr], Field(description="Updated status of the pet")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Updates a pet in the store with form data
+
+
+
+ :param pet_id: ID of pet that needs to be updated (required)
+ :type pet_id: int
+ :param name: Updated name of the pet
+ :type name: str
+ :param status: Updated status of the pet
+ :type status: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_pet_with_form_serialize(
+ pet_id=pet_id,
+ name=name,
+ status=status,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': None,
+ '405': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_pet_with_form_serialize(
+ self,
+ pet_id,
+ name,
+ status,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if pet_id is not None:
+ _path_params['petId'] = pet_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if name is not None:
+ _form_params.append(('name', name))
+ if status is not None:
+ _form_params.append(('status', status))
+ # process the body parameter
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/x-www-form-urlencoded'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/pet/{petId}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def upload_file(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to update")],
+ additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None,
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ModelApiResponse:
+ """uploads an image
+
+
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: bytearray
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_serialize(
+ pet_id=pet_id,
+ additional_metadata=additional_metadata,
+ file=file,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def upload_file_with_http_info(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to update")],
+ additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None,
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[ModelApiResponse]:
+ """uploads an image
+
+
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: bytearray
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_serialize(
+ pet_id=pet_id,
+ additional_metadata=additional_metadata,
+ file=file,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def upload_file_without_preload_content(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to update")],
+ additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None,
+ file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """uploads an image
+
+
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param file: file to upload
+ :type file: bytearray
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_serialize(
+ pet_id=pet_id,
+ additional_metadata=additional_metadata,
+ file=file,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _upload_file_serialize(
+ self,
+ pet_id,
+ additional_metadata,
+ file,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if pet_id is not None:
+ _path_params['petId'] = pet_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if additional_metadata is not None:
+ _form_params.append(('additionalMetadata', additional_metadata))
+ if file is not None:
+ _files['file'] = file
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'multipart/form-data'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/pet/{petId}/uploadImage',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def upload_file_with_required_file(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to update")],
+ required_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")],
+ additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ModelApiResponse:
+ """uploads an image (required)
+
+
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: bytearray
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_with_required_file_serialize(
+ pet_id=pet_id,
+ required_file=required_file,
+ additional_metadata=additional_metadata,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def upload_file_with_required_file_with_http_info(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to update")],
+ required_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")],
+ additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[ModelApiResponse]:
+ """uploads an image (required)
+
+
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: bytearray
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_with_required_file_serialize(
+ pet_id=pet_id,
+ required_file=required_file,
+ additional_metadata=additional_metadata,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def upload_file_with_required_file_without_preload_content(
+ self,
+ pet_id: Annotated[StrictInt, Field(description="ID of pet to update")],
+ required_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="file to upload")],
+ additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] = None,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """uploads an image (required)
+
+
+
+ :param pet_id: ID of pet to update (required)
+ :type pet_id: int
+ :param required_file: file to upload (required)
+ :type required_file: bytearray
+ :param additional_metadata: Additional data to pass to server
+ :type additional_metadata: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._upload_file_with_required_file_serialize(
+ pet_id=pet_id,
+ required_file=required_file,
+ additional_metadata=additional_metadata,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "ModelApiResponse",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _upload_file_with_required_file_serialize(
+ self,
+ pet_id,
+ required_file,
+ additional_metadata,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if pet_id is not None:
+ _path_params['petId'] = pet_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ if additional_metadata is not None:
+ _form_params.append(('additionalMetadata', additional_metadata))
+ if required_file is not None:
+ _files['requiredFile'] = required_file
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'multipart/form-data'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'petstore_auth'
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/fake/{petId}/uploadImageWithRequiredFile',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/store_api.py
new file mode 100644
index 00000000000..942f7bc25a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/store_api.py
@@ -0,0 +1,1085 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictInt, StrictStr
+from typing import Dict
+from typing_extensions import Annotated
+from petstore_api.models.order import Order
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class StoreApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def delete_order(
+ self,
+ order_id: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Delete purchase order by ID
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_order_serialize(
+ order_id=order_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_order_with_http_info(
+ self,
+ order_id: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Delete purchase order by ID
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_order_serialize(
+ order_id=order_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def delete_order_without_preload_content(
+ self,
+ order_id: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete purchase order by ID
+
+ For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+ :param order_id: ID of the order that needs to be deleted (required)
+ :type order_id: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_order_serialize(
+ order_id=order_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_order_serialize(
+ self,
+ order_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if order_id is not None:
+ _path_params['order_id'] = order_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/store/order/{order_id}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_inventory(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Dict[str, int]:
+ """Returns pet inventories by status
+
+ Returns a map of status codes to quantities
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_inventory_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Dict[str, int]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_inventory_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Dict[str, int]]:
+ """Returns pet inventories by status
+
+ Returns a map of status codes to quantities
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_inventory_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Dict[str, int]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_inventory_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Returns pet inventories by status
+
+ Returns a map of status codes to quantities
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_inventory_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Dict[str, int]",
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_inventory_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ 'api_key'
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/store/inventory',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_order_by_id(
+ self,
+ order_id: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Order:
+ """Find purchase order by ID
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_order_by_id_serialize(
+ order_id=order_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Order",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_order_by_id_with_http_info(
+ self,
+ order_id: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Order]:
+ """Find purchase order by ID
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_order_by_id_serialize(
+ order_id=order_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Order",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_order_by_id_without_preload_content(
+ self,
+ order_id: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Find purchase order by ID
+
+ For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+ :param order_id: ID of pet that needs to be fetched (required)
+ :type order_id: int
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_order_by_id_serialize(
+ order_id=order_id,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Order",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_order_by_id_serialize(
+ self,
+ order_id,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if order_id is not None:
+ _path_params['order_id'] = order_id
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/store/order/{order_id}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def place_order(
+ self,
+ order: Annotated[Order, Field(description="order placed for purchasing the pet")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> Order:
+ """Place an order for a pet
+
+
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._place_order_serialize(
+ order=order,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Order",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def place_order_with_http_info(
+ self,
+ order: Annotated[Order, Field(description="order placed for purchasing the pet")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[Order]:
+ """Place an order for a pet
+
+
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._place_order_serialize(
+ order=order,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Order",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def place_order_without_preload_content(
+ self,
+ order: Annotated[Order, Field(description="order placed for purchasing the pet")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Place an order for a pet
+
+
+
+ :param order: order placed for purchasing the pet (required)
+ :type order: Order
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._place_order_serialize(
+ order=order,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "Order",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _place_order_serialize(
+ self,
+ order,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if order is not None:
+ _body_params = order
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/store/order',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/user_api.py
new file mode 100644
index 00000000000..b2a4ced8809
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api/user_api.py
@@ -0,0 +1,2161 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+import warnings
+from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
+from typing import Any, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+
+from pydantic import Field, StrictStr
+from typing import List
+from typing_extensions import Annotated
+from petstore_api.models.user import User
+
+from petstore_api.api_client import ApiClient, RequestSerialized
+from petstore_api.api_response import ApiResponse
+from petstore_api.rest import RESTResponseType
+
+
+class UserApi:
+ """NOTE: This class is auto generated by OpenAPI Generator
+ Ref: https://openapi-generator.tech
+
+ Do not edit the class manually.
+ """
+
+ def __init__(self, api_client=None) -> None:
+ if api_client is None:
+ api_client = ApiClient.get_default()
+ self.api_client = api_client
+
+
+ @validate_call
+ def create_user(
+ self,
+ user: Annotated[User, Field(description="Created user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=4)] = 0,
+ ) -> None:
+ """Create user
+
+ This can only be done by the logged in user.
+
+ :param user: Created user object (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_user_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def create_user_with_http_info(
+ self,
+ user: Annotated[User, Field(description="Created user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=4)] = 0,
+ ) -> ApiResponse[None]:
+ """Create user
+
+ This can only be done by the logged in user.
+
+ :param user: Created user object (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_user_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def create_user_without_preload_content(
+ self,
+ user: Annotated[User, Field(description="Created user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=4)] = 0,
+ ) -> RESTResponseType:
+ """Create user
+
+ This can only be done by the logged in user.
+
+ :param user: Created user object (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_user_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _create_user_serialize(
+ self,
+ user,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _hosts = [
+ 'http://localhost/v2',
+ 'http://petstore.swagger.io/v2',
+ 'http://path-server-test.petstore.local/v2',
+ 'http://{server}.swagger.io:{port}/v2'
+ ]
+ _host = _hosts[_host_index]
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if user is not None:
+ _body_params = user
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/user',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def create_users_with_array_input(
+ self,
+ user: Annotated[List[User], Field(description="List of user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Creates list of users with given input array
+
+
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_users_with_array_input_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def create_users_with_array_input_with_http_info(
+ self,
+ user: Annotated[List[User], Field(description="List of user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Creates list of users with given input array
+
+
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_users_with_array_input_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def create_users_with_array_input_without_preload_content(
+ self,
+ user: Annotated[List[User], Field(description="List of user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Creates list of users with given input array
+
+
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_users_with_array_input_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _create_users_with_array_input_serialize(
+ self,
+ user,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'User': '',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if user is not None:
+ _body_params = user
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/user/createWithArray',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def create_users_with_list_input(
+ self,
+ user: Annotated[List[User], Field(description="List of user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Creates list of users with given input array
+
+
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_users_with_list_input_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def create_users_with_list_input_with_http_info(
+ self,
+ user: Annotated[List[User], Field(description="List of user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Creates list of users with given input array
+
+
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_users_with_list_input_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def create_users_with_list_input_without_preload_content(
+ self,
+ user: Annotated[List[User], Field(description="List of user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Creates list of users with given input array
+
+
+
+ :param user: List of user object (required)
+ :type user: List[User]
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._create_users_with_list_input_serialize(
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _create_users_with_list_input_serialize(
+ self,
+ user,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ 'User': '',
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if user is not None:
+ _body_params = user
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='POST',
+ resource_path='/user/createWithList',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def delete_user(
+ self,
+ username: Annotated[StrictStr, Field(description="The name that needs to be deleted")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Delete user
+
+ This can only be done by the logged in user.
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_user_serialize(
+ username=username,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def delete_user_with_http_info(
+ self,
+ username: Annotated[StrictStr, Field(description="The name that needs to be deleted")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Delete user
+
+ This can only be done by the logged in user.
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_user_serialize(
+ username=username,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def delete_user_without_preload_content(
+ self,
+ username: Annotated[StrictStr, Field(description="The name that needs to be deleted")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Delete user
+
+ This can only be done by the logged in user.
+
+ :param username: The name that needs to be deleted (required)
+ :type username: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._delete_user_serialize(
+ username=username,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _delete_user_serialize(
+ self,
+ username,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if username is not None:
+ _path_params['username'] = username
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='DELETE',
+ resource_path='/user/{username}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def get_user_by_name(
+ self,
+ username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> User:
+ """Get user by user name
+
+
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_user_by_name_serialize(
+ username=username,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "User",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def get_user_by_name_with_http_info(
+ self,
+ username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[User]:
+ """Get user by user name
+
+
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_user_by_name_serialize(
+ username=username,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "User",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def get_user_by_name_without_preload_content(
+ self,
+ username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Get user by user name
+
+
+
+ :param username: The name that needs to be fetched. Use user1 for testing. (required)
+ :type username: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._get_user_by_name_serialize(
+ username=username,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "User",
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _get_user_by_name_serialize(
+ self,
+ username,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if username is not None:
+ _path_params['username'] = username
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/user/{username}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def login_user(
+ self,
+ username: Annotated[StrictStr, Field(description="The user name for login")],
+ password: Annotated[StrictStr, Field(description="The password for login in clear text")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> str:
+ """Logs user into the system
+
+
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._login_user_serialize(
+ username=username,
+ password=password,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def login_user_with_http_info(
+ self,
+ username: Annotated[StrictStr, Field(description="The user name for login")],
+ password: Annotated[StrictStr, Field(description="The password for login in clear text")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[str]:
+ """Logs user into the system
+
+
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._login_user_serialize(
+ username=username,
+ password=password,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def login_user_without_preload_content(
+ self,
+ username: Annotated[StrictStr, Field(description="The user name for login")],
+ password: Annotated[StrictStr, Field(description="The password for login in clear text")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Logs user into the system
+
+
+
+ :param username: The user name for login (required)
+ :type username: str
+ :param password: The password for login in clear text (required)
+ :type password: str
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._login_user_serialize(
+ username=username,
+ password=password,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '200': "str",
+ '400': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _login_user_serialize(
+ self,
+ username,
+ password,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ if username is not None:
+
+ _query_params.append(('username', username))
+
+ if password is not None:
+
+ _query_params.append(('password', password))
+
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+ # set the HTTP header `Accept`
+ if 'Accept' not in _header_params:
+ _header_params['Accept'] = self.api_client.select_header_accept(
+ [
+ 'application/xml',
+ 'application/json'
+ ]
+ )
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/user/login',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def logout_user(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Logs out current logged in user session
+
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._logout_user_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def logout_user_with_http_info(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Logs out current logged in user session
+
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._logout_user_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def logout_user_without_preload_content(
+ self,
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Logs out current logged in user session
+
+
+
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._logout_user_serialize(
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _logout_user_serialize(
+ self,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+
+
+
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='GET',
+ resource_path='/user/logout',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
+
+
+ @validate_call
+ def update_user(
+ self,
+ username: Annotated[StrictStr, Field(description="name that need to be deleted")],
+ user: Annotated[User, Field(description="Updated user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> None:
+ """Updated user
+
+ This can only be done by the logged in user.
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_user_serialize(
+ username=username,
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ ).data
+
+
+ @validate_call
+ def update_user_with_http_info(
+ self,
+ username: Annotated[StrictStr, Field(description="name that need to be deleted")],
+ user: Annotated[User, Field(description="Updated user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> ApiResponse[None]:
+ """Updated user
+
+ This can only be done by the logged in user.
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_user_serialize(
+ username=username,
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ response_data.read()
+ return self.api_client.response_deserialize(
+ response_data=response_data,
+ response_types_map=_response_types_map,
+ )
+
+
+ @validate_call
+ def update_user_without_preload_content(
+ self,
+ username: Annotated[StrictStr, Field(description="name that need to be deleted")],
+ user: Annotated[User, Field(description="Updated user object")],
+ _request_timeout: Union[
+ None,
+ Annotated[StrictFloat, Field(gt=0)],
+ Tuple[
+ Annotated[StrictFloat, Field(gt=0)],
+ Annotated[StrictFloat, Field(gt=0)]
+ ]
+ ] = None,
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
+ _content_type: Optional[StrictStr] = None,
+ _headers: Optional[Dict[StrictStr, Any]] = None,
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
+ ) -> RESTResponseType:
+ """Updated user
+
+ This can only be done by the logged in user.
+
+ :param username: name that need to be deleted (required)
+ :type username: str
+ :param user: Updated user object (required)
+ :type user: User
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ :type _request_timeout: int, tuple(int, int), optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the
+ authentication in the spec for a single request.
+ :type _request_auth: dict, optional
+ :param _content_type: force content-type for the request.
+ :type _content_type: str, Optional
+ :param _headers: set to override the headers for a single
+ request; this effectively ignores the headers
+ in the spec for a single request.
+ :type _headers: dict, optional
+ :param _host_index: set to override the host_index for a single
+ request; this effectively ignores the host_index
+ in the spec for a single request.
+ :type _host_index: int, optional
+ :return: Returns the result object.
+ """ # noqa: E501
+
+ _param = self._update_user_serialize(
+ username=username,
+ user=user,
+ _request_auth=_request_auth,
+ _content_type=_content_type,
+ _headers=_headers,
+ _host_index=_host_index
+ )
+
+ _response_types_map: Dict[str, Optional[str]] = {
+ '400': None,
+ '404': None,
+ }
+ response_data = self.api_client.call_api(
+ *_param,
+ _request_timeout=_request_timeout
+ )
+ return response_data.response
+
+
+ def _update_user_serialize(
+ self,
+ username,
+ user,
+ _request_auth,
+ _content_type,
+ _headers,
+ _host_index,
+ ) -> RequestSerialized:
+
+ _host = None
+
+ _collection_formats: Dict[str, str] = {
+ }
+
+ _path_params: Dict[str, str] = {}
+ _query_params: List[Tuple[str, str]] = []
+ _header_params: Dict[str, Optional[str]] = _headers or {}
+ _form_params: List[Tuple[str, str]] = []
+ _files: Dict[
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
+ ] = {}
+ _body_params: Optional[bytes] = None
+
+ # process the path parameters
+ if username is not None:
+ _path_params['username'] = username
+ # process the query parameters
+ # process the header parameters
+ # process the form parameters
+ # process the body parameter
+ if user is not None:
+ _body_params = user
+
+
+
+ # set the HTTP header `Content-Type`
+ if _content_type:
+ _header_params['Content-Type'] = _content_type
+ else:
+ _default_content_type = (
+ self.api_client.select_header_content_type(
+ [
+ 'application/json'
+ ]
+ )
+ )
+ if _default_content_type is not None:
+ _header_params['Content-Type'] = _default_content_type
+
+ # authentication setting
+ _auth_settings: List[str] = [
+ ]
+
+ return self.api_client.param_serialize(
+ method='PUT',
+ resource_path='/user/{username}',
+ path_params=_path_params,
+ query_params=_query_params,
+ header_params=_header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ auth_settings=_auth_settings,
+ collection_formats=_collection_formats,
+ _host=_host,
+ _request_auth=_request_auth
+ )
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py
new file mode 100644
index 00000000000..a06ecfa5b50
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_client.py
@@ -0,0 +1,811 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import datetime
+from dateutil.parser import parse
+from enum import Enum
+import decimal
+import json
+import mimetypes
+import os
+import re
+import tempfile
+import uuid
+
+from urllib.parse import quote
+from typing import Tuple, Optional, List, Dict, Union
+from pydantic import SecretStr
+
+from petstore_api.configuration import Configuration
+from petstore_api.api_response import ApiResponse, T as ApiResponseT
+import petstore_api.models
+from petstore_api import rest
+from petstore_api.exceptions import (
+ ApiValueError,
+ ApiException,
+ BadRequestException,
+ UnauthorizedException,
+ ForbiddenException,
+ NotFoundException,
+ ServiceException
+)
+
+RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]]
+
+class ApiClient:
+ """Generic API client for OpenAPI client library builds.
+
+ OpenAPI generic API client. This client handles the client-
+ server communication, and is invariant across implementations. Specifics of
+ the methods and models for each application are generated from the OpenAPI
+ templates.
+
+ :param configuration: .Configuration object for this client
+ :param header_name: a header to pass when making calls to the API.
+ :param header_value: a header value to pass when making calls to
+ the API.
+ :param cookie: a cookie to include in the header when making calls
+ to the API
+ """
+
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ 'int': int,
+ 'long': int, # TODO remove as only py3 is supported?
+ 'float': float,
+ 'str': str,
+ 'bool': bool,
+ 'date': datetime.date,
+ 'datetime': datetime.datetime,
+ 'decimal': decimal.Decimal,
+ 'object': object,
+ }
+ _pool = None
+
+ def __init__(
+ self,
+ configuration=None,
+ header_name=None,
+ header_value=None,
+ cookie=None
+ ) -> None:
+ # use default configuration if none is provided
+ if configuration is None:
+ configuration = Configuration.get_default()
+ self.configuration = configuration
+
+ self.rest_client = rest.RESTClientObject(configuration)
+ self.default_headers = {}
+ if header_name is not None:
+ self.default_headers[header_name] = header_value
+ self.cookie = cookie
+ # Set default User-Agent.
+ self.user_agent = 'OpenAPI-Generator/1.0.0/python'
+ self.client_side_validation = configuration.client_side_validation
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ pass
+
+ @property
+ def user_agent(self):
+ """User agent for this API client"""
+ return self.default_headers['User-Agent']
+
+ @user_agent.setter
+ def user_agent(self, value):
+ self.default_headers['User-Agent'] = value
+
+ def set_default_header(self, header_name, header_value):
+ self.default_headers[header_name] = header_value
+
+
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
+ def param_serialize(
+ self,
+ method,
+ resource_path,
+ path_params=None,
+ query_params=None,
+ header_params=None,
+ body=None,
+ post_params=None,
+ files=None, auth_settings=None,
+ collection_formats=None,
+ _host=None,
+ _request_auth=None
+ ) -> RequestSerialized:
+
+ """Builds the HTTP request params needed by the request.
+ :param method: Method to call.
+ :param resource_path: Path to method endpoint.
+ :param path_params: Path parameters in the url.
+ :param query_params: Query parameters in the url.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param auth_settings list: Auth Settings names for the request.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
+ :param collection_formats: dict of collection formats for path, query,
+ header, and post parameters.
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :return: tuple of form (path, http_method, query_params, header_params,
+ body, post_params, files)
+ """
+
+ config = self.configuration
+
+ # header parameters
+ header_params = header_params or {}
+ header_params.update(self.default_headers)
+ if self.cookie:
+ header_params['Cookie'] = self.cookie
+ if header_params:
+ header_params = self.sanitize_for_serialization(header_params)
+ header_params = dict(
+ self.parameters_to_tuples(header_params,collection_formats)
+ )
+
+ # path parameters
+ if path_params:
+ path_params = self.sanitize_for_serialization(path_params)
+ path_params = self.parameters_to_tuples(
+ path_params,
+ collection_formats
+ )
+ for k, v in path_params:
+ # specified safe chars, encode everything
+ resource_path = resource_path.replace(
+ '{%s}' % k,
+ quote(str(v), safe=config.safe_chars_for_path_param)
+ )
+
+ # post parameters
+ if post_params or files:
+ post_params = post_params if post_params else []
+ post_params = self.sanitize_for_serialization(post_params)
+ post_params = self.parameters_to_tuples(
+ post_params,
+ collection_formats
+ )
+ if files:
+ post_params.extend(self.files_parameters(files))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params,
+ query_params,
+ auth_settings,
+ resource_path,
+ method,
+ body,
+ request_auth=_request_auth
+ )
+
+ # body
+ if body:
+ body = self.sanitize_for_serialization(body)
+
+ # request url
+ if _host is None or self.configuration.ignore_operation_servers:
+ url = self.configuration.host + resource_path
+ else:
+ # use server/host defined in path or operation instead
+ url = _host + resource_path
+
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(
+ query_params,
+ collection_formats
+ )
+ url += "?" + url_query
+
+ return method, url, header_params, body, post_params
+
+
+ def call_api(
+ self,
+ method,
+ url,
+ header_params=None,
+ body=None,
+ post_params=None,
+ _request_timeout=None
+ ) -> rest.RESTResponse:
+ """Makes the HTTP request (synchronous)
+ :param method: Method to call.
+ :param url: Path to method endpoint.
+ :param header_params: Header parameters to be
+ placed in the request header.
+ :param body: Request body.
+ :param post_params dict: Request post form parameters,
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
+ :param _request_timeout: timeout setting for this request.
+ :return: RESTResponse
+ """
+
+ try:
+ # perform request and return response
+ response_data = self.rest_client.request(
+ method, url,
+ headers=header_params,
+ body=body, post_params=post_params,
+ _request_timeout=_request_timeout
+ )
+
+ except ApiException as e:
+ raise e
+
+ return response_data
+
+ def response_deserialize(
+ self,
+ response_data: rest.RESTResponse,
+ response_types_map: Optional[Dict[str, ApiResponseT]]=None
+ ) -> ApiResponse[ApiResponseT]:
+ """Deserializes response into an object.
+ :param response_data: RESTResponse object to be deserialized.
+ :param response_types_map: dict of response types.
+ :return: ApiResponse
+ """
+
+ msg = "RESTResponse.read() must be called before passing it to response_deserialize()"
+ assert response_data.data is not None, msg
+
+ response_type = response_types_map.get(str(response_data.status), None)
+ if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
+ # if not found, look for '1XX', '2XX', etc.
+ response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
+
+ # deserialize response data
+ response_text = None
+ return_data = None
+ try:
+ if response_type == "bytearray":
+ return_data = response_data.data
+ elif response_type == "file":
+ return_data = self.__deserialize_file(response_data)
+ elif response_type is not None:
+ match = None
+ content_type = response_data.getheader('content-type')
+ if content_type is not None:
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
+ response_text = response_data.data.decode(encoding)
+ return_data = self.deserialize(response_text, response_type, content_type)
+ finally:
+ if not 200 <= response_data.status <= 299:
+ raise ApiException.from_response(
+ http_resp=response_data,
+ body=response_text,
+ data=return_data,
+ )
+
+ return ApiResponse(
+ status_code = response_data.status,
+ data = return_data,
+ headers = response_data.getheaders(),
+ raw_data = response_data.data
+ )
+
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
+
+ If obj is None, return None.
+ If obj is SecretStr, return obj.get_secret_value()
+ If obj is str, int, long, float, bool, return directly.
+ If obj is datetime.datetime, datetime.date
+ convert to string in iso8601 format.
+ If obj is decimal.Decimal return string representation.
+ If obj is list, sanitize each element in the list.
+ If obj is dict, return the dict.
+ If obj is OpenAPI model, return the properties dict.
+
+ :param obj: The data to serialize.
+ :return: The serialized form of data.
+ """
+ if obj is None:
+ return None
+ elif isinstance(obj, Enum):
+ return obj.value
+ elif isinstance(obj, SecretStr):
+ return obj.get_secret_value()
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
+ return obj
+ elif isinstance(obj, uuid.UUID):
+ return str(obj)
+ elif isinstance(obj, list):
+ return [
+ self.sanitize_for_serialization(sub_obj) for sub_obj in obj
+ ]
+ elif isinstance(obj, tuple):
+ return tuple(
+ self.sanitize_for_serialization(sub_obj) for sub_obj in obj
+ )
+ elif isinstance(obj, (datetime.datetime, datetime.date)):
+ return obj.isoformat()
+ elif isinstance(obj, decimal.Decimal):
+ return str(obj)
+
+ elif isinstance(obj, dict):
+ obj_dict = obj
+ else:
+ # Convert model obj to dict except
+ # attributes `openapi_types`, `attribute_map`
+ # and attributes which value is not None.
+ # Convert attribute name to json key in
+ # model definition for request.
+ if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')):
+ obj_dict = obj.to_dict()
+ else:
+ obj_dict = obj.__dict__
+
+ if isinstance(obj_dict, list):
+ # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict()
+ return self.sanitize_for_serialization(obj_dict)
+
+ return {
+ key: self.sanitize_for_serialization(val)
+ for key, val in obj_dict.items()
+ }
+
+ def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
+ """Deserializes response into an object.
+
+ :param response: RESTResponse object to be deserialized.
+ :param response_type: class literal for
+ deserialized object, or string of class name.
+ :param content_type: content type of response.
+
+ :return: deserialized object.
+ """
+
+ # fetch data from response object
+ if content_type is None:
+ try:
+ data = json.loads(response_text)
+ except ValueError:
+ data = response_text
+ elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
+ if response_text == "":
+ data = ""
+ else:
+ data = json.loads(response_text)
+ elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
+ data = response_text
+ else:
+ raise ApiException(
+ status=0,
+ reason="Unsupported content type: {0}".format(content_type)
+ )
+
+ return self.__deserialize(data, response_type)
+
+ def __deserialize(self, data, klass):
+ """Deserializes dict, list, str into an object.
+
+ :param data: dict, list or str.
+ :param klass: class literal, or string of class name.
+
+ :return: object.
+ """
+ if data is None:
+ return None
+
+ if isinstance(klass, str):
+ if klass.startswith('List['):
+ m = re.match(r'List\[(.*)]', klass)
+ assert m is not None, "Malformed List type definition"
+ sub_kls = m.group(1)
+ return [self.__deserialize(sub_data, sub_kls)
+ for sub_data in data]
+
+ if klass.startswith('Dict['):
+ m = re.match(r'Dict\[([^,]*), (.*)]', klass)
+ assert m is not None, "Malformed Dict type definition"
+ sub_kls = m.group(2)
+ return {k: self.__deserialize(v, sub_kls)
+ for k, v in data.items()}
+
+ # convert str to class
+ if klass in self.NATIVE_TYPES_MAPPING:
+ klass = self.NATIVE_TYPES_MAPPING[klass]
+ else:
+ klass = getattr(petstore_api.models, klass)
+
+ if klass in self.PRIMITIVE_TYPES:
+ return self.__deserialize_primitive(data, klass)
+ elif klass == object:
+ return self.__deserialize_object(data)
+ elif klass == datetime.date:
+ return self.__deserialize_date(data)
+ elif klass == datetime.datetime:
+ return self.__deserialize_datetime(data)
+ elif klass == decimal.Decimal:
+ return decimal.Decimal(data)
+ elif issubclass(klass, Enum):
+ return self.__deserialize_enum(data, klass)
+ else:
+ return self.__deserialize_model(data, klass)
+
+ def parameters_to_tuples(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: Parameters as list of tuples, collections formatted
+ """
+ new_params: List[Tuple[str, str]] = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params:
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, value) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(str(value) for value in v)))
+ else:
+ new_params.append((k, v))
+ return new_params
+
+ def parameters_to_url_query(self, params, collection_formats):
+ """Get parameters as list of tuples, formatting collections.
+
+ :param params: Parameters as dict or list of two-tuples
+ :param dict collection_formats: Parameter collection formats
+ :return: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params: List[Tuple[str, str]] = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params:
+ if isinstance(v, bool):
+ v = str(v).lower()
+ if isinstance(v, (int, float)):
+ v = str(v)
+ if isinstance(v, dict):
+ v = json.dumps(v)
+
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == 'multi':
+ new_params.extend((k, quote(str(value))) for value in v)
+ else:
+ if collection_format == 'ssv':
+ delimiter = ' '
+ elif collection_format == 'tsv':
+ delimiter = '\t'
+ elif collection_format == 'pipes':
+ delimiter = '|'
+ else: # csv is the default
+ delimiter = ','
+ new_params.append(
+ (k, delimiter.join(quote(str(value)) for value in v))
+ )
+ else:
+ new_params.append((k, quote(str(v))))
+
+ return "&".join(["=".join(map(str, item)) for item in new_params])
+
+ def files_parameters(
+ self,
+ files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]],
+ ):
+ """Builds form parameters.
+
+ :param files: File parameters.
+ :return: Form parameters with files.
+ """
+ params = []
+ for k, v in files.items():
+ if isinstance(v, str):
+ with open(v, 'rb') as f:
+ filename = os.path.basename(f.name)
+ filedata = f.read()
+ elif isinstance(v, bytes):
+ filename = k
+ filedata = v
+ elif isinstance(v, tuple):
+ filename, filedata = v
+ elif isinstance(v, list):
+ for file_param in v:
+ params.extend(self.files_parameters({k: file_param}))
+ continue
+ else:
+ raise ValueError("Unsupported file value")
+ mimetype = (
+ mimetypes.guess_type(filename)[0]
+ or 'application/octet-stream'
+ )
+ params.append(
+ tuple([k, tuple([filename, filedata, mimetype])])
+ )
+ return params
+
+ def select_header_accept(self, accepts: List[str]) -> Optional[str]:
+ """Returns `Accept` based on an array of accepts provided.
+
+ :param accepts: List of headers.
+ :return: Accept (e.g. application/json).
+ """
+ if not accepts:
+ return None
+
+ for accept in accepts:
+ if re.search('json', accept, re.IGNORECASE):
+ return accept
+
+ return accepts[0]
+
+ def select_header_content_type(self, content_types):
+ """Returns `Content-Type` based on an array of content_types provided.
+
+ :param content_types: List of content-types.
+ :return: Content-Type (e.g. application/json).
+ """
+ if not content_types:
+ return None
+
+ for content_type in content_types:
+ if re.search('json', content_type, re.IGNORECASE):
+ return content_type
+
+ return content_types[0]
+
+ def update_params_for_auth(
+ self,
+ headers,
+ queries,
+ auth_settings,
+ resource_path,
+ method,
+ body,
+ request_auth=None
+ ) -> None:
+ """Updates header and query params based on authentication setting.
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :param auth_settings: Authentication setting identifiers list.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
+ """
+ if not auth_settings:
+ return
+
+ if request_auth:
+ self._apply_auth_params(
+ headers,
+ queries,
+ resource_path,
+ method,
+ body,
+ request_auth
+ )
+ else:
+ for auth in auth_settings:
+ auth_setting = self.configuration.auth_settings().get(auth)
+ if auth_setting:
+ self._apply_auth_params(
+ headers,
+ queries,
+ resource_path,
+ method,
+ body,
+ auth_setting
+ )
+
+ def _apply_auth_params(
+ self,
+ headers,
+ queries,
+ resource_path,
+ method,
+ body,
+ auth_setting
+ ) -> None:
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
+ """
+ if auth_setting['in'] == 'cookie':
+ headers['Cookie'] = auth_setting['value']
+ elif auth_setting['in'] == 'header':
+ if auth_setting['type'] != 'http-signature':
+ headers[auth_setting['key']] = auth_setting['value']
+ else:
+ # The HTTP signature scheme requires multiple HTTP headers
+ # that are calculated dynamically.
+ signing_info = self.configuration.signing_info
+ auth_headers = signing_info.get_http_signature_headers(
+ resource_path, method, headers, body, queries)
+ headers.update(auth_headers)
+ elif auth_setting['in'] == 'query':
+ queries.append((auth_setting['key'], auth_setting['value']))
+ else:
+ raise ApiValueError(
+ 'Authentication token must be in `query` or `header`'
+ )
+
+ def __deserialize_file(self, response):
+ """Deserializes body to file
+
+ Saves response body into a file in a temporary folder,
+ using the filename from the `Content-Disposition` header if provided.
+
+ handle file downloading
+ save response body into a tmp file and return the instance
+
+ :param response: RESTResponse.
+ :return: file path.
+ """
+ fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
+ os.close(fd)
+ os.remove(path)
+
+ content_disposition = response.getheader("Content-Disposition")
+ if content_disposition:
+ m = re.search(
+ r'filename=[\'"]?([^\'"\s]+)[\'"]?',
+ content_disposition
+ )
+ assert m is not None, "Unexpected 'content-disposition' header value"
+ filename = m.group(1)
+ path = os.path.join(os.path.dirname(path), filename)
+
+ with open(path, "wb") as f:
+ f.write(response.data)
+
+ return path
+
+ def __deserialize_primitive(self, data, klass):
+ """Deserializes string to primitive type.
+
+ :param data: str.
+ :param klass: class literal.
+
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
+
+ def __deserialize_object(self, value):
+ """Return an original value.
+
+ :return: object.
+ """
+ return value
+
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+
+ :param string: str.
+ :return: date.
+ """
+ try:
+ return parse(string).date()
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason="Failed to parse `{0}` as date object".format(string)
+ )
+
+ def __deserialize_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ return parse(string)
+ except ImportError:
+ return string
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as datetime object"
+ .format(string)
+ )
+ )
+
+ def __deserialize_enum(self, data, klass):
+ """Deserializes primitive type to enum.
+
+ :param data: primitive type.
+ :param klass: class literal.
+ :return: enum value.
+ """
+ try:
+ return klass(data)
+ except ValueError:
+ raise rest.ApiException(
+ status=0,
+ reason=(
+ "Failed to parse `{0}` as `{1}`"
+ .format(data, klass)
+ )
+ )
+
+ def __deserialize_model(self, data, klass):
+ """Deserializes list or dict to model.
+
+ :param data: dict, list.
+ :param klass: class literal.
+ :return: model object.
+ """
+
+ return klass.from_dict(data)
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_response.py
new file mode 100644
index 00000000000..9bc7c11f6b9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/api_response.py
@@ -0,0 +1,21 @@
+"""API response object."""
+
+from __future__ import annotations
+from typing import Optional, Generic, Mapping, TypeVar
+from pydantic import Field, StrictInt, StrictBytes, BaseModel
+
+T = TypeVar("T")
+
+class ApiResponse(BaseModel, Generic[T]):
+ """
+ API response object
+ """
+
+ status_code: StrictInt = Field(description="HTTP status code")
+ headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers")
+ data: T = Field(description="Deserialized data given the data type")
+ raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
+
+ model_config = {
+ "arbitrary_types_allowed": True
+ }
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py
new file mode 100644
index 00000000000..cb081f807f5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/configuration.py
@@ -0,0 +1,750 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import copy
+import http.client as httplib
+import logging
+from logging import FileHandler
+import multiprocessing
+import sys
+from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
+from typing_extensions import NotRequired, Self
+
+import urllib3
+
+from petstore_api.signing import HttpSigningConfiguration
+
+JSON_SCHEMA_VALIDATION_KEYWORDS = {
+ 'multipleOf', 'maximum', 'exclusiveMaximum',
+ 'minimum', 'exclusiveMinimum', 'maxLength',
+ 'minLength', 'pattern', 'maxItems', 'minItems'
+}
+
+ServerVariablesT = Dict[str, str]
+
+GenericAuthSetting = TypedDict(
+ "GenericAuthSetting",
+ {
+ "type": str,
+ "in": str,
+ "key": str,
+ "value": str,
+ },
+)
+
+
+OAuth2AuthSetting = TypedDict(
+ "OAuth2AuthSetting",
+ {
+ "type": Literal["oauth2"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": str,
+ },
+)
+
+
+APIKeyAuthSetting = TypedDict(
+ "APIKeyAuthSetting",
+ {
+ "type": Literal["api_key"],
+ "in": str,
+ "key": str,
+ "value": Optional[str],
+ },
+)
+
+
+BasicAuthSetting = TypedDict(
+ "BasicAuthSetting",
+ {
+ "type": Literal["basic"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": Optional[str],
+ },
+)
+
+
+BearerFormatAuthSetting = TypedDict(
+ "BearerFormatAuthSetting",
+ {
+ "type": Literal["bearer"],
+ "in": Literal["header"],
+ "format": Literal["JWT"],
+ "key": Literal["Authorization"],
+ "value": str,
+ },
+)
+
+
+BearerAuthSetting = TypedDict(
+ "BearerAuthSetting",
+ {
+ "type": Literal["bearer"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": str,
+ },
+)
+
+
+HTTPSignatureAuthSetting = TypedDict(
+ "HTTPSignatureAuthSetting",
+ {
+ "type": Literal["http-signature"],
+ "in": Literal["header"],
+ "key": Literal["Authorization"],
+ "value": None,
+ },
+)
+
+
+AuthSettings = TypedDict(
+ "AuthSettings",
+ {
+ "petstore_auth": OAuth2AuthSetting,
+ "api_key": APIKeyAuthSetting,
+ "api_key_query": APIKeyAuthSetting,
+ "http_basic_test": BasicAuthSetting,
+ "bearer_test": BearerFormatAuthSetting,
+ "http_signature_test": HTTPSignatureAuthSetting,
+ },
+ total=False,
+)
+
+
+class HostSettingVariable(TypedDict):
+ description: str
+ default_value: str
+ enum_values: List[str]
+
+
+class HostSetting(TypedDict):
+ url: str
+ description: str
+ variables: NotRequired[Dict[str, HostSettingVariable]]
+
+
+class Configuration:
+ """This class contains various settings of the API client.
+
+ :param host: Base url.
+ :param ignore_operation_servers
+ Boolean to ignore operation servers for the API client.
+ Config will use `host` as the base url regardless of the operation servers.
+ :param api_key: Dict to store API key(s).
+ Each entry in the dict specifies an API key.
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is the API key secret.
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
+ The dict key is the name of the security scheme in the OAS specification.
+ The dict value is an API key prefix when generating the auth data.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param access_token: Access token.
+ :param signing_info: Configuration parameters for the HTTP signature security scheme.
+ Must be an instance of petstore_api.signing.HttpSigningConfiguration
+ :param server_index: Index to servers configuration.
+ :param server_variables: Mapping with string values to replace variables in
+ templated server configuration. The validation of enums is performed for
+ variables with defined enum values before.
+ :param server_operation_index: Mapping from operation ID to an index to server
+ configuration.
+ :param server_operation_variables: Mapping from operation ID to a mapping with
+ string values to replace variables in templated server configuration.
+ The validation of enums is performed for variables with defined enum
+ values before.
+ :param ssl_ca_cert: str - the path to a file of concatenated CA certificates
+ in PEM format.
+ :param retries: Number of retries for API requests.
+ :param ca_cert_data: verify the peer using concatenated CA certificate data
+ in PEM (str) or DER (bytes) format.
+
+ :Example:
+
+ API Key Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ cookieAuth: # name for the security scheme
+ type: apiKey
+ in: cookie
+ name: JSESSIONID # cookie name
+
+ You can programmatically set the cookie:
+
+conf = petstore_api.Configuration(
+ api_key={'cookieAuth': 'abc123'}
+ api_key_prefix={'cookieAuth': 'JSESSIONID'}
+)
+
+ The following cookie will be added to the HTTP request:
+ Cookie: JSESSIONID abc123
+
+ HTTP Basic Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: basic
+
+ Configure API client with HTTP basic authentication:
+
+conf = petstore_api.Configuration(
+ username='the-user',
+ password='the-password',
+)
+
+
+ HTTP Signature Authentication Example.
+ Given the following security scheme in the OpenAPI specification:
+ components:
+ securitySchemes:
+ http_basic_auth:
+ type: http
+ scheme: signature
+
+ Configure API client with HTTP signature authentication. Use the 'hs2019' signature scheme,
+ sign the HTTP requests with the RSA-SSA-PSS signature algorithm, and set the expiration time
+ of the signature to 5 minutes after the signature has been created.
+ Note you can use the constants defined in the petstore_api.signing module, and you can
+ also specify arbitrary HTTP headers to be included in the HTTP signature, except for the
+ 'Authorization' header, which is used to carry the signature.
+
+ One may be tempted to sign all headers by default, but in practice it rarely works.
+ This is because explicit proxies, transparent proxies, TLS termination endpoints or
+ load balancers may add/modify/remove headers. Include the HTTP headers that you know
+ are not going to be modified in transit.
+
+conf = petstore_api.Configuration(
+ signing_info = petstore_api.signing.HttpSigningConfiguration(
+ key_id = 'my-key-id',
+ private_key_path = 'rsa.pem',
+ signing_scheme = petstore_api.signing.SCHEME_HS2019,
+ signing_algorithm = petstore_api.signing.ALGORITHM_RSASSA_PSS,
+ signed_headers = [petstore_api.signing.HEADER_REQUEST_TARGET,
+ petstore_api.signing.HEADER_CREATED,
+ petstore_api.signing.HEADER_EXPIRES,
+ petstore_api.signing.HEADER_HOST,
+ petstore_api.signing.HEADER_DATE,
+ petstore_api.signing.HEADER_DIGEST,
+ 'Content-Type',
+ 'User-Agent'
+ ],
+ signature_max_validity = datetime.timedelta(minutes=5)
+ )
+)
+ """
+
+ _default: ClassVar[Optional[Self]] = None
+
+ def __init__(
+ self,
+ host: Optional[str]=None,
+ api_key: Optional[Dict[str, str]]=None,
+ api_key_prefix: Optional[Dict[str, str]]=None,
+ username: Optional[str]=None,
+ password: Optional[str]=None,
+ access_token: Optional[str]=None,
+ signing_info: Optional[HttpSigningConfiguration]=None,
+ server_index: Optional[int]=None,
+ server_variables: Optional[ServerVariablesT]=None,
+ server_operation_index: Optional[Dict[int, int]]=None,
+ server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
+ ignore_operation_servers: bool=False,
+ ssl_ca_cert: Optional[str]=None,
+ retries: Optional[int] = None,
+ ca_cert_data: Optional[Union[str, bytes]] = None,
+ *,
+ debug: Optional[bool] = None,
+ ) -> None:
+ """Constructor
+ """
+ self._base_path = "http://petstore.swagger.io:80/v2" if host is None else host
+ """Default Base url
+ """
+ self.server_index = 0 if server_index is None and host is None else server_index
+ self.server_operation_index = server_operation_index or {}
+ """Default server index
+ """
+ self.server_variables = server_variables or {}
+ self.server_operation_variables = server_operation_variables or {}
+ """Default server variables
+ """
+ self.ignore_operation_servers = ignore_operation_servers
+ """Ignore operation servers
+ """
+ self.temp_folder_path = None
+ """Temp file folder for downloading files
+ """
+ # Authentication Settings
+ self.api_key = {}
+ if api_key:
+ self.api_key = api_key
+ """dict to store API key(s)
+ """
+ self.api_key_prefix = {}
+ if api_key_prefix:
+ self.api_key_prefix = api_key_prefix
+ """dict to store API prefix (e.g. Bearer)
+ """
+ self.refresh_api_key_hook = None
+ """function hook to refresh API key if expired
+ """
+ self.username = username
+ """Username for HTTP basic authentication
+ """
+ self.password = password
+ """Password for HTTP basic authentication
+ """
+ self.access_token = access_token
+ """Access token
+ """
+ if signing_info is not None:
+ signing_info.host = host
+ self.signing_info = signing_info
+ """The HTTP signing configuration
+ """
+ self.logger = {}
+ """Logging Settings
+ """
+ self.logger["package_logger"] = logging.getLogger("petstore_api")
+ self.logger["urllib3_logger"] = logging.getLogger("urllib3")
+ self.logger_format = '%(asctime)s %(levelname)s %(message)s'
+ """Log format
+ """
+ self.logger_stream_handler = None
+ """Log stream handler
+ """
+ self.logger_file_handler: Optional[FileHandler] = None
+ """Log file handler
+ """
+ self.logger_file = None
+ """Debug file location
+ """
+ if debug is not None:
+ self.debug = debug
+ else:
+ self.__debug = False
+ """Debug switch
+ """
+
+ self.verify_ssl = True
+ """SSL/TLS verification
+ Set this to false to skip verifying SSL certificate when calling API
+ from https server.
+ """
+ self.ssl_ca_cert = ssl_ca_cert
+ """Set this to customize the certificate file to verify the peer.
+ """
+ self.ca_cert_data = ca_cert_data
+ """Set this to verify the peer using PEM (str) or DER (bytes)
+ certificate data.
+ """
+ self.cert_file = None
+ """client certificate file
+ """
+ self.key_file = None
+ """client key file
+ """
+ self.assert_hostname = None
+ """Set this to True/False to enable/disable SSL hostname verification.
+ """
+ self.tls_server_name = None
+ """SSL/TLS Server Name Indication (SNI)
+ Set this to the SNI value expected by the server.
+ """
+
+ self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
+ """urllib3 connection pool's maximum number of connections saved
+ per pool. urllib3 uses 1 connection as default value, but this is
+ not the best value when you are making a lot of possibly parallel
+ requests to the same host, which is often the case here.
+ cpu_count * 5 is used as default value to increase performance.
+ """
+
+ self.proxy: Optional[str] = None
+ """Proxy URL
+ """
+ self.proxy_headers = None
+ """Proxy headers
+ """
+ self.safe_chars_for_path_param = ''
+ """Safe chars for path_param
+ """
+ self.retries = retries
+ """Adding retries to override urllib3 default value 3
+ """
+ # Enable client side validation
+ self.client_side_validation = True
+
+ self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
+ """datetime format
+ """
+
+ self.date_format = "%Y-%m-%d"
+ """date format
+ """
+
+ def __deepcopy__(self, memo: Dict[int, Any]) -> Self:
+ cls = self.__class__
+ result = cls.__new__(cls)
+ memo[id(self)] = result
+ for k, v in self.__dict__.items():
+ if k not in ('logger', 'logger_file_handler'):
+ setattr(result, k, copy.deepcopy(v, memo))
+ # shallow copy of loggers
+ result.logger = copy.copy(self.logger)
+ # use setters to configure loggers
+ result.logger_file = self.logger_file
+ result.debug = self.debug
+ return result
+
+ def __setattr__(self, name: str, value: Any) -> None:
+ object.__setattr__(self, name, value)
+ if name == "signing_info" and value is not None:
+ # Ensure the host parameter from signing info is the same as
+ # Configuration.host.
+ value.host = self.host
+
+ @classmethod
+ def set_default(cls, default: Optional[Self]) -> None:
+ """Set default instance of configuration.
+
+ It stores default configuration, which can be
+ returned by get_default_copy method.
+
+ :param default: object of Configuration
+ """
+ cls._default = default
+
+ @classmethod
+ def get_default_copy(cls) -> Self:
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls) -> Self:
+ """Return the default configuration.
+
+ This method returns newly created, based on default constructor,
+ object of Configuration class or returns a copy of default
+ configuration.
+
+ :return: The configuration object.
+ """
+ if cls._default is None:
+ cls._default = cls()
+ return cls._default
+
+ @property
+ def logger_file(self) -> Optional[str]:
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ return self.__logger_file
+
+ @logger_file.setter
+ def logger_file(self, value: Optional[str]) -> None:
+ """The logger file.
+
+ If the logger_file is None, then add stream handler and remove file
+ handler. Otherwise, add file handler and remove stream handler.
+
+ :param value: The logger_file path.
+ :type: str
+ """
+ self.__logger_file = value
+ if self.__logger_file:
+ # If set logging file,
+ # then add file handler and remove stream handler.
+ self.logger_file_handler = logging.FileHandler(self.__logger_file)
+ self.logger_file_handler.setFormatter(self.logger_formatter)
+ for _, logger in self.logger.items():
+ logger.addHandler(self.logger_file_handler)
+
+ @property
+ def debug(self) -> bool:
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ return self.__debug
+
+ @debug.setter
+ def debug(self, value: bool) -> None:
+ """Debug status
+
+ :param value: The debug status, True or False.
+ :type: bool
+ """
+ self.__debug = value
+ if self.__debug:
+ # if debug status is True, turn on debug logging
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.DEBUG)
+ # turn on httplib debug
+ httplib.HTTPConnection.debuglevel = 1
+ else:
+ # if debug status is False, turn off debug logging,
+ # setting log level to default `logging.WARNING`
+ for _, logger in self.logger.items():
+ logger.setLevel(logging.WARNING)
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
+
+ @property
+ def logger_format(self) -> str:
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ return self.__logger_format
+
+ @logger_format.setter
+ def logger_format(self, value: str) -> None:
+ """The logger format.
+
+ The logger_formatter will be updated when sets logger_format.
+
+ :param value: The format string.
+ :type: str
+ """
+ self.__logger_format = value
+ self.logger_formatter = logging.Formatter(self.__logger_format)
+
+ def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]:
+ """Gets API key (with prefix if set).
+
+ :param identifier: The identifier of apiKey.
+ :param alias: The alternative identifier of apiKey.
+ :return: The token for api key authentication.
+ """
+ if self.refresh_api_key_hook is not None:
+ self.refresh_api_key_hook(self)
+ key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
+ if key:
+ prefix = self.api_key_prefix.get(identifier)
+ if prefix:
+ return "%s %s" % (prefix, key)
+ else:
+ return key
+
+ return None
+
+ def get_basic_auth_token(self) -> Optional[str]:
+ """Gets HTTP basic authentication header (string).
+
+ :return: The token for basic HTTP authentication.
+ """
+ username = ""
+ if self.username is not None:
+ username = self.username
+ password = ""
+ if self.password is not None:
+ password = self.password
+ return urllib3.util.make_headers(
+ basic_auth=username + ':' + password
+ ).get('authorization')
+
+ def auth_settings(self)-> AuthSettings:
+ """Gets Auth Settings dict for api client.
+
+ :return: The Auth Settings information dict.
+ """
+ auth: AuthSettings = {}
+ if self.access_token is not None:
+ auth['petstore_auth'] = {
+ 'type': 'oauth2',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ if 'api_key' in self.api_key:
+ auth['api_key'] = {
+ 'type': 'api_key',
+ 'in': 'header',
+ 'key': 'api_key',
+ 'value': self.get_api_key_with_prefix(
+ 'api_key',
+ ),
+ }
+ if 'api_key_query' in self.api_key:
+ auth['api_key_query'] = {
+ 'type': 'api_key',
+ 'in': 'query',
+ 'key': 'api_key_query',
+ 'value': self.get_api_key_with_prefix(
+ 'api_key_query',
+ ),
+ }
+ if self.username is not None and self.password is not None:
+ auth['http_basic_test'] = {
+ 'type': 'basic',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': self.get_basic_auth_token()
+ }
+ if self.access_token is not None:
+ auth['bearer_test'] = {
+ 'type': 'bearer',
+ 'in': 'header',
+ 'format': 'JWT',
+ 'key': 'Authorization',
+ 'value': 'Bearer ' + self.access_token
+ }
+ if self.signing_info is not None:
+ auth['http_signature_test'] = {
+ 'type': 'http-signature',
+ 'in': 'header',
+ 'key': 'Authorization',
+ 'value': None # Signature headers are calculated for every HTTP request
+ }
+ return auth
+
+ def to_debug_report(self) -> str:
+ """Gets the essential information for debugging.
+
+ :return: The report for debugging.
+ """
+ return "Python SDK Debug Report:\n"\
+ "OS: {env}\n"\
+ "Python Version: {pyversion}\n"\
+ "Version of the API: 1.0.0\n"\
+ "SDK Package Version: 1.0.0".\
+ format(env=sys.platform, pyversion=sys.version)
+
+ def get_host_settings(self) -> List[HostSetting]:
+ """Gets an array of host settings
+
+ :return: An array of host settings
+ """
+ return [
+ {
+ 'url': "http://{server}.swagger.io:{port}/v2",
+ 'description': "petstore server",
+ 'variables': {
+ 'server': {
+ 'description': "No description provided",
+ 'default_value': "petstore",
+ 'enum_values': [
+ "petstore",
+ "qa-petstore",
+ "dev-petstore"
+ ]
+ },
+ 'port': {
+ 'description': "No description provided",
+ 'default_value': "80",
+ 'enum_values': [
+ "80",
+ "8080"
+ ]
+ }
+ }
+ },
+ {
+ 'url': "https://localhost:8080/{version}",
+ 'description': "The local server",
+ 'variables': {
+ 'version': {
+ 'description': "No description provided",
+ 'default_value': "v2",
+ 'enum_values': [
+ "v1",
+ "v2"
+ ]
+ }
+ }
+ },
+ {
+ 'url': "https://127.0.0.1/no_varaible",
+ 'description': "The local server without variables",
+ }
+ ]
+
+ def get_host_from_settings(
+ self,
+ index: Optional[int],
+ variables: Optional[ServerVariablesT]=None,
+ servers: Optional[List[HostSetting]]=None,
+ ) -> str:
+ """Gets host URL based on the index and variables
+ :param index: array index of the host settings
+ :param variables: hash of variable and the corresponding value
+ :param servers: an array of host settings or None
+ :return: URL based on host settings
+ """
+ if index is None:
+ return self._base_path
+
+ variables = {} if variables is None else variables
+ servers = self.get_host_settings() if servers is None else servers
+
+ try:
+ server = servers[index]
+ except IndexError:
+ raise ValueError(
+ "Invalid index {0} when selecting the host settings. "
+ "Must be less than {1}".format(index, len(servers)))
+
+ url = server['url']
+
+ # go through variables and replace placeholders
+ for variable_name, variable in server.get('variables', {}).items():
+ used_value = variables.get(
+ variable_name, variable['default_value'])
+
+ if 'enum_values' in variable \
+ and used_value not in variable['enum_values']:
+ raise ValueError(
+ "The variable `{0}` in the host URL has invalid value "
+ "{1}. Must be {2}.".format(
+ variable_name, variables[variable_name],
+ variable['enum_values']))
+
+ url = url.replace("{" + variable_name + "}", used_value)
+
+ return url
+
+ @property
+ def host(self) -> str:
+ """Return generated host."""
+ return self.get_host_from_settings(self.server_index, variables=self.server_variables)
+
+ @host.setter
+ def host(self, value: str) -> None:
+ """Fix base path."""
+ self._base_path = value
+ self.server_index = None
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py
new file mode 100644
index 00000000000..195e150623d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/exceptions.py
@@ -0,0 +1,216 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+from typing import Any, Optional
+from typing_extensions import Self
+
+class OpenApiException(Exception):
+ """The base exception class for all OpenAPIExceptions"""
+
+
+class ApiTypeError(OpenApiException, TypeError):
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
+ key_type=None) -> None:
+ """ Raises an exception for TypeErrors
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list): a list of keys an indices to get to the
+ current_item
+ None if unset
+ valid_classes (tuple): the primitive classes that current item
+ should be an instance of
+ None if unset
+ key_type (bool): False if our value is a value in a dict
+ True if it is a key in a dict
+ False if our item is an item in a list
+ None if unset
+ """
+ self.path_to_item = path_to_item
+ self.valid_classes = valid_classes
+ self.key_type = key_type
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiTypeError, self).__init__(full_msg)
+
+
+class ApiValueError(OpenApiException, ValueError):
+ def __init__(self, msg, path_to_item=None) -> None:
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (list) the path to the exception in the
+ received_data dict. None if unset
+ """
+
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiValueError, self).__init__(full_msg)
+
+
+class ApiAttributeError(OpenApiException, AttributeError):
+ def __init__(self, msg, path_to_item=None) -> None:
+ """
+ Raised when an attribute reference or assignment fails.
+
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiAttributeError, self).__init__(full_msg)
+
+
+class ApiKeyError(OpenApiException, KeyError):
+ def __init__(self, msg, path_to_item=None) -> None:
+ """
+ Args:
+ msg (str): the exception message
+
+ Keyword Args:
+ path_to_item (None/list) the path to the exception in the
+ received_data dict
+ """
+ self.path_to_item = path_to_item
+ full_msg = msg
+ if path_to_item:
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
+ super(ApiKeyError, self).__init__(full_msg)
+
+
+class ApiException(OpenApiException):
+
+ def __init__(
+ self,
+ status=None,
+ reason=None,
+ http_resp=None,
+ *,
+ body: Optional[str] = None,
+ data: Optional[Any] = None,
+ ) -> None:
+ self.status = status
+ self.reason = reason
+ self.body = body
+ self.data = data
+ self.headers = None
+
+ if http_resp:
+ if self.status is None:
+ self.status = http_resp.status
+ if self.reason is None:
+ self.reason = http_resp.reason
+ if self.body is None:
+ try:
+ self.body = http_resp.data.decode('utf-8')
+ except Exception:
+ pass
+ self.headers = http_resp.getheaders()
+
+ @classmethod
+ def from_response(
+ cls,
+ *,
+ http_resp,
+ body: Optional[str],
+ data: Optional[Any],
+ ) -> Self:
+ if http_resp.status == 400:
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 401:
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 403:
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 404:
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
+
+ # Added new conditions for 409 and 422
+ if http_resp.status == 409:
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
+
+ if http_resp.status == 422:
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
+
+ if 500 <= http_resp.status <= 599:
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
+ raise ApiException(http_resp=http_resp, body=body, data=data)
+
+ 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.data or self.body:
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
+
+ return error_message
+
+
+class BadRequestException(ApiException):
+ pass
+
+
+class NotFoundException(ApiException):
+ pass
+
+
+class UnauthorizedException(ApiException):
+ pass
+
+
+class ForbiddenException(ApiException):
+ pass
+
+
+class ServiceException(ApiException):
+ pass
+
+
+class ConflictException(ApiException):
+ """Exception for HTTP 409 Conflict."""
+ pass
+
+
+class UnprocessableEntityException(ApiException):
+ """Exception for HTTP 422 Unprocessable Entity."""
+ pass
+
+
+def render_path(path_to_item):
+ """Returns a string representation of a path"""
+ result = ""
+ for pth in path_to_item:
+ if isinstance(pth, int):
+ result += "[{0}]".format(pth)
+ else:
+ result += "['{0}']".format(pth)
+ return result
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/__init__.py
new file mode 100644
index 00000000000..6d488f7a8d6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/__init__.py
@@ -0,0 +1,254 @@
+# coding: utf-8
+
+# flake8: noqa
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+if __import__("typing").TYPE_CHECKING:
+ # import models into model package
+ from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
+ from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+ from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
+ from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
+ from petstore_api.models.all_of_super_model import AllOfSuperModel
+ from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+ from petstore_api.models.animal import Animal
+ from petstore_api.models.any_of_color import AnyOfColor
+ from petstore_api.models.any_of_pig import AnyOfPig
+ from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel
+ from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+ from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+ from petstore_api.models.array_test import ArrayTest
+ from petstore_api.models.base_discriminator import BaseDiscriminator
+ from petstore_api.models.basque_pig import BasquePig
+ from petstore_api.models.bathing import Bathing
+ from petstore_api.models.capitalization import Capitalization
+ from petstore_api.models.cat import Cat
+ from petstore_api.models.category import Category
+ from petstore_api.models.circular_all_of_ref import CircularAllOfRef
+ from petstore_api.models.circular_reference_model import CircularReferenceModel
+ from petstore_api.models.class_model import ClassModel
+ from petstore_api.models.client import Client
+ from petstore_api.models.color import Color
+ from petstore_api.models.creature import Creature
+ from petstore_api.models.creature_info import CreatureInfo
+ from petstore_api.models.danish_pig import DanishPig
+ from petstore_api.models.data_output_format import DataOutputFormat
+ from petstore_api.models.deprecated_object import DeprecatedObject
+ from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
+ from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
+ from petstore_api.models.dog import Dog
+ from petstore_api.models.dummy_model import DummyModel
+ from petstore_api.models.enum_arrays import EnumArrays
+ from petstore_api.models.enum_class import EnumClass
+ from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt
+ from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue
+ from petstore_api.models.enum_string1 import EnumString1
+ from petstore_api.models.enum_string2 import EnumString2
+ from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt
+ from petstore_api.models.enum_test import EnumTest
+ from petstore_api.models.feeding import Feeding
+ from petstore_api.models.file import File
+ from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+ from petstore_api.models.first_ref import FirstRef
+ from petstore_api.models.foo import Foo
+ from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+ from petstore_api.models.format_test import FormatTest
+ from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+ from petstore_api.models.health_check_result import HealthCheckResult
+ from petstore_api.models.hunting_dog import HuntingDog
+ from petstore_api.models.info import Info
+ from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
+ from petstore_api.models.input_all_of import InputAllOf
+ from petstore_api.models.int_or_string import IntOrString
+ from petstore_api.models.list_class import ListClass
+ from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel
+ from petstore_api.models.map_test import MapTest
+ from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+ from petstore_api.models.model200_response import Model200Response
+ from petstore_api.models.model_api_response import ModelApiResponse
+ from petstore_api.models.model_field import ModelField
+ from petstore_api.models.model_return import ModelReturn
+ from petstore_api.models.multi_arrays import MultiArrays
+ from petstore_api.models.name import Name
+ from petstore_api.models.nullable_class import NullableClass
+ from petstore_api.models.nullable_property import NullableProperty
+ from petstore_api.models.number_only import NumberOnly
+ from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties
+ from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+ from petstore_api.models.one_of_enum_string import OneOfEnumString
+ from petstore_api.models.order import Order
+ from petstore_api.models.outer_composite import OuterComposite
+ from petstore_api.models.outer_enum import OuterEnum
+ from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+ from petstore_api.models.outer_enum_integer import OuterEnumInteger
+ from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+ from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+ from petstore_api.models.parent import Parent
+ from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict
+ from petstore_api.models.pet import Pet
+ from petstore_api.models.pig import Pig
+ from petstore_api.models.pony_sizes import PonySizes
+ from petstore_api.models.poop_cleaning import PoopCleaning
+ from petstore_api.models.primitive_string import PrimitiveString
+ from petstore_api.models.property_map import PropertyMap
+ from petstore_api.models.property_name_collision import PropertyNameCollision
+ from petstore_api.models.read_only_first import ReadOnlyFirst
+ from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
+ from petstore_api.models.second_ref import SecondRef
+ from petstore_api.models.self_reference_model import SelfReferenceModel
+ from petstore_api.models.single_ref_type import SingleRefType
+ from petstore_api.models.special_character_enum import SpecialCharacterEnum
+ from petstore_api.models.special_model_name import SpecialModelName
+ from petstore_api.models.special_name import SpecialName
+ from petstore_api.models.tag import Tag
+ from petstore_api.models.task import Task
+ from petstore_api.models.task_activity import TaskActivity
+ from petstore_api.models.test_enum import TestEnum
+ from petstore_api.models.test_enum_with_default import TestEnumWithDefault
+ from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response
+ from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response
+ from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
+ from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault
+ from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
+ from petstore_api.models.tiger import Tiger
+ from petstore_api.models.type import Type
+ from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties
+ from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties
+ from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
+ from petstore_api.models.user import User
+ from petstore_api.models.with_nested_one_of import WithNestedOneOf
+
+else:
+ from lazy_imports import LazyModule, as_package, load
+
+ load(
+ LazyModule(
+ *as_package(__file__),
+ """# import models into model package
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
+from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
+from petstore_api.models.all_of_super_model import AllOfSuperModel
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+from petstore_api.models.animal import Animal
+from petstore_api.models.any_of_color import AnyOfColor
+from petstore_api.models.any_of_pig import AnyOfPig
+from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+from petstore_api.models.array_test import ArrayTest
+from petstore_api.models.base_discriminator import BaseDiscriminator
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.bathing import Bathing
+from petstore_api.models.capitalization import Capitalization
+from petstore_api.models.cat import Cat
+from petstore_api.models.category import Category
+from petstore_api.models.circular_all_of_ref import CircularAllOfRef
+from petstore_api.models.circular_reference_model import CircularReferenceModel
+from petstore_api.models.class_model import ClassModel
+from petstore_api.models.client import Client
+from petstore_api.models.color import Color
+from petstore_api.models.creature import Creature
+from petstore_api.models.creature_info import CreatureInfo
+from petstore_api.models.danish_pig import DanishPig
+from petstore_api.models.data_output_format import DataOutputFormat
+from petstore_api.models.deprecated_object import DeprecatedObject
+from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
+from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
+from petstore_api.models.dog import Dog
+from petstore_api.models.dummy_model import DummyModel
+from petstore_api.models.enum_arrays import EnumArrays
+from petstore_api.models.enum_class import EnumClass
+from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt
+from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue
+from petstore_api.models.enum_string1 import EnumString1
+from petstore_api.models.enum_string2 import EnumString2
+from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt
+from petstore_api.models.enum_test import EnumTest
+from petstore_api.models.feeding import Feeding
+from petstore_api.models.file import File
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+from petstore_api.models.first_ref import FirstRef
+from petstore_api.models.foo import Foo
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+from petstore_api.models.format_test import FormatTest
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+from petstore_api.models.health_check_result import HealthCheckResult
+from petstore_api.models.hunting_dog import HuntingDog
+from petstore_api.models.info import Info
+from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
+from petstore_api.models.input_all_of import InputAllOf
+from petstore_api.models.int_or_string import IntOrString
+from petstore_api.models.list_class import ListClass
+from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel
+from petstore_api.models.map_test import MapTest
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+from petstore_api.models.model200_response import Model200Response
+from petstore_api.models.model_api_response import ModelApiResponse
+from petstore_api.models.model_field import ModelField
+from petstore_api.models.model_return import ModelReturn
+from petstore_api.models.multi_arrays import MultiArrays
+from petstore_api.models.name import Name
+from petstore_api.models.nullable_class import NullableClass
+from petstore_api.models.nullable_property import NullableProperty
+from petstore_api.models.number_only import NumberOnly
+from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+from petstore_api.models.one_of_enum_string import OneOfEnumString
+from petstore_api.models.order import Order
+from petstore_api.models.outer_composite import OuterComposite
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+from petstore_api.models.parent import Parent
+from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict
+from petstore_api.models.pet import Pet
+from petstore_api.models.pig import Pig
+from petstore_api.models.pony_sizes import PonySizes
+from petstore_api.models.poop_cleaning import PoopCleaning
+from petstore_api.models.primitive_string import PrimitiveString
+from petstore_api.models.property_map import PropertyMap
+from petstore_api.models.property_name_collision import PropertyNameCollision
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
+from petstore_api.models.second_ref import SecondRef
+from petstore_api.models.self_reference_model import SelfReferenceModel
+from petstore_api.models.single_ref_type import SingleRefType
+from petstore_api.models.special_character_enum import SpecialCharacterEnum
+from petstore_api.models.special_model_name import SpecialModelName
+from petstore_api.models.special_name import SpecialName
+from petstore_api.models.tag import Tag
+from petstore_api.models.task import Task
+from petstore_api.models.task_activity import TaskActivity
+from petstore_api.models.test_enum import TestEnum
+from petstore_api.models.test_enum_with_default import TestEnumWithDefault
+from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response
+from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response
+from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
+from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault
+from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
+from petstore_api.models.tiger import Tiger
+from petstore_api.models.type import Type
+from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties
+from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties
+from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
+from petstore_api.models.user import User
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
+
+""",
+ name=__name__,
+ doc=__doc__,
+ )
+ )
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py
new file mode 100644
index 00000000000..291b5e55e35
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_any_type.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class AdditionalPropertiesAnyType(BaseModel):
+ """
+ AdditionalPropertiesAnyType
+ """ # noqa: E501
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesAnyType from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesAnyType from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py
new file mode 100644
index 00000000000..220f23a423b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_class.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class AdditionalPropertiesClass(BaseModel):
+ """
+ AdditionalPropertiesClass
+ """ # noqa: E501
+ map_property: Optional[Dict[str, StrictStr]] = None
+ map_of_map_property: Optional[Dict[str, Dict[str, StrictStr]]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["map_property", "map_of_map_property"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesClass from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "map_property": obj.get("map_property"),
+ "map_of_map_property": obj.get("map_of_map_property")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py
new file mode 100644
index 00000000000..00707c3c481
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_object.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class AdditionalPropertiesObject(BaseModel):
+ """
+ AdditionalPropertiesObject
+ """ # noqa: E501
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesObject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesObject from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py
new file mode 100644
index 00000000000..d8049b519ed
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/additional_properties_with_description_only.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class AdditionalPropertiesWithDescriptionOnly(BaseModel):
+ """
+ AdditionalPropertiesWithDescriptionOnly
+ """ # noqa: E501
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AdditionalPropertiesWithDescriptionOnly from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py
new file mode 100644
index 00000000000..b63bba1206a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_super_model.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class AllOfSuperModel(BaseModel):
+ """
+ AllOfSuperModel
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, alias="_name")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AllOfSuperModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AllOfSuperModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_name": obj.get("_name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py
new file mode 100644
index 00000000000..e3fa084b070
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/all_of_with_single_ref.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.single_ref_type import SingleRefType
+from typing import Optional, Set
+from typing_extensions import Self
+
+class AllOfWithSingleRef(BaseModel):
+ """
+ AllOfWithSingleRef
+ """ # noqa: E501
+ username: Optional[StrictStr] = None
+ single_ref_type: Optional[SingleRefType] = Field(default=None, alias="SingleRefType")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["username", "SingleRefType"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of AllOfWithSingleRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of AllOfWithSingleRef from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "username": obj.get("username"),
+ "SingleRefType": obj.get("SingleRefType")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py
new file mode 100644
index 00000000000..131ad8d0ed6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/animal.py
@@ -0,0 +1,119 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from importlib import import_module
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional, Union
+from typing import Optional, Set
+from typing_extensions import Self
+
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from petstore_api.models.cat import Cat
+ from petstore_api.models.dog import Dog
+
+class Animal(BaseModel):
+ """
+ Animal
+ """ # noqa: E501
+ class_name: StrictStr = Field(alias="className")
+ color: Optional[StrictStr] = 'red'
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["className", "color"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ # JSON field name that stores the object type
+ __discriminator_property_name: ClassVar[str] = 'className'
+
+ # discriminator mappings
+ __discriminator_value_class_map: ClassVar[Dict[str, str]] = {
+ 'Cat': 'Cat','Dog': 'Dog'
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Union[Cat, Dog]]:
+ """Create an instance of Animal from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[Cat, Dog]]:
+ """Create an instance of Animal from a dict"""
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type == 'Cat':
+ return import_module("petstore_api.models.cat").Cat.from_dict(obj)
+ if object_type == 'Dog':
+ return import_module("petstore_api.models.dog").Dog.from_dict(obj)
+
+ raise ValueError("Animal failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py
new file mode 100644
index 00000000000..f6d277e7949
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_color.py
@@ -0,0 +1,156 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import List, Optional
+from typing_extensions import Annotated
+from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
+from typing_extensions import Literal, Self
+from pydantic import Field
+
+ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"]
+
+class AnyOfColor(BaseModel):
+ """
+ Any of RGB array, RGBA array, or hex string.
+ """
+
+ # data type: List[int]
+ anyof_schema_1_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=3, max_length=3)]] = Field(default=None, description="RGB three element array with values 0-255.")
+ # data type: List[int]
+ anyof_schema_2_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=4, max_length=4)]] = Field(default=None, description="RGBA four element array with values 0-255.")
+ # data type: str
+ anyof_schema_3_validator: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default=None, description="Hex color string, such as #00FF00.")
+ if TYPE_CHECKING:
+ actual_instance: Optional[Union[List[int], str]] = None
+ else:
+ actual_instance: Any = None
+ any_of_schemas: Set[str] = { "List[int]", "str" }
+
+ model_config = {
+ "validate_assignment": True,
+ "protected_namespaces": (),
+ }
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ instance = AnyOfColor.model_construct()
+ error_messages = []
+ # validate data type: List[int]
+ try:
+ instance.anyof_schema_1_validator = v
+ return v
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # validate data type: List[int]
+ try:
+ instance.anyof_schema_2_validator = v
+ return v
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # validate data type: str
+ try:
+ instance.anyof_schema_3_validator = v
+ return v
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ if error_messages:
+ # no match
+ raise ValueError("No match found when setting the actual_instance in AnyOfColor with anyOf schemas: List[int], str. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ # deserialize data into List[int]
+ try:
+ # validation
+ instance.anyof_schema_1_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.anyof_schema_1_validator
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into List[int]
+ try:
+ # validation
+ instance.anyof_schema_2_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.anyof_schema_2_validator
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into str
+ try:
+ # validation
+ instance.anyof_schema_3_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.anyof_schema_3_validator
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into AnyOfColor with anyOf schemas: List[int], str. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], List[int], str]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py
new file mode 100644
index 00000000000..c949e136f41
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/any_of_pig.py
@@ -0,0 +1,134 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Optional
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.danish_pig import DanishPig
+from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
+from typing_extensions import Literal, Self
+from pydantic import Field
+
+ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"]
+
+class AnyOfPig(BaseModel):
+ """
+ AnyOfPig
+ """
+
+ # data type: BasquePig
+ anyof_schema_1_validator: Optional[BasquePig] = None
+ # data type: DanishPig
+ anyof_schema_2_validator: Optional[DanishPig] = None
+ if TYPE_CHECKING:
+ actual_instance: Optional[Union[BasquePig, DanishPig]] = None
+ else:
+ actual_instance: Any = None
+ any_of_schemas: Set[str] = { "BasquePig", "DanishPig" }
+
+ model_config = {
+ "validate_assignment": True,
+ "protected_namespaces": (),
+ }
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_anyof(cls, v):
+ instance = AnyOfPig.model_construct()
+ error_messages = []
+ # validate data type: BasquePig
+ if not isinstance(v, BasquePig):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
+ else:
+ return v
+
+ # validate data type: DanishPig
+ if not isinstance(v, DanishPig):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
+ else:
+ return v
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ # anyof_schema_1_validator: Optional[BasquePig] = None
+ try:
+ instance.actual_instance = BasquePig.from_json(json_str)
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # anyof_schema_2_validator: Optional[DanishPig] = None
+ try:
+ instance.actual_instance = DanishPig.from_json(json_str)
+ return instance
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if error_messages:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], BasquePig, DanishPig]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py
new file mode 100644
index 00000000000..80d4aa68916
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_model.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.tag import Tag
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ArrayOfArrayOfModel(BaseModel):
+ """
+ ArrayOfArrayOfModel
+ """ # noqa: E501
+ another_property: Optional[List[List[Tag]]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["another_property"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ArrayOfArrayOfModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in another_property (list of list)
+ _items = []
+ if self.another_property:
+ for _item_another_property in self.another_property:
+ if _item_another_property:
+ _items.append(
+ [_inner_item.to_dict() for _inner_item in _item_another_property if _inner_item is not None]
+ )
+ _dict['another_property'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ArrayOfArrayOfModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "another_property": [
+ [Tag.from_dict(_inner_item) for _inner_item in _item]
+ for _item in obj["another_property"]
+ ] if obj.get("another_property") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py
new file mode 100644
index 00000000000..847ae88c4ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_array_of_number_only.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ArrayOfArrayOfNumberOnly(BaseModel):
+ """
+ ArrayOfArrayOfNumberOnly
+ """ # noqa: E501
+ array_array_number: Optional[List[List[StrictFloat]]] = Field(default=None, alias="ArrayArrayNumber")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["ArrayArrayNumber"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ArrayOfArrayOfNumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ArrayOfArrayOfNumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "ArrayArrayNumber": obj.get("ArrayArrayNumber")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py
new file mode 100644
index 00000000000..4634914c33e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_of_number_only.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ArrayOfNumberOnly(BaseModel):
+ """
+ ArrayOfNumberOnly
+ """ # noqa: E501
+ array_number: Optional[List[StrictFloat]] = Field(default=None, alias="ArrayNumber")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["ArrayNumber"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ArrayOfNumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ArrayOfNumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "ArrayNumber": obj.get("ArrayNumber")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py
new file mode 100644
index 00000000000..9cadd4e7beb
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/array_test.py
@@ -0,0 +1,120 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Annotated
+from petstore_api.models.read_only_first import ReadOnlyFirst
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ArrayTest(BaseModel):
+ """
+ ArrayTest
+ """ # noqa: E501
+ array_of_string: Optional[Annotated[List[StrictStr], Field(min_length=0, max_length=3)]] = None
+ array_of_nullable_float: Optional[List[Optional[StrictFloat]]] = None
+ array_array_of_integer: Optional[List[List[StrictInt]]] = None
+ array_array_of_model: Optional[List[List[ReadOnlyFirst]]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["array_of_string", "array_of_nullable_float", "array_array_of_integer", "array_array_of_model"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ArrayTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in array_array_of_model (list of list)
+ _items = []
+ if self.array_array_of_model:
+ for _item_array_array_of_model in self.array_array_of_model:
+ if _item_array_array_of_model:
+ _items.append(
+ [_inner_item.to_dict() for _inner_item in _item_array_array_of_model if _inner_item is not None]
+ )
+ _dict['array_array_of_model'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ArrayTest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "array_of_string": obj.get("array_of_string"),
+ "array_of_nullable_float": obj.get("array_of_nullable_float"),
+ "array_array_of_integer": obj.get("array_array_of_integer"),
+ "array_array_of_model": [
+ [ReadOnlyFirst.from_dict(_inner_item) for _inner_item in _item]
+ for _item in obj["array_array_of_model"]
+ ] if obj.get("array_array_of_model") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py
new file mode 100644
index 00000000000..40b49a2fca7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/base_discriminator.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from importlib import import_module
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional, Union
+from typing import Optional, Set
+from typing_extensions import Self
+
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from petstore_api.models.primitive_string import PrimitiveString
+ from petstore_api.models.info import Info
+
+class BaseDiscriminator(BaseModel):
+ """
+ BaseDiscriminator
+ """ # noqa: E501
+ type_name: Optional[StrictStr] = Field(default=None, alias="_typeName")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_typeName"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ # JSON field name that stores the object type
+ __discriminator_property_name: ClassVar[str] = '_typeName'
+
+ # discriminator mappings
+ __discriminator_value_class_map: ClassVar[Dict[str, str]] = {
+ 'string': 'PrimitiveString','Info': 'Info'
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Union[PrimitiveString, Info]]:
+ """Create an instance of BaseDiscriminator from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[PrimitiveString, Info]]:
+ """Create an instance of BaseDiscriminator from a dict"""
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type == 'PrimitiveString':
+ return import_module("petstore_api.models.primitive_string").PrimitiveString.from_dict(obj)
+ if object_type == 'Info':
+ return import_module("petstore_api.models.info").Info.from_dict(obj)
+
+ raise ValueError("BaseDiscriminator failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py
new file mode 100644
index 00000000000..4a5b9e3bcb9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/basque_pig.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class BasquePig(BaseModel):
+ """
+ BasquePig
+ """ # noqa: E501
+ class_name: StrictStr = Field(alias="className")
+ color: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["className", "color"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of BasquePig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of BasquePig from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "className": obj.get("className"),
+ "color": obj.get("color")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py
new file mode 100644
index 00000000000..289d9d4670a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/bathing.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Bathing(BaseModel):
+ """
+ Bathing
+ """ # noqa: E501
+ task_name: StrictStr
+ function_name: StrictStr
+ content: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["task_name", "function_name", "content"]
+
+ @field_validator('task_name')
+ def task_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['cleaning_deep']):
+ raise ValueError("must be one of enum values ('cleaning_deep')")
+ return value
+
+ @field_validator('function_name')
+ def function_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['care_nourish']):
+ raise ValueError("must be one of enum values ('care_nourish')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Bathing from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Bathing from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "task_name": obj.get("task_name"),
+ "function_name": obj.get("function_name"),
+ "content": obj.get("content")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py
new file mode 100644
index 00000000000..d98aa21e532
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/capitalization.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Capitalization(BaseModel):
+ """
+ Capitalization
+ """ # noqa: E501
+ small_camel: Optional[StrictStr] = Field(default=None, alias="smallCamel")
+ capital_camel: Optional[StrictStr] = Field(default=None, alias="CapitalCamel")
+ small_snake: Optional[StrictStr] = Field(default=None, alias="small_Snake")
+ capital_snake: Optional[StrictStr] = Field(default=None, alias="Capital_Snake")
+ sca_eth_flow_points: Optional[StrictStr] = Field(default=None, alias="SCA_ETH_Flow_Points")
+ att_name: Optional[StrictStr] = Field(default=None, description="Name of the pet ", alias="ATT_NAME")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["smallCamel", "CapitalCamel", "small_Snake", "Capital_Snake", "SCA_ETH_Flow_Points", "ATT_NAME"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Capitalization from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Capitalization from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "smallCamel": obj.get("smallCamel"),
+ "CapitalCamel": obj.get("CapitalCamel"),
+ "small_Snake": obj.get("small_Snake"),
+ "Capital_Snake": obj.get("Capital_Snake"),
+ "SCA_ETH_Flow_Points": obj.get("SCA_ETH_Flow_Points"),
+ "ATT_NAME": obj.get("ATT_NAME")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py
new file mode 100644
index 00000000000..86002178c90
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/cat.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import ConfigDict, StrictBool
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.animal import Animal
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Cat(Animal):
+ """
+ Cat
+ """ # noqa: E501
+ declawed: Optional[StrictBool] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["className", "color", "declawed"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Cat from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Cat from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "className": obj.get("className"),
+ "color": obj.get("color") if obj.get("color") is not None else 'red',
+ "declawed": obj.get("declawed")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py
new file mode 100644
index 00000000000..c659f184572
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/category.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Category(BaseModel):
+ """
+ Category
+ """ # noqa: E501
+ id: Optional[StrictInt] = None
+ name: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Category from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Category from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name") if obj.get("name") is not None else 'default-name'
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py
new file mode 100644
index 00000000000..d3b6cbe57ea
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_all_of_ref.py
@@ -0,0 +1,112 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class CircularAllOfRef(BaseModel):
+ """
+ CircularAllOfRef
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, alias="_name")
+ second_circular_all_of_ref: Optional[List[SecondCircularAllOfRef]] = Field(default=None, alias="secondCircularAllOfRef")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_name", "secondCircularAllOfRef"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of CircularAllOfRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in second_circular_all_of_ref (list)
+ _items = []
+ if self.second_circular_all_of_ref:
+ for _item_second_circular_all_of_ref in self.second_circular_all_of_ref:
+ if _item_second_circular_all_of_ref:
+ _items.append(_item_second_circular_all_of_ref.to_dict())
+ _dict['secondCircularAllOfRef'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of CircularAllOfRef from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_name": obj.get("_name"),
+ "secondCircularAllOfRef": [SecondCircularAllOfRef.from_dict(_item) for _item in obj["secondCircularAllOfRef"]] if obj.get("secondCircularAllOfRef") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
+# TODO: Rewrite to not use raise_errors
+CircularAllOfRef.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py
new file mode 100644
index 00000000000..8c118f3c09b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/circular_reference_model.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class CircularReferenceModel(BaseModel):
+ """
+ CircularReferenceModel
+ """ # noqa: E501
+ size: Optional[StrictInt] = None
+ nested: Optional[FirstRef] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["size", "nested"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of CircularReferenceModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of nested
+ if self.nested:
+ _dict['nested'] = self.nested.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of CircularReferenceModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "size": obj.get("size"),
+ "nested": FirstRef.from_dict(obj["nested"]) if obj.get("nested") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.first_ref import FirstRef
+# TODO: Rewrite to not use raise_errors
+CircularReferenceModel.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py
new file mode 100644
index 00000000000..06f8f91b83c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/class_model.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ClassModel(BaseModel):
+ """
+ Model for testing model with \"_class\" property
+ """ # noqa: E501
+ var_class: Optional[StrictStr] = Field(default=None, alias="_class")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_class"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ClassModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ClassModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_class": obj.get("_class")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py
new file mode 100644
index 00000000000..d3376d62357
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/client.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Client(BaseModel):
+ """
+ Client
+ """ # noqa: E501
+ client: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["client"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Client from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Client from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "client": obj.get("client")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py
new file mode 100644
index 00000000000..bb740fb597d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/color.py
@@ -0,0 +1,167 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+import pprint
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Any, List, Optional
+from typing_extensions import Annotated
+from pydantic import StrictStr, Field
+from typing import Union, List, Set, Optional, Dict
+from typing_extensions import Literal, Self
+
+COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"]
+
+class Color(BaseModel):
+ """
+ RGB array, RGBA array, or hex string.
+ """
+ # data type: List[int]
+ oneof_schema_1_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=3, max_length=3)]] = Field(default=None, description="RGB three element array with values 0-255.")
+ # data type: List[int]
+ oneof_schema_2_validator: Optional[Annotated[List[Annotated[int, Field(le=255, strict=True, ge=0)]], Field(min_length=4, max_length=4)]] = Field(default=None, description="RGBA four element array with values 0-255.")
+ # data type: str
+ oneof_schema_3_validator: Optional[Annotated[str, Field(min_length=7, strict=True, max_length=7)]] = Field(default=None, description="Hex color string, such as #00FF00.")
+ actual_instance: Optional[Union[List[int], str]] = None
+ one_of_schemas: Set[str] = { "List[int]", "str" }
+
+ model_config = ConfigDict(
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ if v is None:
+ return v
+
+ instance = Color.model_construct()
+ error_messages = []
+ match = 0
+ # validate data type: List[int]
+ try:
+ instance.oneof_schema_1_validator = v
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # validate data type: List[int]
+ try:
+ instance.oneof_schema_2_validator = v
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # validate data type: str
+ try:
+ instance.oneof_schema_3_validator = v
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when setting `actual_instance` in Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when setting `actual_instance` in Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: Optional[str]) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ if json_str is None:
+ return instance
+
+ error_messages = []
+ match = 0
+
+ # deserialize data into List[int]
+ try:
+ # validation
+ instance.oneof_schema_1_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.oneof_schema_1_validator
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into List[int]
+ try:
+ # validation
+ instance.oneof_schema_2_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.oneof_schema_2_validator
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into str
+ try:
+ # validation
+ instance.oneof_schema_3_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.oneof_schema_3_validator
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into Color with oneOf schemas: List[int], str. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], List[int], str]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py
new file mode 100644
index 00000000000..ce6a70327b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature.py
@@ -0,0 +1,120 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from importlib import import_module
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Union
+from petstore_api.models.creature_info import CreatureInfo
+from typing import Optional, Set
+from typing_extensions import Self
+
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from petstore_api.models.hunting_dog import HuntingDog
+
+class Creature(BaseModel):
+ """
+ Creature
+ """ # noqa: E501
+ info: CreatureInfo
+ type: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["info", "type"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ # JSON field name that stores the object type
+ __discriminator_property_name: ClassVar[str] = 'type'
+
+ # discriminator mappings
+ __discriminator_value_class_map: ClassVar[Dict[str, str]] = {
+ 'Hunting__Dog': 'HuntingDog'
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Union[HuntingDog]]:
+ """Create an instance of Creature from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of info
+ if self.info:
+ _dict['info'] = self.info.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[HuntingDog]]:
+ """Create an instance of Creature from a dict"""
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type == 'HuntingDog':
+ return import_module("petstore_api.models.hunting_dog").HuntingDog.from_dict(obj)
+
+ raise ValueError("Creature failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py
new file mode 100644
index 00000000000..e7fef158a58
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/creature_info.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class CreatureInfo(BaseModel):
+ """
+ CreatureInfo
+ """ # noqa: E501
+ name: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of CreatureInfo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of CreatureInfo from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py
new file mode 100644
index 00000000000..df4a80d3390
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/danish_pig.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DanishPig(BaseModel):
+ """
+ DanishPig
+ """ # noqa: E501
+ class_name: StrictStr = Field(alias="className")
+ size: StrictInt
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["className", "size"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DanishPig from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DanishPig from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "className": obj.get("className"),
+ "size": obj.get("size")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py
new file mode 100644
index 00000000000..ee3df76c516
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/data_output_format.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class DataOutputFormat(str, Enum):
+ """
+ DataOutputFormat
+ """
+
+ """
+ allowed enum values
+ """
+ JSON = 'JSON'
+ CSV = 'CSV'
+ XML = 'XML'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of DataOutputFormat from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py
new file mode 100644
index 00000000000..ad0ec89a5b7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/deprecated_object.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DeprecatedObject(BaseModel):
+ """
+ DeprecatedObject
+ """ # noqa: E501
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DeprecatedObject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DeprecatedObject from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py
new file mode 100644
index 00000000000..9723d2e28c7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_sub.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import ConfigDict
+from typing import Any, ClassVar, Dict, List
+from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DiscriminatorAllOfSub(DiscriminatorAllOfSuper):
+ """
+ DiscriminatorAllOfSub
+ """ # noqa: E501
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["elementType"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DiscriminatorAllOfSub from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DiscriminatorAllOfSub from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "elementType": obj.get("elementType")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py
new file mode 100644
index 00000000000..e3d62831065
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/discriminator_all_of_super.py
@@ -0,0 +1,115 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from importlib import import_module
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Union
+from typing import Optional, Set
+from typing_extensions import Self
+
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
+
+class DiscriminatorAllOfSuper(BaseModel):
+ """
+ DiscriminatorAllOfSuper
+ """ # noqa: E501
+ element_type: StrictStr = Field(alias="elementType")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["elementType"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ # JSON field name that stores the object type
+ __discriminator_property_name: ClassVar[str] = 'elementType'
+
+ # discriminator mappings
+ __discriminator_value_class_map: ClassVar[Dict[str, str]] = {
+ 'DiscriminatorAllOfSub': 'DiscriminatorAllOfSub'
+ }
+
+ @classmethod
+ def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]:
+ """Returns the discriminator value (object type) of the data"""
+ discriminator_value = obj[cls.__discriminator_property_name]
+ if discriminator_value:
+ return cls.__discriminator_value_class_map.get(discriminator_value)
+ else:
+ return None
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Union[DiscriminatorAllOfSub]]:
+ """Create an instance of DiscriminatorAllOfSuper from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Dict[str, Any]) -> Optional[Union[DiscriminatorAllOfSub]]:
+ """Create an instance of DiscriminatorAllOfSuper from a dict"""
+ # look up the object type based on discriminator mapping
+ object_type = cls.get_discriminator_value(obj)
+ if object_type == 'DiscriminatorAllOfSub':
+ return import_module("petstore_api.models.discriminator_all_of_sub").DiscriminatorAllOfSub.from_dict(obj)
+
+ raise ValueError("DiscriminatorAllOfSuper failed to lookup discriminator value from " +
+ json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
+ ", mapping: " + json.dumps(cls.__discriminator_value_class_map))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py
new file mode 100644
index 00000000000..cde0f5d27e0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dog.py
@@ -0,0 +1,103 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.animal import Animal
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Dog(Animal):
+ """
+ Dog
+ """ # noqa: E501
+ breed: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["className", "color", "breed"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Dog from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Dog from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "className": obj.get("className"),
+ "color": obj.get("color") if obj.get("color") is not None else 'red',
+ "breed": obj.get("breed")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py
new file mode 100644
index 00000000000..47fdb81a397
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/dummy_model.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class DummyModel(BaseModel):
+ """
+ DummyModel
+ """ # noqa: E501
+ category: Optional[StrictStr] = None
+ self_ref: Optional[SelfReferenceModel] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["category", "self_ref"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of DummyModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of self_ref
+ if self.self_ref:
+ _dict['self_ref'] = self.self_ref.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of DummyModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "category": obj.get("category"),
+ "self_ref": SelfReferenceModel.from_dict(obj["self_ref"]) if obj.get("self_ref") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.self_reference_model import SelfReferenceModel
+# TODO: Rewrite to not use raise_errors
+DummyModel.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py
new file mode 100644
index 00000000000..17d3e0afd2d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_arrays.py
@@ -0,0 +1,123 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class EnumArrays(BaseModel):
+ """
+ EnumArrays
+ """ # noqa: E501
+ just_symbol: Optional[StrictStr] = None
+ array_enum: Optional[List[StrictStr]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["just_symbol", "array_enum"]
+
+ @field_validator('just_symbol')
+ def just_symbol_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['>=', '$']):
+ raise ValueError("must be one of enum values ('>=', '$')")
+ return value
+
+ @field_validator('array_enum')
+ def array_enum_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ for i in value:
+ if i not in set(['fish', 'crab']):
+ raise ValueError("each list item must be one of ('fish', 'crab')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of EnumArrays from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of EnumArrays from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "just_symbol": obj.get("just_symbol"),
+ "array_enum": obj.get("array_enum")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py
new file mode 100644
index 00000000000..1ba5af8036d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_class.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class EnumClass(str, Enum):
+ """
+ EnumClass
+ """
+
+ """
+ allowed enum values
+ """
+ ABC = '_abc'
+ MINUS_EFG = '-efg'
+ LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS = '(xyz)'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of EnumClass from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py
new file mode 100644
index 00000000000..5588de5c704
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_number_vendor_ext.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class EnumNumberVendorExt(int, Enum):
+ """
+ EnumNumberVendorExt
+ """
+
+ """
+ allowed enum values
+ """
+ FortyTwo = 42
+ Eigtheen = 18
+ FiftySix = 56
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of EnumNumberVendorExt from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py
new file mode 100644
index 00000000000..d864e80d0a7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_ref_with_default_value.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.data_output_format import DataOutputFormat
+from typing import Optional, Set
+from typing_extensions import Self
+
+class EnumRefWithDefaultValue(BaseModel):
+ """
+ EnumRefWithDefaultValue
+ """ # noqa: E501
+ report_format: Optional[DataOutputFormat] = DataOutputFormat.JSON
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["report_format"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of EnumRefWithDefaultValue from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of EnumRefWithDefaultValue from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "report_format": obj.get("report_format") if obj.get("report_format") is not None else DataOutputFormat.JSON
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py
new file mode 100644
index 00000000000..678b4e12661
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string1.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class EnumString1(str, Enum):
+ """
+ EnumString1
+ """
+
+ """
+ allowed enum values
+ """
+ A = 'a'
+ B = 'b'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of EnumString1 from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py
new file mode 100644
index 00000000000..a959f554e0a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string2.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class EnumString2(str, Enum):
+ """
+ EnumString2
+ """
+
+ """
+ allowed enum values
+ """
+ C = 'c'
+ D = 'd'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of EnumString2 from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py
new file mode 100644
index 00000000000..821812e9b08
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_string_vendor_ext.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class EnumStringVendorExt(str, Enum):
+ """
+ EnumStringVendorExt
+ """
+
+ """
+ allowed enum values
+ """
+ FOO_XEnumVarname = 'FOO'
+ BarVar_XEnumVarname = 'Bar'
+ bazVar_XEnumVarname = 'baz'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of EnumStringVendorExt from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py
new file mode 100644
index 00000000000..d39c2c95775
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/enum_test.py
@@ -0,0 +1,202 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt
+from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+from typing import Optional, Set
+from typing_extensions import Self
+
+class EnumTest(BaseModel):
+ """
+ EnumTest
+ """ # noqa: E501
+ enum_string: Optional[StrictStr] = None
+ enum_string_required: StrictStr
+ enum_integer_default: Optional[StrictInt] = 5
+ enum_integer: Optional[StrictInt] = None
+ enum_number: Optional[StrictFloat] = None
+ enum_string_single_member: Optional[StrictStr] = None
+ enum_integer_single_member: Optional[StrictInt] = None
+ outer_enum: Optional[OuterEnum] = Field(default=None, alias="outerEnum")
+ outer_enum_integer: Optional[OuterEnumInteger] = Field(default=None, alias="outerEnumInteger")
+ outer_enum_default_value: Optional[OuterEnumDefaultValue] = Field(default=OuterEnumDefaultValue.PLACED, alias="outerEnumDefaultValue")
+ outer_enum_integer_default_value: Optional[OuterEnumIntegerDefaultValue] = Field(default=OuterEnumIntegerDefaultValue.NUMBER_0, alias="outerEnumIntegerDefaultValue")
+ enum_number_vendor_ext: Optional[EnumNumberVendorExt] = Field(default=None, alias="enumNumberVendorExt")
+ enum_string_vendor_ext: Optional[EnumStringVendorExt] = Field(default=None, alias="enumStringVendorExt")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["enum_string", "enum_string_required", "enum_integer_default", "enum_integer", "enum_number", "enum_string_single_member", "enum_integer_single_member", "outerEnum", "outerEnumInteger", "outerEnumDefaultValue", "outerEnumIntegerDefaultValue", "enumNumberVendorExt", "enumStringVendorExt"]
+
+ @field_validator('enum_string')
+ def enum_string_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['UPPER', 'lower', '']):
+ raise ValueError("must be one of enum values ('UPPER', 'lower', '')")
+ return value
+
+ @field_validator('enum_string_required')
+ def enum_string_required_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['UPPER', 'lower', '']):
+ raise ValueError("must be one of enum values ('UPPER', 'lower', '')")
+ return value
+
+ @field_validator('enum_integer_default')
+ def enum_integer_default_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set([1, 5, 14]):
+ raise ValueError("must be one of enum values (1, 5, 14)")
+ return value
+
+ @field_validator('enum_integer')
+ def enum_integer_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set([1, -1]):
+ raise ValueError("must be one of enum values (1, -1)")
+ return value
+
+ @field_validator('enum_number')
+ def enum_number_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set([1.1, -1.2]):
+ raise ValueError("must be one of enum values (1.1, -1.2)")
+ return value
+
+ @field_validator('enum_string_single_member')
+ def enum_string_single_member_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['abc']):
+ raise ValueError("must be one of enum values ('abc')")
+ return value
+
+ @field_validator('enum_integer_single_member')
+ def enum_integer_single_member_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set([100]):
+ raise ValueError("must be one of enum values (100)")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of EnumTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if outer_enum (nullable) is None
+ # and model_fields_set contains the field
+ if self.outer_enum is None and "outer_enum" in self.model_fields_set:
+ _dict['outerEnum'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of EnumTest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "enum_string": obj.get("enum_string"),
+ "enum_string_required": obj.get("enum_string_required"),
+ "enum_integer_default": obj.get("enum_integer_default") if obj.get("enum_integer_default") is not None else 5,
+ "enum_integer": obj.get("enum_integer"),
+ "enum_number": obj.get("enum_number"),
+ "enum_string_single_member": obj.get("enum_string_single_member"),
+ "enum_integer_single_member": obj.get("enum_integer_single_member"),
+ "outerEnum": obj.get("outerEnum"),
+ "outerEnumInteger": obj.get("outerEnumInteger"),
+ "outerEnumDefaultValue": obj.get("outerEnumDefaultValue") if obj.get("outerEnumDefaultValue") is not None else OuterEnumDefaultValue.PLACED,
+ "outerEnumIntegerDefaultValue": obj.get("outerEnumIntegerDefaultValue") if obj.get("outerEnumIntegerDefaultValue") is not None else OuterEnumIntegerDefaultValue.NUMBER_0,
+ "enumNumberVendorExt": obj.get("enumNumberVendorExt"),
+ "enumStringVendorExt": obj.get("enumStringVendorExt")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py
new file mode 100644
index 00000000000..5c406bc9e65
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/feeding.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Feeding(BaseModel):
+ """
+ Feeding
+ """ # noqa: E501
+ task_name: StrictStr
+ function_name: StrictStr
+ content: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["task_name", "function_name", "content"]
+
+ @field_validator('task_name')
+ def task_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['cleaning']):
+ raise ValueError("must be one of enum values ('cleaning')")
+ return value
+
+ @field_validator('function_name')
+ def function_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['care_nourish']):
+ raise ValueError("must be one of enum values ('care_nourish')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Feeding from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Feeding from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "task_name": obj.get("task_name"),
+ "function_name": obj.get("function_name"),
+ "content": obj.get("content")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py
new file mode 100644
index 00000000000..4c661cadabc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class File(BaseModel):
+ """
+ Must be named `File` for test.
+ """ # noqa: E501
+ source_uri: Optional[StrictStr] = Field(default=None, description="Test capitalization", alias="sourceURI")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["sourceURI"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of File from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of File from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "sourceURI": obj.get("sourceURI")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py
new file mode 100644
index 00000000000..09a543010f4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/file_schema_test_class.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.file import File
+from typing import Optional, Set
+from typing_extensions import Self
+
+class FileSchemaTestClass(BaseModel):
+ """
+ FileSchemaTestClass
+ """ # noqa: E501
+ file: Optional[File] = None
+ files: Optional[List[File]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["file", "files"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of FileSchemaTestClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of file
+ if self.file:
+ _dict['file'] = self.file.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in files (list)
+ _items = []
+ if self.files:
+ for _item_files in self.files:
+ if _item_files:
+ _items.append(_item_files.to_dict())
+ _dict['files'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of FileSchemaTestClass from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "file": File.from_dict(obj["file"]) if obj.get("file") is not None else None,
+ "files": [File.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py
new file mode 100644
index 00000000000..7680dfdf418
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/first_ref.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class FirstRef(BaseModel):
+ """
+ FirstRef
+ """ # noqa: E501
+ category: Optional[StrictStr] = None
+ self_ref: Optional[SecondRef] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["category", "self_ref"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of FirstRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of self_ref
+ if self.self_ref:
+ _dict['self_ref'] = self.self_ref.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of FirstRef from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "category": obj.get("category"),
+ "self_ref": SecondRef.from_dict(obj["self_ref"]) if obj.get("self_ref") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.second_ref import SecondRef
+# TODO: Rewrite to not use raise_errors
+FirstRef.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py
new file mode 100644
index 00000000000..81e3839ea17
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Foo(BaseModel):
+ """
+ Foo
+ """ # noqa: E501
+ bar: Optional[StrictStr] = 'bar'
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["bar"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Foo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Foo from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "bar": obj.get("bar") if obj.get("bar") is not None else 'bar'
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py
new file mode 100644
index 00000000000..4cd23db3912
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/foo_get_default_response.py
@@ -0,0 +1,104 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.foo import Foo
+from typing import Optional, Set
+from typing_extensions import Self
+
+class FooGetDefaultResponse(BaseModel):
+ """
+ FooGetDefaultResponse
+ """ # noqa: E501
+ string: Optional[Foo] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["string"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of FooGetDefaultResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of string
+ if self.string:
+ _dict['string'] = self.string.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of FooGetDefaultResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "string": Foo.from_dict(obj["string"]) if obj.get("string") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py
new file mode 100644
index 00000000000..4aca97f91c4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/format_test.py
@@ -0,0 +1,176 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from decimal import Decimal
+from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union
+from typing_extensions import Annotated
+from uuid import UUID
+from typing import Optional, Set
+from typing_extensions import Self
+
+class FormatTest(BaseModel):
+ """
+ FormatTest
+ """ # noqa: E501
+ integer: Optional[Annotated[int, Field(le=100, strict=True, ge=10)]] = None
+ int32: Optional[Annotated[int, Field(le=200, strict=True, ge=20)]] = None
+ int64: Optional[StrictInt] = None
+ number: Annotated[float, Field(le=543.2, strict=True, ge=32.1)]
+ var_float: Optional[Annotated[float, Field(le=987.6, strict=True, ge=54.3)]] = Field(default=None, alias="float")
+ double: Optional[Annotated[float, Field(le=123.4, strict=True, ge=67.8)]] = None
+ decimal: Optional[Decimal] = None
+ string: Optional[Annotated[str, Field(strict=True)]] = None
+ string_with_double_quote_pattern: Optional[Annotated[str, Field(strict=True)]] = None
+ byte: Optional[Union[StrictBytes, StrictStr]] = None
+ binary: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None
+ var_date: date = Field(alias="date")
+ date_time: Optional[datetime] = Field(default=None, alias="dateTime")
+ uuid: Optional[UUID] = None
+ password: Annotated[str, Field(min_length=10, strict=True, max_length=64)]
+ pattern_with_digits: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A string that is a 10 digit number. Can have leading zeros.")
+ pattern_with_digits_and_delimiter: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["integer", "int32", "int64", "number", "float", "double", "decimal", "string", "string_with_double_quote_pattern", "byte", "binary", "date", "dateTime", "uuid", "password", "pattern_with_digits", "pattern_with_digits_and_delimiter"]
+
+ @field_validator('string')
+ def string_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if value is None:
+ return value
+
+ if not re.match(r"[a-z]", value ,re.IGNORECASE):
+ raise ValueError(r"must validate the regular expression /[a-z]/i")
+ return value
+
+ @field_validator('string_with_double_quote_pattern')
+ def string_with_double_quote_pattern_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if value is None:
+ return value
+
+ if not re.match(r"this is \"something\"", value):
+ raise ValueError(r"must validate the regular expression /this is \"something\"/")
+ return value
+
+ @field_validator('pattern_with_digits')
+ def pattern_with_digits_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if value is None:
+ return value
+
+ if not re.match(r"^\d{10}$", value):
+ raise ValueError(r"must validate the regular expression /^\d{10}$/")
+ return value
+
+ @field_validator('pattern_with_digits_and_delimiter')
+ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if value is None:
+ return value
+
+ if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE):
+ raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of FormatTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of FormatTest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "integer": obj.get("integer"),
+ "int32": obj.get("int32"),
+ "int64": obj.get("int64"),
+ "number": obj.get("number"),
+ "float": obj.get("float"),
+ "double": obj.get("double"),
+ "decimal": obj.get("decimal"),
+ "string": obj.get("string"),
+ "string_with_double_quote_pattern": obj.get("string_with_double_quote_pattern"),
+ "byte": obj.get("byte"),
+ "binary": obj.get("binary"),
+ "date": obj.get("date"),
+ "dateTime": obj.get("dateTime"),
+ "uuid": obj.get("uuid"),
+ "password": obj.get("password"),
+ "pattern_with_digits": obj.get("pattern_with_digits"),
+ "pattern_with_digits_and_delimiter": obj.get("pattern_with_digits_and_delimiter")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py
new file mode 100644
index 00000000000..77360fedbae
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/has_only_read_only.py
@@ -0,0 +1,106 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class HasOnlyReadOnly(BaseModel):
+ """
+ HasOnlyReadOnly
+ """ # noqa: E501
+ bar: Optional[StrictStr] = None
+ foo: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["bar", "foo"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HasOnlyReadOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * OpenAPI `readOnly` fields are excluded.
+ * OpenAPI `readOnly` fields are excluded.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "bar",
+ "foo",
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HasOnlyReadOnly from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "bar": obj.get("bar"),
+ "foo": obj.get("foo")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py
new file mode 100644
index 00000000000..59f444aedaa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/health_check_result.py
@@ -0,0 +1,105 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class HealthCheckResult(BaseModel):
+ """
+ Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
+ """ # noqa: E501
+ nullable_message: Optional[StrictStr] = Field(default=None, alias="NullableMessage")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["NullableMessage"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HealthCheckResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if nullable_message (nullable) is None
+ # and model_fields_set contains the field
+ if self.nullable_message is None and "nullable_message" in self.model_fields_set:
+ _dict['NullableMessage'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HealthCheckResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "NullableMessage": obj.get("NullableMessage")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py
new file mode 100644
index 00000000000..f7d03f4044e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/hunting_dog.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import ConfigDict, Field, StrictBool
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.creature import Creature
+from petstore_api.models.creature_info import CreatureInfo
+from typing import Optional, Set
+from typing_extensions import Self
+
+class HuntingDog(Creature):
+ """
+ HuntingDog
+ """ # noqa: E501
+ is_trained: Optional[StrictBool] = Field(default=None, alias="isTrained")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["info", "type", "isTrained"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of HuntingDog from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of info
+ if self.info:
+ _dict['info'] = self.info.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of HuntingDog from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "info": CreatureInfo.from_dict(obj["info"]) if obj.get("info") is not None else None,
+ "type": obj.get("type"),
+ "isTrained": obj.get("isTrained")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py
new file mode 100644
index 00000000000..94e663b3aaa
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/info.py
@@ -0,0 +1,105 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.base_discriminator import BaseDiscriminator
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Info(BaseDiscriminator):
+ """
+ Info
+ """ # noqa: E501
+ val: Optional[BaseDiscriminator] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_typeName", "val"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Info from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of val
+ if self.val:
+ _dict['val'] = self.val.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Info from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_typeName": obj.get("_typeName"),
+ "val": BaseDiscriminator.from_dict(obj["val"]) if obj.get("val") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py
new file mode 100644
index 00000000000..b43fa8b19fe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/inner_dict_with_property.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class InnerDictWithProperty(BaseModel):
+ """
+ InnerDictWithProperty
+ """ # noqa: E501
+ a_property: Optional[Dict[str, Any]] = Field(default=None, alias="aProperty")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["aProperty"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of InnerDictWithProperty from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of InnerDictWithProperty from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "aProperty": obj.get("aProperty")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py
new file mode 100644
index 00000000000..e4a81ff7000
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/input_all_of.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.tag import Tag
+from typing import Optional, Set
+from typing_extensions import Self
+
+class InputAllOf(BaseModel):
+ """
+ InputAllOf
+ """ # noqa: E501
+ some_data: Optional[Dict[str, Tag]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["some_data"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of InputAllOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in some_data (dict)
+ _field_dict = {}
+ if self.some_data:
+ for _key_some_data in self.some_data:
+ if self.some_data[_key_some_data]:
+ _field_dict[_key_some_data] = self.some_data[_key_some_data].to_dict()
+ _dict['some_data'] = _field_dict
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of InputAllOf from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "some_data": dict(
+ (_k, Tag.from_dict(_v))
+ for _k, _v in obj["some_data"].items()
+ )
+ if obj.get("some_data") is not None
+ else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py
new file mode 100644
index 00000000000..f2a5a0a2d4a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/int_or_string.py
@@ -0,0 +1,144 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+import pprint
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Any, List, Optional
+from typing_extensions import Annotated
+from pydantic import StrictStr, Field
+from typing import Union, List, Set, Optional, Dict
+from typing_extensions import Literal, Self
+
+INTORSTRING_ONE_OF_SCHEMAS = ["int", "str"]
+
+class IntOrString(BaseModel):
+ """
+ IntOrString
+ """
+ # data type: int
+ oneof_schema_1_validator: Optional[Annotated[int, Field(strict=True, ge=10)]] = None
+ # data type: str
+ oneof_schema_2_validator: Optional[StrictStr] = None
+ actual_instance: Optional[Union[int, str]] = None
+ one_of_schemas: Set[str] = { "int", "str" }
+
+ model_config = ConfigDict(
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ instance = IntOrString.model_construct()
+ error_messages = []
+ match = 0
+ # validate data type: int
+ try:
+ instance.oneof_schema_1_validator = v
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # validate data type: str
+ try:
+ instance.oneof_schema_2_validator = v
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when setting `actual_instance` in IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when setting `actual_instance` in IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ match = 0
+
+ # deserialize data into int
+ try:
+ # validation
+ instance.oneof_schema_1_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.oneof_schema_1_validator
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into str
+ try:
+ # validation
+ instance.oneof_schema_2_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.oneof_schema_2_validator
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into IntOrString with oneOf schemas: int, str. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py
new file mode 100644
index 00000000000..e00f3d820b8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/list_class.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ListClass(BaseModel):
+ """
+ ListClass
+ """ # noqa: E501
+ var_123_list: Optional[StrictStr] = Field(default=None, alias="123-list")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["123-list"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ListClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ListClass from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "123-list": obj.get("123-list")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py
new file mode 100644
index 00000000000..68816ab2953
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_of_array_of_model.py
@@ -0,0 +1,117 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.tag import Tag
+from typing import Optional, Set
+from typing_extensions import Self
+
+class MapOfArrayOfModel(BaseModel):
+ """
+ MapOfArrayOfModel
+ """ # noqa: E501
+ shop_id_to_org_online_lip_map: Optional[Dict[str, List[Tag]]] = Field(default=None, alias="shopIdToOrgOnlineLipMap")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["shopIdToOrgOnlineLipMap"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MapOfArrayOfModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in shop_id_to_org_online_lip_map (dict of array)
+ _field_dict_of_array = {}
+ if self.shop_id_to_org_online_lip_map:
+ for _key_shop_id_to_org_online_lip_map in self.shop_id_to_org_online_lip_map:
+ if self.shop_id_to_org_online_lip_map[_key_shop_id_to_org_online_lip_map] is not None:
+ _field_dict_of_array[_key_shop_id_to_org_online_lip_map] = [
+ _item.to_dict() for _item in self.shop_id_to_org_online_lip_map[_key_shop_id_to_org_online_lip_map]
+ ]
+ _dict['shopIdToOrgOnlineLipMap'] = _field_dict_of_array
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MapOfArrayOfModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "shopIdToOrgOnlineLipMap": dict(
+ (_k,
+ [Tag.from_dict(_item) for _item in _v]
+ if _v is not None
+ else None
+ )
+ for _k, _v in obj.get("shopIdToOrgOnlineLipMap", {}).items()
+ )
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py
new file mode 100644
index 00000000000..4cefd36427f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/map_test.py
@@ -0,0 +1,117 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class MapTest(BaseModel):
+ """
+ MapTest
+ """ # noqa: E501
+ map_map_of_string: Optional[Dict[str, Dict[str, StrictStr]]] = None
+ map_of_enum_string: Optional[Dict[str, StrictStr]] = None
+ direct_map: Optional[Dict[str, StrictBool]] = None
+ indirect_map: Optional[Dict[str, StrictBool]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["map_map_of_string", "map_of_enum_string", "direct_map", "indirect_map"]
+
+ @field_validator('map_of_enum_string')
+ def map_of_enum_string_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ for i in value.values():
+ if i not in set(['UPPER', 'lower']):
+ raise ValueError("dict values must be one of enum values ('UPPER', 'lower')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MapTest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MapTest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "map_map_of_string": obj.get("map_map_of_string"),
+ "map_of_enum_string": obj.get("map_of_enum_string"),
+ "direct_map": obj.get("direct_map"),
+ "indirect_map": obj.get("indirect_map")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py
new file mode 100644
index 00000000000..c21f442bb79
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,119 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from uuid import UUID
+from petstore_api.models.animal import Animal
+from typing import Optional, Set
+from typing_extensions import Self
+
+class MixedPropertiesAndAdditionalPropertiesClass(BaseModel):
+ """
+ MixedPropertiesAndAdditionalPropertiesClass
+ """ # noqa: E501
+ uuid: Optional[UUID] = None
+ date_time: Optional[datetime] = Field(default=None, alias="dateTime")
+ map: Optional[Dict[str, Animal]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["uuid", "dateTime", "map"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in map (dict)
+ _field_dict = {}
+ if self.map:
+ for _key_map in self.map:
+ if self.map[_key_map]:
+ _field_dict[_key_map] = self.map[_key_map].to_dict()
+ _dict['map'] = _field_dict
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MixedPropertiesAndAdditionalPropertiesClass from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "uuid": obj.get("uuid"),
+ "dateTime": obj.get("dateTime"),
+ "map": dict(
+ (_k, Animal.from_dict(_v))
+ for _k, _v in obj["map"].items()
+ )
+ if obj.get("map") is not None
+ else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py
new file mode 100644
index 00000000000..60e43a0e28e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model200_response.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Model200Response(BaseModel):
+ """
+ Model for testing model name starting with number
+ """ # noqa: E501
+ name: Optional[StrictInt] = None
+ var_class: Optional[StrictStr] = Field(default=None, alias="class")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name", "class"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Model200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Model200Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "class": obj.get("class")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py
new file mode 100644
index 00000000000..7141160c57d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_api_response.py
@@ -0,0 +1,104 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ModelApiResponse(BaseModel):
+ """
+ ModelApiResponse
+ """ # noqa: E501
+ code: Optional[StrictInt] = None
+ type: Optional[StrictStr] = None
+ message: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["code", "type", "message"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ModelApiResponse from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ModelApiResponse from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "code": obj.get("code"),
+ "type": obj.get("type"),
+ "message": obj.get("message")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py
new file mode 100644
index 00000000000..d7b03848fe1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_field.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ModelField(BaseModel):
+ """
+ ModelField
+ """ # noqa: E501
+ var_field: Optional[StrictStr] = Field(default=None, alias="field")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["field"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ModelField from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ModelField from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "field": obj.get("field")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py
new file mode 100644
index 00000000000..3f2558bc6e7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/model_return.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ModelReturn(BaseModel):
+ """
+ Model for testing reserved words
+ """ # noqa: E501
+ var_return: Optional[StrictInt] = Field(default=None, alias="return")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["return"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ModelReturn from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ModelReturn from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "return": obj.get("return")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py
new file mode 100644
index 00000000000..80fa67f8a11
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/multi_arrays.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.file import File
+from petstore_api.models.tag import Tag
+from typing import Optional, Set
+from typing_extensions import Self
+
+class MultiArrays(BaseModel):
+ """
+ MultiArrays
+ """ # noqa: E501
+ tags: Optional[List[Tag]] = None
+ files: Optional[List[File]] = Field(default=None, description="Another array of objects in addition to tags (mypy check to not to reuse the same iterator)")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["tags", "files"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of MultiArrays from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in tags (list)
+ _items = []
+ if self.tags:
+ for _item_tags in self.tags:
+ if _item_tags:
+ _items.append(_item_tags.to_dict())
+ _dict['tags'] = _items
+ # override the default output from pydantic by calling `to_dict()` of each item in files (list)
+ _items = []
+ if self.files:
+ for _item_files in self.files:
+ if _item_files:
+ _items.append(_item_files.to_dict())
+ _dict['files'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of MultiArrays from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "tags": [Tag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None,
+ "files": [File.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py
new file mode 100644
index 00000000000..01b02f83413
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/name.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Name(BaseModel):
+ """
+ Model for testing model name same as property name
+ """ # noqa: E501
+ name: StrictInt
+ snake_case: Optional[StrictInt] = None
+ var_property: Optional[StrictStr] = Field(default=None, alias="property")
+ var_123_number: Optional[StrictInt] = Field(default=None, alias="123Number")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name", "snake_case", "property", "123Number"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Name from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * OpenAPI `readOnly` fields are excluded.
+ * OpenAPI `readOnly` fields are excluded.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "snake_case",
+ "var_123_number",
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Name from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name"),
+ "snake_case": obj.get("snake_case"),
+ "property": obj.get("property"),
+ "123Number": obj.get("123Number")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py
new file mode 100644
index 00000000000..cb27fbf691c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_class.py
@@ -0,0 +1,180 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import date, datetime
+from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class NullableClass(BaseModel):
+ """
+ NullableClass
+ """ # noqa: E501
+ required_integer_prop: Optional[StrictInt]
+ integer_prop: Optional[StrictInt] = None
+ number_prop: Optional[StrictFloat] = None
+ boolean_prop: Optional[StrictBool] = None
+ string_prop: Optional[StrictStr] = None
+ date_prop: Optional[date] = None
+ datetime_prop: Optional[datetime] = None
+ array_nullable_prop: Optional[List[Dict[str, Any]]] = None
+ array_and_items_nullable_prop: Optional[List[Optional[Dict[str, Any]]]] = None
+ array_items_nullable: Optional[List[Optional[Dict[str, Any]]]] = None
+ object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
+ object_and_items_nullable_prop: Optional[Dict[str, Optional[Dict[str, Any]]]] = None
+ object_items_nullable: Optional[Dict[str, Optional[Dict[str, Any]]]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of NullableClass from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if required_integer_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.required_integer_prop is None and "required_integer_prop" in self.model_fields_set:
+ _dict['required_integer_prop'] = None
+
+ # set to None if integer_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.integer_prop is None and "integer_prop" in self.model_fields_set:
+ _dict['integer_prop'] = None
+
+ # set to None if number_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.number_prop is None and "number_prop" in self.model_fields_set:
+ _dict['number_prop'] = None
+
+ # set to None if boolean_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.boolean_prop is None and "boolean_prop" in self.model_fields_set:
+ _dict['boolean_prop'] = None
+
+ # set to None if string_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.string_prop is None and "string_prop" in self.model_fields_set:
+ _dict['string_prop'] = None
+
+ # set to None if date_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.date_prop is None and "date_prop" in self.model_fields_set:
+ _dict['date_prop'] = None
+
+ # set to None if datetime_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.datetime_prop is None and "datetime_prop" in self.model_fields_set:
+ _dict['datetime_prop'] = None
+
+ # set to None if array_nullable_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.array_nullable_prop is None and "array_nullable_prop" in self.model_fields_set:
+ _dict['array_nullable_prop'] = None
+
+ # set to None if array_and_items_nullable_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.array_and_items_nullable_prop is None and "array_and_items_nullable_prop" in self.model_fields_set:
+ _dict['array_and_items_nullable_prop'] = None
+
+ # set to None if object_nullable_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.object_nullable_prop is None and "object_nullable_prop" in self.model_fields_set:
+ _dict['object_nullable_prop'] = None
+
+ # set to None if object_and_items_nullable_prop (nullable) is None
+ # and model_fields_set contains the field
+ if self.object_and_items_nullable_prop is None and "object_and_items_nullable_prop" in self.model_fields_set:
+ _dict['object_and_items_nullable_prop'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of NullableClass from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "required_integer_prop": obj.get("required_integer_prop"),
+ "integer_prop": obj.get("integer_prop"),
+ "number_prop": obj.get("number_prop"),
+ "boolean_prop": obj.get("boolean_prop"),
+ "string_prop": obj.get("string_prop"),
+ "date_prop": obj.get("date_prop"),
+ "datetime_prop": obj.get("datetime_prop"),
+ "array_nullable_prop": obj.get("array_nullable_prop"),
+ "array_and_items_nullable_prop": obj.get("array_and_items_nullable_prop"),
+ "array_items_nullable": obj.get("array_items_nullable"),
+ "object_nullable_prop": obj.get("object_nullable_prop"),
+ "object_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"),
+ "object_items_nullable": obj.get("object_items_nullable")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py
new file mode 100644
index 00000000000..e73cd1509c9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/nullable_property.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Annotated
+from typing import Optional, Set
+from typing_extensions import Self
+
+class NullableProperty(BaseModel):
+ """
+ NullableProperty
+ """ # noqa: E501
+ id: StrictInt
+ name: Optional[Annotated[str, Field(strict=True)]]
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "name"]
+
+ @field_validator('name')
+ def name_validate_regular_expression(cls, value):
+ """Validates the regular expression"""
+ if value is None:
+ return value
+
+ if not re.match(r"^[A-Z].*", value):
+ raise ValueError(r"must validate the regular expression /^[A-Z].*/")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of NullableProperty from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if name (nullable) is None
+ # and model_fields_set contains the field
+ if self.name is None and "name" in self.model_fields_set:
+ _dict['name'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of NullableProperty from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py
new file mode 100644
index 00000000000..f74010e908b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/number_only.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class NumberOnly(BaseModel):
+ """
+ NumberOnly
+ """ # noqa: E501
+ just_number: Optional[StrictFloat] = Field(default=None, alias="JustNumber")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["JustNumber"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of NumberOnly from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of NumberOnly from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "JustNumber": obj.get("JustNumber")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py
new file mode 100644
index 00000000000..097bdd34e2b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_to_test_additional_properties.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictBool
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ObjectToTestAdditionalProperties(BaseModel):
+ """
+ Minimal object
+ """ # noqa: E501
+ var_property: Optional[StrictBool] = Field(default=False, description="Property", alias="property")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["property"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ObjectToTestAdditionalProperties from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ObjectToTestAdditionalProperties from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "property": obj.get("property") if obj.get("property") is not None else False
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py
new file mode 100644
index 00000000000..0c0cc840680
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/object_with_deprecated_fields.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.deprecated_object import DeprecatedObject
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ObjectWithDeprecatedFields(BaseModel):
+ """
+ ObjectWithDeprecatedFields
+ """ # noqa: E501
+ uuid: Optional[StrictStr] = None
+ id: Optional[StrictFloat] = None
+ deprecated_ref: Optional[DeprecatedObject] = Field(default=None, alias="deprecatedRef")
+ bars: Optional[List[StrictStr]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["uuid", "id", "deprecatedRef", "bars"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ObjectWithDeprecatedFields from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of deprecated_ref
+ if self.deprecated_ref:
+ _dict['deprecatedRef'] = self.deprecated_ref.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ObjectWithDeprecatedFields from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "uuid": obj.get("uuid"),
+ "id": obj.get("id"),
+ "deprecatedRef": DeprecatedObject.from_dict(obj["deprecatedRef"]) if obj.get("deprecatedRef") is not None else None,
+ "bars": obj.get("bars")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py
new file mode 100644
index 00000000000..f180178737d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/one_of_enum_string.py
@@ -0,0 +1,137 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+import pprint
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Any, List, Optional
+from petstore_api.models.enum_string1 import EnumString1
+from petstore_api.models.enum_string2 import EnumString2
+from pydantic import StrictStr, Field
+from typing import Union, List, Set, Optional, Dict
+from typing_extensions import Literal, Self
+
+ONEOFENUMSTRING_ONE_OF_SCHEMAS = ["EnumString1", "EnumString2"]
+
+class OneOfEnumString(BaseModel):
+ """
+ oneOf enum strings
+ """
+ # data type: EnumString1
+ oneof_schema_1_validator: Optional[EnumString1] = None
+ # data type: EnumString2
+ oneof_schema_2_validator: Optional[EnumString2] = None
+ actual_instance: Optional[Union[EnumString1, EnumString2]] = None
+ one_of_schemas: Set[str] = { "EnumString1", "EnumString2" }
+
+ model_config = ConfigDict(
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ instance = OneOfEnumString.model_construct()
+ error_messages = []
+ match = 0
+ # validate data type: EnumString1
+ if not isinstance(v, EnumString1):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `EnumString1`")
+ else:
+ match += 1
+ # validate data type: EnumString2
+ if not isinstance(v, EnumString2):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `EnumString2`")
+ else:
+ match += 1
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when setting `actual_instance` in OneOfEnumString with oneOf schemas: EnumString1, EnumString2. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when setting `actual_instance` in OneOfEnumString with oneOf schemas: EnumString1, EnumString2. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ match = 0
+
+ # deserialize data into EnumString1
+ try:
+ instance.actual_instance = EnumString1.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into EnumString2
+ try:
+ instance.actual_instance = EnumString2.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into OneOfEnumString with oneOf schemas: EnumString1, EnumString2. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into OneOfEnumString with oneOf schemas: EnumString1, EnumString2. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], EnumString1, EnumString2]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py
new file mode 100644
index 00000000000..12dd1ef117d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/order.py
@@ -0,0 +1,121 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Order(BaseModel):
+ """
+ Order
+ """ # noqa: E501
+ id: Optional[StrictInt] = None
+ pet_id: Optional[StrictInt] = Field(default=None, alias="petId")
+ quantity: Optional[StrictInt] = None
+ ship_date: Optional[datetime] = Field(default=None, alias="shipDate")
+ status: Optional[StrictStr] = Field(default=None, description="Order Status")
+ complete: Optional[StrictBool] = False
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "petId", "quantity", "shipDate", "status", "complete"]
+
+ @field_validator('status')
+ def status_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['placed', 'approved', 'delivered']):
+ raise ValueError("must be one of enum values ('placed', 'approved', 'delivered')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Order from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Order from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "petId": obj.get("petId"),
+ "quantity": obj.get("quantity"),
+ "shipDate": obj.get("shipDate"),
+ "status": obj.get("status"),
+ "complete": obj.get("complete") if obj.get("complete") is not None else False
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py
new file mode 100644
index 00000000000..5242660b636
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_composite.py
@@ -0,0 +1,104 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class OuterComposite(BaseModel):
+ """
+ OuterComposite
+ """ # noqa: E501
+ my_number: Optional[StrictFloat] = None
+ my_string: Optional[StrictStr] = None
+ my_boolean: Optional[StrictBool] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["my_number", "my_string", "my_boolean"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of OuterComposite from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of OuterComposite from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "my_number": obj.get("my_number"),
+ "my_string": obj.get("my_string"),
+ "my_boolean": obj.get("my_boolean")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py
new file mode 100644
index 00000000000..ac48cc0dc4d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class OuterEnum(str, Enum):
+ """
+ OuterEnum
+ """
+
+ """
+ allowed enum values
+ """
+ PLACED = 'placed'
+ APPROVED = 'approved'
+ DELIVERED = 'delivered'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of OuterEnum from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py
new file mode 100644
index 00000000000..99d6fd5fc04
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_default_value.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class OuterEnumDefaultValue(str, Enum):
+ """
+ OuterEnumDefaultValue
+ """
+
+ """
+ allowed enum values
+ """
+ PLACED = 'placed'
+ APPROVED = 'approved'
+ DELIVERED = 'delivered'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of OuterEnumDefaultValue from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py
new file mode 100644
index 00000000000..b771b7a61f5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class OuterEnumInteger(int, Enum):
+ """
+ OuterEnumInteger
+ """
+
+ """
+ allowed enum values
+ """
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+ NUMBER_2 = 2
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of OuterEnumInteger from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py
new file mode 100644
index 00000000000..8df41b2bd32
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_enum_integer_default_value.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class OuterEnumIntegerDefaultValue(int, Enum):
+ """
+ OuterEnumIntegerDefaultValue
+ """
+
+ """
+ allowed enum values
+ """
+ NUMBER_MINUS_1 = -1
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+ NUMBER_2 = 2
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of OuterEnumIntegerDefaultValue from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py
new file mode 100644
index 00000000000..f8d215a21c9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/outer_object_with_enum_property.py
@@ -0,0 +1,109 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.outer_enum import OuterEnum
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+from typing import Optional, Set
+from typing_extensions import Self
+
+class OuterObjectWithEnumProperty(BaseModel):
+ """
+ OuterObjectWithEnumProperty
+ """ # noqa: E501
+ str_value: Optional[OuterEnum] = None
+ value: OuterEnumInteger
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["str_value", "value"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of OuterObjectWithEnumProperty from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ # set to None if str_value (nullable) is None
+ # and model_fields_set contains the field
+ if self.str_value is None and "str_value" in self.model_fields_set:
+ _dict['str_value'] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of OuterObjectWithEnumProperty from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "str_value": obj.get("str_value"),
+ "value": obj.get("value")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py
new file mode 100644
index 00000000000..8a30758ab8f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Parent(BaseModel):
+ """
+ Parent
+ """ # noqa: E501
+ optional_dict: Optional[Dict[str, InnerDictWithProperty]] = Field(default=None, alias="optionalDict")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["optionalDict"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Parent from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in optional_dict (dict)
+ _field_dict = {}
+ if self.optional_dict:
+ for _key_optional_dict in self.optional_dict:
+ if self.optional_dict[_key_optional_dict]:
+ _field_dict[_key_optional_dict] = self.optional_dict[_key_optional_dict].to_dict()
+ _dict['optionalDict'] = _field_dict
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Parent from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "optionalDict": dict(
+ (_k, InnerDictWithProperty.from_dict(_v))
+ for _k, _v in obj["optionalDict"].items()
+ )
+ if obj.get("optionalDict") is not None
+ else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py
new file mode 100644
index 00000000000..509693dd144
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/parent_with_optional_dict.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ParentWithOptionalDict(BaseModel):
+ """
+ ParentWithOptionalDict
+ """ # noqa: E501
+ optional_dict: Optional[Dict[str, InnerDictWithProperty]] = Field(default=None, alias="optionalDict")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["optionalDict"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ParentWithOptionalDict from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in optional_dict (dict)
+ _field_dict = {}
+ if self.optional_dict:
+ for _key_optional_dict in self.optional_dict:
+ if self.optional_dict[_key_optional_dict]:
+ _field_dict[_key_optional_dict] = self.optional_dict[_key_optional_dict].to_dict()
+ _dict['optionalDict'] = _field_dict
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ParentWithOptionalDict from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "optionalDict": dict(
+ (_k, InnerDictWithProperty.from_dict(_v))
+ for _k, _v in obj["optionalDict"].items()
+ )
+ if obj.get("optionalDict") is not None
+ else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py
new file mode 100644
index 00000000000..48f0c2fceeb
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pet.py
@@ -0,0 +1,133 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from typing_extensions import Annotated
+from petstore_api.models.category import Category
+from petstore_api.models.tag import Tag
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Pet(BaseModel):
+ """
+ Pet
+ """ # noqa: E501
+ id: Optional[StrictInt] = None
+ category: Optional[Category] = None
+ name: StrictStr
+ photo_urls: Annotated[List[StrictStr], Field(min_length=0)] = Field(alias="photoUrls")
+ tags: Optional[List[Tag]] = None
+ status: Optional[StrictStr] = Field(default=None, description="pet status in the store")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "category", "name", "photoUrls", "tags", "status"]
+
+ @field_validator('status')
+ def status_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['available', 'pending', 'sold']):
+ raise ValueError("must be one of enum values ('available', 'pending', 'sold')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Pet from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of category
+ if self.category:
+ _dict['category'] = self.category.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in tags (list)
+ _items = []
+ if self.tags:
+ for _item_tags in self.tags:
+ if _item_tags:
+ _items.append(_item_tags.to_dict())
+ _dict['tags'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Pet from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "category": Category.from_dict(obj["category"]) if obj.get("category") is not None else None,
+ "name": obj.get("name"),
+ "photoUrls": obj.get("photoUrls"),
+ "tags": [Tag.from_dict(_item) for _item in obj["tags"]] if obj.get("tags") is not None else None,
+ "status": obj.get("status")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py
new file mode 100644
index 00000000000..06798245b8f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pig.py
@@ -0,0 +1,155 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+import pprint
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Any, List, Optional
+from petstore_api.models.basque_pig import BasquePig
+from petstore_api.models.danish_pig import DanishPig
+from pydantic import StrictStr, Field
+from typing import Union, List, Set, Optional, Dict
+from typing_extensions import Literal, Self
+
+PIG_ONE_OF_SCHEMAS = ["BasquePig", "DanishPig"]
+
+class Pig(BaseModel):
+ """
+ Pig
+ """
+ # data type: BasquePig
+ oneof_schema_1_validator: Optional[BasquePig] = None
+ # data type: DanishPig
+ oneof_schema_2_validator: Optional[DanishPig] = None
+ actual_instance: Optional[Union[BasquePig, DanishPig]] = None
+ one_of_schemas: Set[str] = { "BasquePig", "DanishPig" }
+
+ model_config = ConfigDict(
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ discriminator_value_class_map: Dict[str, str] = {
+ }
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ instance = Pig.model_construct()
+ error_messages = []
+ match = 0
+ # validate data type: BasquePig
+ if not isinstance(v, BasquePig):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BasquePig`")
+ else:
+ match += 1
+ # validate data type: DanishPig
+ if not isinstance(v, DanishPig):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DanishPig`")
+ else:
+ match += 1
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when setting `actual_instance` in Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ match = 0
+
+ # use oneOf discriminator to lookup the data type
+ _data_type = json.loads(json_str).get("className")
+ if not _data_type:
+ raise ValueError("Failed to lookup data type from the field `className` in the input.")
+
+ # check if data type is `BasquePig`
+ if _data_type == "BasquePig":
+ instance.actual_instance = BasquePig.from_json(json_str)
+ return instance
+
+ # check if data type is `DanishPig`
+ if _data_type == "DanishPig":
+ instance.actual_instance = DanishPig.from_json(json_str)
+ return instance
+
+ # deserialize data into BasquePig
+ try:
+ instance.actual_instance = BasquePig.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into DanishPig
+ try:
+ instance.actual_instance = DanishPig.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], BasquePig, DanishPig]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py
new file mode 100644
index 00000000000..74efce9a4d0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/pony_sizes.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.type import Type
+from typing import Optional, Set
+from typing_extensions import Self
+
+class PonySizes(BaseModel):
+ """
+ PonySizes
+ """ # noqa: E501
+ type: Optional[Type] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["type"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of PonySizes from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of PonySizes from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "type": obj.get("type")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py
new file mode 100644
index 00000000000..76eb72a941b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/poop_cleaning.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List
+from typing import Optional, Set
+from typing_extensions import Self
+
+class PoopCleaning(BaseModel):
+ """
+ PoopCleaning
+ """ # noqa: E501
+ task_name: StrictStr
+ function_name: StrictStr
+ content: StrictStr
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["task_name", "function_name", "content"]
+
+ @field_validator('task_name')
+ def task_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['cleaning']):
+ raise ValueError("must be one of enum values ('cleaning')")
+ return value
+
+ @field_validator('function_name')
+ def function_name_validate_enum(cls, value):
+ """Validates the enum"""
+ if value not in set(['care']):
+ raise ValueError("must be one of enum values ('care')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of PoopCleaning from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of PoopCleaning from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "task_name": obj.get("task_name"),
+ "function_name": obj.get("function_name"),
+ "content": obj.get("content")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py
new file mode 100644
index 00000000000..f7a971519f2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/primitive_string.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.base_discriminator import BaseDiscriminator
+from typing import Optional, Set
+from typing_extensions import Self
+
+class PrimitiveString(BaseDiscriminator):
+ """
+ PrimitiveString
+ """ # noqa: E501
+ value: Optional[StrictStr] = Field(default=None, alias="_value")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_typeName", "_value"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of PrimitiveString from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of PrimitiveString from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_typeName": obj.get("_typeName"),
+ "_value": obj.get("_value")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py
new file mode 100644
index 00000000000..0da2a14293d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_map.py
@@ -0,0 +1,113 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.tag import Tag
+from typing import Optional, Set
+from typing_extensions import Self
+
+class PropertyMap(BaseModel):
+ """
+ PropertyMap
+ """ # noqa: E501
+ some_data: Optional[Dict[str, Tag]] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["some_data"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of PropertyMap from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in some_data (dict)
+ _field_dict = {}
+ if self.some_data:
+ for _key_some_data in self.some_data:
+ if self.some_data[_key_some_data]:
+ _field_dict[_key_some_data] = self.some_data[_key_some_data].to_dict()
+ _dict['some_data'] = _field_dict
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of PropertyMap from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "some_data": dict(
+ (_k, Tag.from_dict(_v))
+ for _k, _v in obj["some_data"].items()
+ )
+ if obj.get("some_data") is not None
+ else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py
new file mode 100644
index 00000000000..d07aef22cd8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/property_name_collision.py
@@ -0,0 +1,104 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class PropertyNameCollision(BaseModel):
+ """
+ PropertyNameCollision
+ """ # noqa: E501
+ underscore_type: Optional[StrictStr] = Field(default=None, alias="_type")
+ type: Optional[StrictStr] = None
+ type_with_underscore: Optional[StrictStr] = Field(default=None, alias="type_")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_type", "type", "type_"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of PropertyNameCollision from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of PropertyNameCollision from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_type": obj.get("_type"),
+ "type": obj.get("type"),
+ "type_": obj.get("type_")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py
new file mode 100644
index 00000000000..5a4155fcfa1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/read_only_first.py
@@ -0,0 +1,104 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class ReadOnlyFirst(BaseModel):
+ """
+ ReadOnlyFirst
+ """ # noqa: E501
+ bar: Optional[StrictStr] = None
+ baz: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["bar", "baz"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of ReadOnlyFirst from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * OpenAPI `readOnly` fields are excluded.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "bar",
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of ReadOnlyFirst from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "bar": obj.get("bar"),
+ "baz": obj.get("baz")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py
new file mode 100644
index 00000000000..13d6327314c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_circular_all_of_ref.py
@@ -0,0 +1,112 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class SecondCircularAllOfRef(BaseModel):
+ """
+ SecondCircularAllOfRef
+ """ # noqa: E501
+ name: Optional[StrictStr] = Field(default=None, alias="_name")
+ circular_all_of_ref: Optional[List[CircularAllOfRef]] = Field(default=None, alias="circularAllOfRef")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["_name", "circularAllOfRef"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SecondCircularAllOfRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in circular_all_of_ref (list)
+ _items = []
+ if self.circular_all_of_ref:
+ for _item_circular_all_of_ref in self.circular_all_of_ref:
+ if _item_circular_all_of_ref:
+ _items.append(_item_circular_all_of_ref.to_dict())
+ _dict['circularAllOfRef'] = _items
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SecondCircularAllOfRef from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "_name": obj.get("_name"),
+ "circularAllOfRef": [CircularAllOfRef.from_dict(_item) for _item in obj["circularAllOfRef"]] if obj.get("circularAllOfRef") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.circular_all_of_ref import CircularAllOfRef
+# TODO: Rewrite to not use raise_errors
+SecondCircularAllOfRef.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py
new file mode 100644
index 00000000000..701e0dccaac
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/second_ref.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class SecondRef(BaseModel):
+ """
+ SecondRef
+ """ # noqa: E501
+ category: Optional[StrictStr] = None
+ circular_ref: Optional[CircularReferenceModel] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["category", "circular_ref"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SecondRef from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of circular_ref
+ if self.circular_ref:
+ _dict['circular_ref'] = self.circular_ref.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SecondRef from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "category": obj.get("category"),
+ "circular_ref": CircularReferenceModel.from_dict(obj["circular_ref"]) if obj.get("circular_ref") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.circular_reference_model import CircularReferenceModel
+# TODO: Rewrite to not use raise_errors
+SecondRef.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py
new file mode 100644
index 00000000000..0273b10dada
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/self_reference_model.py
@@ -0,0 +1,108 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class SelfReferenceModel(BaseModel):
+ """
+ SelfReferenceModel
+ """ # noqa: E501
+ size: Optional[StrictInt] = None
+ nested: Optional[DummyModel] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["size", "nested"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SelfReferenceModel from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of nested
+ if self.nested:
+ _dict['nested'] = self.nested.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SelfReferenceModel from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "size": obj.get("size"),
+ "nested": DummyModel.from_dict(obj["nested"]) if obj.get("nested") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+from petstore_api.models.dummy_model import DummyModel
+# TODO: Rewrite to not use raise_errors
+SelfReferenceModel.model_rebuild(raise_errors=False)
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py
new file mode 100644
index 00000000000..91ab07e2535
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/single_ref_type.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class SingleRefType(str, Enum):
+ """
+ SingleRefType
+ """
+
+ """
+ allowed enum values
+ """
+ ADMIN = 'admin'
+ USER = 'user'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of SingleRefType from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py
new file mode 100644
index 00000000000..1d85fd148d4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_character_enum.py
@@ -0,0 +1,45 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class SpecialCharacterEnum(str, Enum):
+ """
+ SpecialCharacterEnum
+ """
+
+ """
+ allowed enum values
+ """
+ ENUM_456 = '456'
+ ENUM_123ABC = '123abc'
+ UNDERSCORE = '_'
+ SPACE = ' '
+ AMPERSAND = '&'
+ DOLLAR = '$'
+ GREATER_THAN_EQUAL = '>='
+ THIS_IS_EXCLAMATION = 'this_is_!'
+ IMPORT = 'import'
+ HELLO_WORLD = ' hello world '
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of SpecialCharacterEnum from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py
new file mode 100644
index 00000000000..84686054875
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_model_name.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class SpecialModelName(BaseModel):
+ """
+ SpecialModelName
+ """ # noqa: E501
+ special_property_name: Optional[StrictInt] = Field(default=None, alias="$special[property.name]")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["$special[property.name]"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SpecialModelName from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SpecialModelName from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "$special[property.name]": obj.get("$special[property.name]")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py
new file mode 100644
index 00000000000..e43761d33df
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/special_name.py
@@ -0,0 +1,118 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.category import Category
+from typing import Optional, Set
+from typing_extensions import Self
+
+class SpecialName(BaseModel):
+ """
+ SpecialName
+ """ # noqa: E501
+ var_property: Optional[StrictInt] = Field(default=None, alias="property")
+ var_async: Optional[Category] = Field(default=None, alias="async")
+ var_schema: Optional[StrictStr] = Field(default=None, description="pet status in the store", alias="schema")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["property", "async", "schema"]
+
+ @field_validator('var_schema')
+ def var_schema_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['available', 'pending', 'sold']):
+ raise ValueError("must be one of enum values ('available', 'pending', 'sold')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of SpecialName from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of var_async
+ if self.var_async:
+ _dict['async'] = self.var_async.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of SpecialName from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "property": obj.get("property"),
+ "async": Category.from_dict(obj["async"]) if obj.get("async") is not None else None,
+ "schema": obj.get("schema")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py
new file mode 100644
index 00000000000..b3893aecb68
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tag.py
@@ -0,0 +1,102 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Tag(BaseModel):
+ """
+ Tag
+ """ # noqa: E501
+ id: Optional[StrictInt] = None
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Tag from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Tag from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py
new file mode 100644
index 00000000000..a8e0fa11ff8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task.py
@@ -0,0 +1,107 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict
+from typing import Any, ClassVar, Dict, List
+from uuid import UUID
+from petstore_api.models.task_activity import TaskActivity
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Task(BaseModel):
+ """
+ Used to test oneOf enums with only one string value.
+ """ # noqa: E501
+ id: UUID
+ activity: TaskActivity
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "activity"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Task from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of activity
+ if self.activity:
+ _dict['activity'] = self.activity.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Task from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "activity": TaskActivity.from_dict(obj["activity"]) if obj.get("activity") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py
new file mode 100644
index 00000000000..cc1e1fc5a60
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/task_activity.py
@@ -0,0 +1,151 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+import pprint
+from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
+from typing import Any, List, Optional
+from petstore_api.models.bathing import Bathing
+from petstore_api.models.feeding import Feeding
+from petstore_api.models.poop_cleaning import PoopCleaning
+from pydantic import StrictStr, Field
+from typing import Union, List, Set, Optional, Dict
+from typing_extensions import Literal, Self
+
+TASKACTIVITY_ONE_OF_SCHEMAS = ["Bathing", "Feeding", "PoopCleaning"]
+
+class TaskActivity(BaseModel):
+ """
+ TaskActivity
+ """
+ # data type: PoopCleaning
+ oneof_schema_1_validator: Optional[PoopCleaning] = None
+ # data type: Feeding
+ oneof_schema_2_validator: Optional[Feeding] = None
+ # data type: Bathing
+ oneof_schema_3_validator: Optional[Bathing] = None
+ actual_instance: Optional[Union[Bathing, Feeding, PoopCleaning]] = None
+ one_of_schemas: Set[str] = { "Bathing", "Feeding", "PoopCleaning" }
+
+ model_config = ConfigDict(
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @field_validator('actual_instance')
+ def actual_instance_must_validate_oneof(cls, v):
+ instance = TaskActivity.model_construct()
+ error_messages = []
+ match = 0
+ # validate data type: PoopCleaning
+ if not isinstance(v, PoopCleaning):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PoopCleaning`")
+ else:
+ match += 1
+ # validate data type: Feeding
+ if not isinstance(v, Feeding):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Feeding`")
+ else:
+ match += 1
+ # validate data type: Bathing
+ if not isinstance(v, Bathing):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Bathing`")
+ else:
+ match += 1
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when setting `actual_instance` in TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when setting `actual_instance` in TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages))
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Returns the object represented by the json string"""
+ instance = cls.model_construct()
+ error_messages = []
+ match = 0
+
+ # deserialize data into PoopCleaning
+ try:
+ instance.actual_instance = PoopCleaning.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into Feeding
+ try:
+ instance.actual_instance = Feeding.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into Bathing
+ try:
+ instance.actual_instance = Bathing.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError("Multiple matches found when deserializing the JSON string into TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages))
+ elif match == 0:
+ # no match
+ raise ValueError("No match found when deserializing the JSON string into TaskActivity with oneOf schemas: Bathing, Feeding, PoopCleaning. Details: " + ", ".join(error_messages))
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> Optional[Union[Dict[str, Any], Bathing, Feeding, PoopCleaning]]:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.model_dump())
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py
new file mode 100644
index 00000000000..8eae227a84e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class TestEnum(str, Enum):
+ """
+ TestEnum
+ """
+
+ """
+ allowed enum values
+ """
+ ONE = 'ONE'
+ TWO = 'TWO'
+ THREE = 'THREE'
+ FOUR = 'foUr'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of TestEnum from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py
new file mode 100644
index 00000000000..9304d3ab849
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_enum_with_default.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class TestEnumWithDefault(str, Enum):
+ """
+ TestEnumWithDefault
+ """
+
+ """
+ allowed enum values
+ """
+ EIN = 'EIN'
+ ZWEI = 'ZWEI'
+ DREI = 'DREI'
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of TestEnumWithDefault from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py
new file mode 100644
index 00000000000..f5fe068c911
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model400_response.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class TestErrorResponsesWithModel400Response(BaseModel):
+ """
+ TestErrorResponsesWithModel400Response
+ """ # noqa: E501
+ reason400: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["reason400"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TestErrorResponsesWithModel400Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TestErrorResponsesWithModel400Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "reason400": obj.get("reason400")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py
new file mode 100644
index 00000000000..39e6c512ed3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_error_responses_with_model404_response.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class TestErrorResponsesWithModel404Response(BaseModel):
+ """
+ TestErrorResponsesWithModel404Response
+ """ # noqa: E501
+ reason404: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["reason404"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TestErrorResponsesWithModel404Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TestErrorResponsesWithModel404Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "reason404": obj.get("reason404")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py
new file mode 100644
index 00000000000..7b93d84864f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_inline_freeform_additional_properties_request.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class TestInlineFreeformAdditionalPropertiesRequest(BaseModel):
+ """
+ TestInlineFreeformAdditionalPropertiesRequest
+ """ # noqa: E501
+ some_property: Optional[StrictStr] = Field(default=None, alias="someProperty")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["someProperty"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TestInlineFreeformAdditionalPropertiesRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "someProperty": obj.get("someProperty")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py
new file mode 100644
index 00000000000..4bff5e699a3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_model_with_enum_default.py
@@ -0,0 +1,120 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.test_enum import TestEnum
+from petstore_api.models.test_enum_with_default import TestEnumWithDefault
+from typing import Optional, Set
+from typing_extensions import Self
+
+class TestModelWithEnumDefault(BaseModel):
+ """
+ TestModelWithEnumDefault
+ """ # noqa: E501
+ test_enum: TestEnum
+ test_string: Optional[StrictStr] = None
+ test_enum_with_default: Optional[TestEnumWithDefault] = TestEnumWithDefault.ZWEI
+ test_string_with_default: Optional[StrictStr] = 'ahoy matey'
+ test_inline_defined_enum_with_default: Optional[StrictStr] = 'B'
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["test_enum", "test_string", "test_enum_with_default", "test_string_with_default", "test_inline_defined_enum_with_default"]
+
+ @field_validator('test_inline_defined_enum_with_default')
+ def test_inline_defined_enum_with_default_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in set(['A', 'B', 'C']):
+ raise ValueError("must be one of enum values ('A', 'B', 'C')")
+ return value
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TestModelWithEnumDefault from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TestModelWithEnumDefault from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "test_enum": obj.get("test_enum"),
+ "test_string": obj.get("test_string"),
+ "test_enum_with_default": obj.get("test_enum_with_default") if obj.get("test_enum_with_default") is not None else TestEnumWithDefault.ZWEI,
+ "test_string_with_default": obj.get("test_string_with_default") if obj.get("test_string_with_default") is not None else 'ahoy matey',
+ "test_inline_defined_enum_with_default": obj.get("test_inline_defined_enum_with_default") if obj.get("test_inline_defined_enum_with_default") is not None else 'B'
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py
new file mode 100644
index 00000000000..c31d72482d5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/test_object_for_multipart_requests_request_marker.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class TestObjectForMultipartRequestsRequestMarker(BaseModel):
+ """
+ TestObjectForMultipartRequestsRequestMarker
+ """ # noqa: E501
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of TestObjectForMultipartRequestsRequestMarker from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of TestObjectForMultipartRequestsRequestMarker from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py
new file mode 100644
index 00000000000..c2dab004fe1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/tiger.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class Tiger(BaseModel):
+ """
+ Tiger
+ """ # noqa: E501
+ skill: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["skill"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of Tiger from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of Tiger from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "skill": obj.get("skill")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py
new file mode 100644
index 00000000000..35a847de894
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/type.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import json
+from enum import Enum
+from typing_extensions import Self
+
+
+class Type(int, Enum):
+ """
+ Type
+ """
+
+ """
+ allowed enum values
+ """
+ NUMBER_2_DOT_0 = 2.0
+ NUMBER_1_DOT_0 = 1.0
+ NUMBER_0_DOT_5 = 0.5
+ NUMBER_0_DOT_25 = 0.25
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Self:
+ """Create an instance of Type from a JSON string"""
+ return cls(json.loads(json_str))
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py
new file mode 100644
index 00000000000..e5b5cb4dded
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_model_list_properties.py
@@ -0,0 +1,117 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.creature_info import CreatureInfo
+from typing import Optional, Set
+from typing_extensions import Self
+
+class UnnamedDictWithAdditionalModelListProperties(BaseModel):
+ """
+ UnnamedDictWithAdditionalModelListProperties
+ """ # noqa: E501
+ dict_property: Optional[Dict[str, List[CreatureInfo]]] = Field(default=None, alias="dictProperty")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["dictProperty"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of UnnamedDictWithAdditionalModelListProperties from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each value in dict_property (dict of array)
+ _field_dict_of_array = {}
+ if self.dict_property:
+ for _key_dict_property in self.dict_property:
+ if self.dict_property[_key_dict_property] is not None:
+ _field_dict_of_array[_key_dict_property] = [
+ _item.to_dict() for _item in self.dict_property[_key_dict_property]
+ ]
+ _dict['dictProperty'] = _field_dict_of_array
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of UnnamedDictWithAdditionalModelListProperties from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "dictProperty": dict(
+ (_k,
+ [CreatureInfo.from_dict(_item) for _item in _v]
+ if _v is not None
+ else None
+ )
+ for _k, _v in obj.get("dictProperty", {}).items()
+ )
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py
new file mode 100644
index 00000000000..f4c7625325c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/unnamed_dict_with_additional_string_list_properties.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class UnnamedDictWithAdditionalStringListProperties(BaseModel):
+ """
+ UnnamedDictWithAdditionalStringListProperties
+ """ # noqa: E501
+ dict_property: Optional[Dict[str, List[StrictStr]]] = Field(default=None, alias="dictProperty")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["dictProperty"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of UnnamedDictWithAdditionalStringListProperties from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of UnnamedDictWithAdditionalStringListProperties from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "dictProperty": obj.get("dictProperty")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py
new file mode 100644
index 00000000000..6d79131bfe7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/upload_file_with_additional_properties_request_object.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class UploadFileWithAdditionalPropertiesRequestObject(BaseModel):
+ """
+ Additional object
+ """ # noqa: E501
+ name: Optional[StrictStr] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["name"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of UploadFileWithAdditionalPropertiesRequestObject from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of UploadFileWithAdditionalPropertiesRequestObject from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "name": obj.get("name")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py
new file mode 100644
index 00000000000..ceeb6d4ae54
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/user.py
@@ -0,0 +1,114 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
+from typing import Any, ClassVar, Dict, List, Optional
+from typing import Optional, Set
+from typing_extensions import Self
+
+class User(BaseModel):
+ """
+ User
+ """ # noqa: E501
+ id: Optional[StrictInt] = None
+ username: Optional[StrictStr] = None
+ first_name: Optional[StrictStr] = Field(default=None, alias="firstName")
+ last_name: Optional[StrictStr] = Field(default=None, alias="lastName")
+ email: Optional[StrictStr] = None
+ password: Optional[StrictStr] = None
+ phone: Optional[StrictStr] = None
+ user_status: Optional[StrictInt] = Field(default=None, description="User Status", alias="userStatus")
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of User from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of User from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "id": obj.get("id"),
+ "username": obj.get("username"),
+ "firstName": obj.get("firstName"),
+ "lastName": obj.get("lastName"),
+ "email": obj.get("email"),
+ "password": obj.get("password"),
+ "phone": obj.get("phone"),
+ "userStatus": obj.get("userStatus")
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py
new file mode 100644
index 00000000000..eb7e90879e9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/models/with_nested_one_of.py
@@ -0,0 +1,112 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from pydantic import BaseModel, ConfigDict, StrictInt
+from typing import Any, ClassVar, Dict, List, Optional
+from petstore_api.models.one_of_enum_string import OneOfEnumString
+from petstore_api.models.pig import Pig
+from typing import Optional, Set
+from typing_extensions import Self
+
+class WithNestedOneOf(BaseModel):
+ """
+ WithNestedOneOf
+ """ # noqa: E501
+ size: Optional[StrictInt] = None
+ nested_pig: Optional[Pig] = None
+ nested_oneof_enum_string: Optional[OneOfEnumString] = None
+ additional_properties: Dict[str, Any] = {}
+ __properties: ClassVar[List[str]] = ["size", "nested_pig", "nested_oneof_enum_string"]
+
+ model_config = ConfigDict(
+ populate_by_name=True,
+ validate_assignment=True,
+ protected_namespaces=(),
+ )
+
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.model_dump(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Optional[Self]:
+ """Create an instance of WithNestedOneOf from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self) -> Dict[str, Any]:
+ """Return the dictionary representation of the model using alias.
+
+ This has the following differences from calling pydantic's
+ `self.model_dump(by_alias=True)`:
+
+ * `None` is only added to the output dict for nullable fields that
+ were set at model initialization. Other fields with value `None`
+ are ignored.
+ * Fields in `self.additional_properties` are added to the output dict.
+ """
+ excluded_fields: Set[str] = set([
+ "additional_properties",
+ ])
+
+ _dict = self.model_dump(
+ by_alias=True,
+ exclude=excluded_fields,
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of nested_pig
+ if self.nested_pig:
+ _dict['nested_pig'] = self.nested_pig.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of nested_oneof_enum_string
+ if self.nested_oneof_enum_string:
+ _dict['nested_oneof_enum_string'] = self.nested_oneof_enum_string.to_dict()
+ # puts key-value pairs in additional_properties in the top level
+ if self.additional_properties is not None:
+ for _key, _value in self.additional_properties.items():
+ _dict[_key] = _value
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
+ """Create an instance of WithNestedOneOf from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return cls.model_validate(obj)
+
+ _obj = cls.model_validate({
+ "size": obj.get("size"),
+ "nested_pig": Pig.from_dict(obj["nested_pig"]) if obj.get("nested_pig") is not None else None,
+ "nested_oneof_enum_string": OneOfEnumString.from_dict(obj["nested_oneof_enum_string"]) if obj.get("nested_oneof_enum_string") is not None else None
+ })
+ # store additional fields in additional_properties
+ for _key in obj.keys():
+ if _key not in cls.__properties:
+ _obj.additional_properties[_key] = obj.get(_key)
+
+ return _obj
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/py.typed b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/py.typed
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py
new file mode 100644
index 00000000000..abc7aa28938
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/rest.py
@@ -0,0 +1,258 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import io
+import json
+import re
+import ssl
+
+import urllib3
+
+from petstore_api.exceptions import ApiException, ApiValueError
+
+SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
+RESTResponseType = urllib3.HTTPResponse
+
+
+def is_socks_proxy_url(url):
+ if url is None:
+ return False
+ split_section = url.split("://")
+ if len(split_section) < 2:
+ return False
+ else:
+ return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
+
+
+class RESTResponse(io.IOBase):
+
+ def __init__(self, resp) -> None:
+ self.response = resp
+ self.status = resp.status
+ self.reason = resp.reason
+ self.data = None
+
+ def read(self):
+ if self.data is None:
+ self.data = self.response.data
+ return self.data
+
+ def getheaders(self):
+ """Returns a dictionary of the response headers."""
+ return self.response.headers
+
+ def getheader(self, name, default=None):
+ """Returns a given response header."""
+ return self.response.headers.get(name, default)
+
+
+class RESTClientObject:
+
+ def __init__(self, configuration) -> None:
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
+
+ # cert_reqs
+ if configuration.verify_ssl:
+ cert_reqs = ssl.CERT_REQUIRED
+ else:
+ cert_reqs = ssl.CERT_NONE
+
+ pool_args = {
+ "cert_reqs": cert_reqs,
+ "ca_certs": configuration.ssl_ca_cert,
+ "cert_file": configuration.cert_file,
+ "key_file": configuration.key_file,
+ "ca_cert_data": configuration.ca_cert_data,
+ }
+ if configuration.assert_hostname is not None:
+ pool_args['assert_hostname'] = (
+ configuration.assert_hostname
+ )
+
+ if configuration.retries is not None:
+ pool_args['retries'] = configuration.retries
+
+ if configuration.tls_server_name:
+ pool_args['server_hostname'] = configuration.tls_server_name
+
+
+ if configuration.socket_options is not None:
+ pool_args['socket_options'] = configuration.socket_options
+
+ if configuration.connection_pool_maxsize is not None:
+ pool_args['maxsize'] = configuration.connection_pool_maxsize
+
+ # https pool manager
+ self.pool_manager: urllib3.PoolManager
+
+ if configuration.proxy:
+ if is_socks_proxy_url(configuration.proxy):
+ from urllib3.contrib.socks import SOCKSProxyManager
+ pool_args["proxy_url"] = configuration.proxy
+ pool_args["headers"] = configuration.proxy_headers
+ self.pool_manager = SOCKSProxyManager(**pool_args)
+ else:
+ pool_args["proxy_url"] = configuration.proxy
+ pool_args["proxy_headers"] = configuration.proxy_headers
+ self.pool_manager = urllib3.ProxyManager(**pool_args)
+ else:
+ self.pool_manager = urllib3.PoolManager(**pool_args)
+
+ def request(
+ self,
+ method,
+ url,
+ headers=None,
+ body=None,
+ post_params=None,
+ _request_timeout=None
+ ):
+ """Perform requests.
+
+ :param method: http request method
+ :param url: http request url
+ :param headers: http request headers
+ :param body: request json body, for `application/json`
+ :param post_params: request post parameters,
+ `application/x-www-form-urlencoded`
+ and `multipart/form-data`
+ :param _request_timeout: timeout setting for this request. If one
+ number provided, it will be total request
+ timeout. It can also be a pair (tuple) of
+ (connection, read) timeouts.
+ """
+ method = method.upper()
+ assert method in [
+ 'GET',
+ 'HEAD',
+ 'DELETE',
+ 'POST',
+ 'PUT',
+ 'PATCH',
+ 'OPTIONS'
+ ]
+
+ if post_params and body:
+ raise ApiValueError(
+ "body parameter cannot be used with post_params parameter."
+ )
+
+ post_params = post_params or {}
+ headers = headers or {}
+
+ timeout = None
+ if _request_timeout:
+ if isinstance(_request_timeout, (int, float)):
+ timeout = urllib3.Timeout(total=_request_timeout)
+ elif (
+ isinstance(_request_timeout, tuple)
+ and len(_request_timeout) == 2
+ ):
+ timeout = urllib3.Timeout(
+ connect=_request_timeout[0],
+ read=_request_timeout[1]
+ )
+
+ try:
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
+
+ # no content type provided or payload is json
+ content_type = headers.get('Content-Type')
+ if (
+ not content_type
+ or re.search('json', content_type, re.IGNORECASE)
+ ):
+ request_body = None
+ if body is not None:
+ request_body = json.dumps(body)
+ r = self.pool_manager.request(
+ method,
+ url,
+ body=request_body,
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
+ elif content_type == 'application/x-www-form-urlencoded':
+ r = self.pool_manager.request(
+ method,
+ url,
+ fields=post_params,
+ encode_multipart=False,
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
+ elif content_type == 'multipart/form-data':
+ # must del headers['Content-Type'], or the correct
+ # Content-Type which generated by urllib3 will be
+ # overwritten.
+ del headers['Content-Type']
+ # Ensures that dict objects are serialized
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
+ r = self.pool_manager.request(
+ method,
+ url,
+ fields=post_params,
+ encode_multipart=True,
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
+ # Pass a `string` parameter directly in the body to support
+ # other content types than JSON when `body` argument is
+ # provided in serialized form.
+ elif isinstance(body, str) or isinstance(body, bytes):
+ r = self.pool_manager.request(
+ method,
+ url,
+ body=body,
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
+ elif headers['Content-Type'].startswith('text/') and isinstance(body, bool):
+ request_body = "true" if body else "false"
+ r = self.pool_manager.request(
+ method,
+ url,
+ body=request_body,
+ preload_content=False,
+ timeout=timeout,
+ headers=headers)
+ else:
+ # Cannot generate the request from given parameters
+ msg = """Cannot prepare a request message for provided
+ arguments. Please check that your arguments match
+ declared content type."""
+ raise ApiException(status=0, reason=msg)
+ # For `GET`, `HEAD`
+ else:
+ r = self.pool_manager.request(
+ method,
+ url,
+ fields={},
+ timeout=timeout,
+ headers=headers,
+ preload_content=False
+ )
+ except urllib3.exceptions.SSLError as e:
+ msg = "\n".join([type(e).__name__, str(e)])
+ raise ApiException(status=0, reason=msg)
+
+ return RESTResponse(r)
diff --git a/samples/openapi3/client/petstore/python-lazyImports/petstore_api/signing.py b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/signing.py
new file mode 100644
index 00000000000..e0ef058f467
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/petstore_api/signing.py
@@ -0,0 +1,432 @@
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from base64 import b64encode
+from Crypto.IO import PEM, PKCS8
+from Crypto.Hash import SHA256, SHA512
+from Crypto.Hash.SHA512 import SHA512Hash
+from Crypto.Hash.SHA256 import SHA256Hash
+from Crypto.PublicKey import RSA, ECC
+from Crypto.Signature import PKCS1_v1_5, pss, DSS
+from datetime import timedelta
+from email.utils import formatdate
+import os
+import re
+from time import time
+from typing import List, Optional, Union
+from urllib.parse import urlencode, urlparse
+
+# The constants below define a subset of HTTP headers that can be included in the
+# HTTP signature scheme. Additional headers may be included in the signature.
+
+# The '(request-target)' header is a calculated field that includes the HTTP verb,
+# the URL path and the URL query.
+HEADER_REQUEST_TARGET = '(request-target)'
+# The time when the HTTP signature was generated.
+HEADER_CREATED = '(created)'
+# The time when the HTTP signature expires. The API server should reject HTTP requests
+# that have expired.
+HEADER_EXPIRES = '(expires)'
+# The 'Host' header.
+HEADER_HOST = 'Host'
+# The 'Date' header.
+HEADER_DATE = 'Date'
+# When the 'Digest' header is included in the HTTP signature, the client automatically
+# computes the digest of the HTTP request body, per RFC 3230.
+HEADER_DIGEST = 'Digest'
+# The 'Authorization' header is automatically generated by the client. It includes
+# the list of signed headers and a base64-encoded signature.
+HEADER_AUTHORIZATION = 'Authorization'
+
+# The constants below define the cryptographic schemes for the HTTP signature scheme.
+SCHEME_HS2019 = 'hs2019'
+SCHEME_RSA_SHA256 = 'rsa-sha256'
+SCHEME_RSA_SHA512 = 'rsa-sha512'
+
+# The constants below define the signature algorithms that can be used for the HTTP
+# signature scheme.
+ALGORITHM_RSASSA_PSS = 'RSASSA-PSS'
+ALGORITHM_RSASSA_PKCS1v15 = 'RSASSA-PKCS1-v1_5'
+
+ALGORITHM_ECDSA_MODE_FIPS_186_3 = 'fips-186-3'
+ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979 = 'deterministic-rfc6979'
+ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS = {
+ ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979
+}
+
+# The cryptographic hash algorithm for the message signature.
+HASH_SHA256 = 'sha256'
+HASH_SHA512 = 'sha512'
+
+
+class HttpSigningConfiguration:
+ """The configuration parameters for the HTTP signature security scheme.
+
+ The HTTP signature security scheme is used to sign HTTP requests with a private key
+ which is in possession of the API client.
+
+ An ``Authorization`` header is calculated by creating a hash of select headers,
+ and optionally the body of the HTTP request, then signing the hash value using
+ a private key. The ``Authorization`` header is added to outbound HTTP requests.
+
+ :param key_id: A string value specifying the identifier of the cryptographic key,
+ when signing HTTP requests.
+ :param signing_scheme: A string value specifying the signature scheme, when
+ signing HTTP requests.
+ Supported value are: ``hs2019``, ``rsa-sha256``, ``rsa-sha512``.
+ Avoid using ``rsa-sha256``, ``rsa-sha512`` as they are deprecated. These values are
+ available for server-side applications that only support the older
+ HTTP signature algorithms.
+ :param private_key_path: A string value specifying the path of the file containing
+ a private key. The private key is used to sign HTTP requests.
+ :param private_key_passphrase: A string value specifying the passphrase to decrypt
+ the private key.
+ :param signed_headers: A list of strings. Each value is the name of a HTTP header
+ that must be included in the HTTP signature calculation.
+ The two special signature headers ``(request-target)`` and ``(created)`` SHOULD be
+ included in SignedHeaders.
+ The ``(created)`` header expresses when the signature was created.
+ The ``(request-target)`` header is a concatenation of the lowercased :method, an
+ ASCII space, and the :path pseudo-headers.
+ When signed_headers is not specified, the client defaults to a single value,
+ ``(created)``, in the list of HTTP headers.
+ When SignedHeaders contains the 'Digest' value, the client performs the
+ following operations:
+ 1. Calculate a digest of request body, as specified in `RFC3230,
+ section 4.3.2`_.
+ 2. Set the ``Digest`` header in the request body.
+ 3. Include the ``Digest`` header and value in the HTTP signature.
+ :param signing_algorithm: A string value specifying the signature algorithm, when
+ signing HTTP requests.
+ Supported values are:
+ 1. For RSA keys: RSASSA-PSS, RSASSA-PKCS1-v1_5.
+ 2. For ECDSA keys: fips-186-3, deterministic-rfc6979.
+ If None, the signing algorithm is inferred from the private key.
+ The default signing algorithm for RSA keys is RSASSA-PSS.
+ The default signing algorithm for ECDSA keys is fips-186-3.
+ :param hash_algorithm: The hash algorithm for the signature. Supported values are
+ sha256 and sha512.
+ If the signing_scheme is rsa-sha256, the hash algorithm must be set
+ to None or sha256.
+ If the signing_scheme is rsa-sha512, the hash algorithm must be set
+ to None or sha512.
+ :param signature_max_validity: The signature max validity, expressed as
+ a datetime.timedelta value. It must be a positive value.
+ """
+ def __init__(self,
+ key_id: str,
+ signing_scheme: str,
+ private_key_path: str,
+ private_key_passphrase: Union[None, str]=None,
+ signed_headers: Optional[List[str]]=None,
+ signing_algorithm: Optional[str]=None,
+ hash_algorithm: Optional[str]=None,
+ signature_max_validity: Optional[timedelta]=None,
+ ) -> None:
+ self.key_id = key_id
+ if signing_scheme not in {SCHEME_HS2019, SCHEME_RSA_SHA256, SCHEME_RSA_SHA512}:
+ raise Exception("Unsupported security scheme: {0}".format(signing_scheme))
+ self.signing_scheme = signing_scheme
+ if not os.path.exists(private_key_path):
+ raise Exception("Private key file does not exist")
+ self.private_key_path = private_key_path
+ self.private_key_passphrase = private_key_passphrase
+ self.signing_algorithm = signing_algorithm
+ self.hash_algorithm = hash_algorithm
+ if signing_scheme == SCHEME_RSA_SHA256:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm != HASH_SHA256:
+ raise Exception("Hash algorithm must be sha256 when security scheme is %s" %
+ SCHEME_RSA_SHA256)
+ elif signing_scheme == SCHEME_RSA_SHA512:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA512
+ elif self.hash_algorithm != HASH_SHA512:
+ raise Exception("Hash algorithm must be sha512 when security scheme is %s" %
+ SCHEME_RSA_SHA512)
+ elif signing_scheme == SCHEME_HS2019:
+ if self.hash_algorithm is None:
+ self.hash_algorithm = HASH_SHA256
+ elif self.hash_algorithm not in {HASH_SHA256, HASH_SHA512}:
+ raise Exception("Invalid hash algorithm")
+ if signature_max_validity is not None and signature_max_validity.total_seconds() < 0:
+ raise Exception("The signature max validity must be a positive value")
+ self.signature_max_validity = signature_max_validity
+ # If the user has not provided any signed_headers, the default must be set to '(created)',
+ # as specified in the 'HTTP signature' standard.
+ if signed_headers is None or len(signed_headers) == 0:
+ signed_headers = [HEADER_CREATED]
+ if self.signature_max_validity is None and HEADER_EXPIRES in signed_headers:
+ raise Exception(
+ "Signature max validity must be set when "
+ "'(expires)' signature parameter is specified")
+ if len(signed_headers) != len(set(signed_headers)):
+ raise Exception("Cannot have duplicates in the signed_headers parameter")
+ if HEADER_AUTHORIZATION in signed_headers:
+ raise Exception("'Authorization' header cannot be included in signed headers")
+ self.signed_headers = signed_headers
+ self.private_key: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None
+ """The private key used to sign HTTP requests.
+ Initialized when the PEM-encoded private key is loaded from a file.
+ """
+ self.host: Optional[str] = None
+ """The host name, optionally followed by a colon and TCP port number.
+ """
+ self._load_private_key()
+
+ def get_http_signature_headers(self, resource_path, method, headers, body, query_params):
+ """Create a cryptographic message signature for the HTTP request and add the signed headers.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A dict of HTTP headers that must be added to the outbound HTTP request.
+ """
+ if method is None:
+ raise Exception("HTTP method must be set")
+ if resource_path is None:
+ raise Exception("Resource path must be set")
+
+ signed_headers_list, request_headers_dict = self._get_signed_header_info(
+ resource_path, method, headers, body, query_params)
+
+ header_items = [
+ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list]
+ string_to_sign = "\n".join(header_items)
+
+ digest, digest_prefix = self._get_message_digest(string_to_sign.encode())
+ b64_signed_msg = self._sign_digest(digest)
+
+ request_headers_dict[HEADER_AUTHORIZATION] = self._get_authorization_header(
+ signed_headers_list, b64_signed_msg)
+
+ return request_headers_dict
+
+ def get_public_key(self):
+ """Returns the public key object associated with the private key.
+ """
+ pubkey: Optional[Union[ECC.EccKey, RSA.RsaKey]] = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ pubkey = self.private_key.publickey()
+ elif isinstance(self.private_key, ECC.EccKey):
+ pubkey = self.private_key.public_key()
+ return pubkey
+
+ def _load_private_key(self):
+ """Load the private key used to sign HTTP requests.
+ The private key is used to sign HTTP requests as defined in
+ https://datatracker.ietf.org/doc/draft-cavage-http-signatures/.
+ """
+ if self.private_key is not None:
+ return
+ with open(self.private_key_path, 'r') as f:
+ pem_data = f.read()
+ # Verify PEM Pre-Encapsulation Boundary
+ r = re.compile(r"\s*-----BEGIN (.*)-----\s+")
+ m = r.match(pem_data)
+ if not m:
+ raise ValueError("Not a valid PEM pre boundary")
+ pem_header = m.group(1)
+ if pem_header == 'RSA PRIVATE KEY':
+ self.private_key = RSA.importKey(pem_data, self.private_key_passphrase)
+ elif pem_header == 'EC PRIVATE KEY':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ elif pem_header in {'PRIVATE KEY', 'ENCRYPTED PRIVATE KEY'}:
+ # Key is in PKCS8 format, which is capable of holding many different
+ # types of private keys, not just EC keys.
+ if self.private_key_passphrase is not None:
+ passphrase = self.private_key_passphrase.encode("utf-8")
+ else:
+ passphrase = None
+ (key_binary, pem_header, is_encrypted) = PEM.decode(pem_data, passphrase)
+ (oid, privkey, params) = \
+ PKCS8.unwrap(key_binary, passphrase=self.private_key_passphrase)
+ if oid == '1.2.840.10045.2.1':
+ self.private_key = ECC.import_key(pem_data, self.private_key_passphrase)
+ else:
+ raise Exception("Unsupported key: {0}. OID: {1}".format(pem_header, oid))
+ else:
+ raise Exception("Unsupported key: {0}".format(pem_header))
+ # Validate the specified signature algorithm is compatible with the private key.
+ if self.signing_algorithm is not None:
+ supported_algs = None
+ if isinstance(self.private_key, RSA.RsaKey):
+ supported_algs = {ALGORITHM_RSASSA_PSS, ALGORITHM_RSASSA_PKCS1v15}
+ elif isinstance(self.private_key, ECC.EccKey):
+ supported_algs = ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS
+ if supported_algs is not None and self.signing_algorithm not in supported_algs:
+ raise Exception(
+ "Signing algorithm {0} is not compatible with private key".format(
+ self.signing_algorithm))
+
+ def _get_signed_header_info(self, resource_path, method, headers, body, query_params):
+ """Build the HTTP headers (name, value) that need to be included in
+ the HTTP signature scheme.
+
+ :param resource_path : A string representation of the HTTP request resource path.
+ :param method: A string representation of the HTTP request method, e.g. GET, POST.
+ :param headers: A dict containing the HTTP request headers.
+ :param body: The object (e.g. a dict) representing the HTTP request body.
+ :param query_params: A string representing the HTTP request query parameters.
+ :return: A tuple containing two dict objects:
+ The first dict contains the HTTP headers that are used to calculate
+ the HTTP signature.
+ The second dict contains the HTTP headers that must be added to
+ the outbound HTTP request.
+ """
+
+ if body is None:
+ body = ''
+ else:
+ body = body.to_json()
+
+ # Build the '(request-target)' HTTP signature parameter.
+ target_host = urlparse(self.host).netloc
+ target_path = urlparse(self.host).path
+ request_target = method.lower() + " " + target_path + resource_path
+ if query_params:
+ request_target += "?" + urlencode(query_params)
+
+ # Get UNIX time, e.g. seconds since epoch, not including leap seconds.
+ now = time()
+ # Format date per RFC 7231 section-7.1.1.2. An example is:
+ # Date: Wed, 21 Oct 2015 07:28:00 GMT
+ cdate = formatdate(timeval=now, localtime=False, usegmt=True)
+ # The '(created)' value MUST be a Unix timestamp integer value.
+ # Subsecond precision is not supported.
+ created = int(now)
+ if self.signature_max_validity is not None:
+ expires = now + self.signature_max_validity.total_seconds()
+
+ signed_headers_list = []
+ request_headers_dict = {}
+ for hdr_key in self.signed_headers:
+ hdr_key = hdr_key.lower()
+ if hdr_key == HEADER_REQUEST_TARGET:
+ value = request_target
+ elif hdr_key == HEADER_CREATED:
+ value = '{0}'.format(created)
+ elif hdr_key == HEADER_EXPIRES:
+ value = '{0}'.format(expires)
+ elif hdr_key == HEADER_DATE.lower():
+ value = cdate
+ request_headers_dict[HEADER_DATE] = '{0}'.format(cdate)
+ elif hdr_key == HEADER_DIGEST.lower():
+ request_body = body.encode()
+ body_digest, digest_prefix = self._get_message_digest(request_body)
+ b64_body_digest = b64encode(body_digest.digest())
+ value = digest_prefix + b64_body_digest.decode('ascii')
+ request_headers_dict[HEADER_DIGEST] = '{0}{1}'.format(
+ digest_prefix, b64_body_digest.decode('ascii'))
+ elif hdr_key == HEADER_HOST.lower():
+ if isinstance(target_host, bytes):
+ value = target_host.decode('ascii')
+ else:
+ value = target_host
+ request_headers_dict[HEADER_HOST] = value
+ else:
+ value = next((v for k, v in headers.items() if k.lower() == hdr_key), None)
+ if value is None:
+ raise Exception(
+ "Cannot sign HTTP request. "
+ "Request does not contain the '{0}' header".format(hdr_key))
+ signed_headers_list.append((hdr_key, value))
+
+ return signed_headers_list, request_headers_dict
+
+ def _get_message_digest(self, data):
+ """Calculates and returns a cryptographic digest of a specified HTTP request.
+
+ :param data: The string representation of the date to be hashed with a cryptographic hash.
+ :return: A tuple of (digest, prefix).
+ The digest is a hashing object that contains the cryptographic digest of
+ the HTTP request.
+ The prefix is a string that identifies the cryptographic hash. It is used
+ to generate the 'Digest' header as specified in RFC 3230.
+ """
+
+ digest: Union[SHA256Hash, SHA512Hash]
+
+ if self.hash_algorithm == HASH_SHA512:
+ digest = SHA512.new()
+ prefix = 'SHA-512='
+ elif self.hash_algorithm == HASH_SHA256:
+ digest = SHA256.new()
+ prefix = 'SHA-256='
+ else:
+ raise Exception("Unsupported hash algorithm: {0}".format(self.hash_algorithm))
+ digest.update(data)
+ return digest, prefix
+
+ def _sign_digest(self, digest):
+ """Signs a message digest with a private key specified in the signing_info.
+
+ :param digest: A hashing object that contains the cryptographic digest of the HTTP request.
+ :return: A base-64 string representing the cryptographic signature of the input digest.
+ """
+ sig_alg = self.signing_algorithm
+ if isinstance(self.private_key, RSA.RsaKey):
+ if sig_alg is None or sig_alg == ALGORITHM_RSASSA_PSS:
+ # RSASSA-PSS in Section 8.1 of RFC8017.
+ signature = pss.new(self.private_key).sign(digest)
+ elif sig_alg == ALGORITHM_RSASSA_PKCS1v15:
+ # RSASSA-PKCS1-v1_5 in Section 8.2 of RFC8017.
+ signature = PKCS1_v1_5.new(self.private_key).sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ elif isinstance(self.private_key, ECC.EccKey):
+ if sig_alg is None:
+ sig_alg = ALGORITHM_ECDSA_MODE_FIPS_186_3
+ if sig_alg in ALGORITHM_ECDSA_KEY_SIGNING_ALGORITHMS:
+ # draft-ietf-httpbis-message-signatures-00 does not specify the ECDSA encoding.
+ # Issue: https://github.com/w3c-ccg/http-signatures/issues/107
+ signature = DSS.new(key=self.private_key, mode=sig_alg,
+ encoding='der').sign(digest)
+ else:
+ raise Exception("Unsupported signature algorithm: {0}".format(sig_alg))
+ else:
+ raise Exception("Unsupported private key: {0}".format(type(self.private_key)))
+ return b64encode(signature)
+
+ def _get_authorization_header(self, signed_headers, signed_msg):
+ """Calculates and returns the value of the 'Authorization' header when signing HTTP requests.
+
+ :param signed_headers : A list of tuples. Each value is the name of a HTTP header that
+ must be included in the HTTP signature calculation.
+ :param signed_msg: A base-64 encoded string representation of the signature.
+ :return: The string value of the 'Authorization' header, representing the signature
+ of the HTTP request.
+ """
+ created_ts = None
+ expires_ts = None
+ for k, v in signed_headers:
+ if k == HEADER_CREATED:
+ created_ts = v
+ elif k == HEADER_EXPIRES:
+ expires_ts = v
+ lower_keys = [k.lower() for k, v in signed_headers]
+ headers_value = " ".join(lower_keys)
+
+ auth_str = "Signature keyId=\"{0}\",algorithm=\"{1}\",".format(
+ self.key_id, self.signing_scheme)
+ if created_ts is not None:
+ auth_str = auth_str + "created={0},".format(created_ts)
+ if expires_ts is not None:
+ auth_str = auth_str + "expires={0},".format(expires_ts)
+ auth_str = auth_str + "headers=\"{0}\",signature=\"{1}\"".format(
+ headers_value, signed_msg.decode('ascii'))
+
+ return auth_str
diff --git a/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml b/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml
new file mode 100644
index 00000000000..a466656e8b6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/pyproject.toml
@@ -0,0 +1,98 @@
+[project]
+name = "petstore_api"
+version = "1.0.0"
+description = "OpenAPI Petstore"
+authors = [
+ {name = "OpenAPI Generator Community",email = "team@openapitools.org"},
+]
+license = { text = "Apache-2.0" }
+readme = "README.md"
+keywords = ["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"]
+requires-python = ">=3.9"
+
+dependencies = [
+ "urllib3 (>=2.1.0,<3.0.0)",
+ "python-dateutil (>=2.8.2)",
+ "pem (>=19.3.0)",
+ "pycryptodome (>=3.9.0)",
+ "pydantic (>=2)",
+ "typing-extensions (>=4.7.1)",
+ "lazy-imports (>=1,<2)"
+]
+
+[project.urls]
+Repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
+
+[tool.poetry]
+requires-poetry = ">=2.0"
+
+[tool.poetry.group.dev.dependencies]
+pytest = ">= 7.2.1"
+pytest-cov = ">= 2.8.1"
+tox = ">= 3.9.0"
+flake8 = ">= 4.0.0"
+types-python-dateutil = ">= 2.8.19.14"
+mypy = ">= 1.5"
+
+
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[tool.pylint.'MESSAGES CONTROL']
+extension-pkg-whitelist = "pydantic"
+
+[tool.mypy]
+files = [
+ "petstore_api",
+ #"test", # auto-generated tests
+ "tests", # hand-written tests
+]
+# TODO: enable "strict" once all these individual checks are passing
+# strict = true
+
+# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options
+warn_unused_configs = true
+warn_redundant_casts = true
+warn_unused_ignores = true
+
+## Getting these passing should be easy
+strict_equality = true
+extra_checks = true
+
+## Strongly recommend enabling this one as soon as you can
+check_untyped_defs = true
+
+## These shouldn't be too much additional work, but may be tricky to
+## get passing if you use a lot of untyped libraries
+disallow_subclassing_any = true
+disallow_untyped_decorators = true
+disallow_any_generics = true
+
+### These next few are various gradations of forcing use of type annotations
+#disallow_untyped_calls = true
+#disallow_incomplete_defs = true
+#disallow_untyped_defs = true
+#
+### This one isn't too hard to get passing, but return on investment is lower
+#no_implicit_reexport = true
+#
+### This one can be tricky to get passing if you use a lot of untyped libraries
+#warn_return_any = true
+
+[[tool.mypy.overrides]]
+module = [
+ "petstore_api.configuration",
+]
+warn_unused_ignores = true
+strict_equality = true
+extra_checks = true
+check_untyped_defs = true
+disallow_subclassing_any = true
+disallow_untyped_decorators = true
+disallow_any_generics = true
+disallow_untyped_calls = true
+disallow_incomplete_defs = true
+disallow_untyped_defs = true
+no_implicit_reexport = true
+warn_return_any = true
diff --git a/samples/openapi3/client/petstore/python-lazyImports/requirements.txt b/samples/openapi3/client/petstore/python-lazyImports/requirements.txt
new file mode 100644
index 00000000000..ca83fcc1d25
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/requirements.txt
@@ -0,0 +1,7 @@
+urllib3 >= 2.1.0, < 3.0.0
+python_dateutil >= 2.8.2
+pem >= 19.3.0
+pycryptodome >= 3.9.0
+pydantic >= 2
+typing-extensions >= 4.7.1
+lazy-imports >= 1, < 2
diff --git a/samples/openapi3/client/petstore/python-lazyImports/setup.cfg b/samples/openapi3/client/petstore/python-lazyImports/setup.cfg
new file mode 100644
index 00000000000..11433ee875a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/setup.cfg
@@ -0,0 +1,2 @@
+[flake8]
+max-line-length=99
diff --git a/samples/openapi3/client/petstore/python-lazyImports/setup.py b/samples/openapi3/client/petstore/python-lazyImports/setup.py
new file mode 100644
index 00000000000..5edb21a69e6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/setup.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from setuptools import setup, find_packages # noqa: H301
+
+# To install the library, run the following
+#
+# python setup.py install
+#
+# prerequisite: setuptools
+# http://pypi.python.org/pypi/setuptools
+NAME = "petstore-api"
+VERSION = "1.0.0"
+PYTHON_REQUIRES = ">= 3.9"
+REQUIRES = [
+ "urllib3 >= 2.1.0, < 3.0.0",
+ "python-dateutil >= 2.8.2",
+ "pem >= 19.3.0",
+ "pycryptodome >= 3.9.0",
+ "pydantic >= 2",
+ "typing-extensions >= 4.7.1",
+ "lazy-imports >= 1, < 2",
+]
+
+setup(
+ name=NAME,
+ version=VERSION,
+ description="OpenAPI Petstore",
+ author="OpenAPI Generator community",
+ author_email="team@openapitools.org",
+ url="",
+ keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore"],
+ install_requires=REQUIRES,
+ packages=find_packages(exclude=["test", "tests"]),
+ include_package_data=True,
+ license="Apache-2.0",
+ long_description_content_type='text/markdown',
+ long_description="""\
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ """, # noqa: E501
+ package_data={"petstore_api": ["py.typed"]},
+)
\ No newline at end of file
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test-requirements.txt b/samples/openapi3/client/petstore/python-lazyImports/test-requirements.txt
new file mode 100644
index 00000000000..e98555c11c8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test-requirements.txt
@@ -0,0 +1,6 @@
+pytest >= 7.2.1
+pytest-cov >= 2.8.1
+tox >= 3.9.0
+flake8 >= 4.0.0
+types-python-dateutil >= 2.8.19.14
+mypy >= 1.5
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/__init__.py b/samples/openapi3/client/petstore/python-lazyImports/test/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_any_type.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_any_type.py
new file mode 100644
index 00000000000..48603ddb403
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_any_type.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
+
+class TestAdditionalPropertiesAnyType(unittest.TestCase):
+ """AdditionalPropertiesAnyType unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AdditionalPropertiesAnyType:
+ """Test AdditionalPropertiesAnyType
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AdditionalPropertiesAnyType`
+ """
+ model = AdditionalPropertiesAnyType()
+ if include_optional:
+ return AdditionalPropertiesAnyType(
+ name = ''
+ )
+ else:
+ return AdditionalPropertiesAnyType(
+ )
+ """
+
+ def testAdditionalPropertiesAnyType(self):
+ """Test AdditionalPropertiesAnyType"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_class.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_class.py
new file mode 100644
index 00000000000..0261c8f4a00
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_class.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
+
+class TestAdditionalPropertiesClass(unittest.TestCase):
+ """AdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AdditionalPropertiesClass:
+ """Test AdditionalPropertiesClass
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AdditionalPropertiesClass`
+ """
+ model = AdditionalPropertiesClass()
+ if include_optional:
+ return AdditionalPropertiesClass(
+ map_property = {
+ 'key' : ''
+ },
+ map_of_map_property = {
+ 'key' : {
+ 'key' : ''
+ }
+ }
+ )
+ else:
+ return AdditionalPropertiesClass(
+ )
+ """
+
+ def testAdditionalPropertiesClass(self):
+ """Test AdditionalPropertiesClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_object.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_object.py
new file mode 100644
index 00000000000..8b0dccef564
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_object.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
+
+class TestAdditionalPropertiesObject(unittest.TestCase):
+ """AdditionalPropertiesObject unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AdditionalPropertiesObject:
+ """Test AdditionalPropertiesObject
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AdditionalPropertiesObject`
+ """
+ model = AdditionalPropertiesObject()
+ if include_optional:
+ return AdditionalPropertiesObject(
+ name = ''
+ )
+ else:
+ return AdditionalPropertiesObject(
+ )
+ """
+
+ def testAdditionalPropertiesObject(self):
+ """Test AdditionalPropertiesObject"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_with_description_only.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_with_description_only.py
new file mode 100644
index 00000000000..698f5f8d899
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_additional_properties_with_description_only.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
+
+class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
+ """AdditionalPropertiesWithDescriptionOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AdditionalPropertiesWithDescriptionOnly:
+ """Test AdditionalPropertiesWithDescriptionOnly
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
+ """
+ model = AdditionalPropertiesWithDescriptionOnly()
+ if include_optional:
+ return AdditionalPropertiesWithDescriptionOnly(
+ name = ''
+ )
+ else:
+ return AdditionalPropertiesWithDescriptionOnly(
+ )
+ """
+
+ def testAdditionalPropertiesWithDescriptionOnly(self):
+ """Test AdditionalPropertiesWithDescriptionOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_all_of_super_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_all_of_super_model.py
new file mode 100644
index 00000000000..0b37180a54c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_all_of_super_model.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.all_of_super_model import AllOfSuperModel
+
+class TestAllOfSuperModel(unittest.TestCase):
+ """AllOfSuperModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AllOfSuperModel:
+ """Test AllOfSuperModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AllOfSuperModel`
+ """
+ model = AllOfSuperModel()
+ if include_optional:
+ return AllOfSuperModel(
+ name = ''
+ )
+ else:
+ return AllOfSuperModel(
+ )
+ """
+
+ def testAllOfSuperModel(self):
+ """Test AllOfSuperModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_all_of_with_single_ref.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_all_of_with_single_ref.py
new file mode 100644
index 00000000000..ff147a1bc4e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_all_of_with_single_ref.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
+
+class TestAllOfWithSingleRef(unittest.TestCase):
+ """AllOfWithSingleRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AllOfWithSingleRef:
+ """Test AllOfWithSingleRef
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AllOfWithSingleRef`
+ """
+ model = AllOfWithSingleRef()
+ if include_optional:
+ return AllOfWithSingleRef(
+ username = '',
+ single_ref_type = 'admin'
+ )
+ else:
+ return AllOfWithSingleRef(
+ )
+ """
+
+ def testAllOfWithSingleRef(self):
+ """Test AllOfWithSingleRef"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_animal.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_animal.py
new file mode 100644
index 00000000000..4ea318679b6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_animal.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.animal import Animal
+
+class TestAnimal(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Animal:
+ """Test Animal
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Animal`
+ """
+ model = Animal()
+ if include_optional:
+ return Animal(
+ class_name = '',
+ color = 'red'
+ )
+ else:
+ return Animal(
+ class_name = '',
+ )
+ """
+
+ def testAnimal(self):
+ """Test Animal"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_another_fake_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_another_fake_api.py
new file mode 100644
index 00000000000..d1b73d979ff
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_another_fake_api.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.another_fake_api import AnotherFakeApi
+
+
+class TestAnotherFakeApi(unittest.TestCase):
+ """AnotherFakeApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = AnotherFakeApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_call_123_test_special_tags(self) -> None:
+ """Test case for call_123_test_special_tags
+
+ To test special tags
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_any_of_color.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_any_of_color.py
new file mode 100644
index 00000000000..f6092af623a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_any_of_color.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.any_of_color import AnyOfColor
+
+class TestAnyOfColor(unittest.TestCase):
+ """AnyOfColor unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AnyOfColor:
+ """Test AnyOfColor
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AnyOfColor`
+ """
+ model = AnyOfColor()
+ if include_optional:
+ return AnyOfColor(
+ )
+ else:
+ return AnyOfColor(
+ )
+ """
+
+ def testAnyOfColor(self):
+ """Test AnyOfColor"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_any_of_pig.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_any_of_pig.py
new file mode 100644
index 00000000000..e69d8f25900
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_any_of_pig.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.any_of_pig import AnyOfPig
+
+class TestAnyOfPig(unittest.TestCase):
+ """AnyOfPig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> AnyOfPig:
+ """Test AnyOfPig
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `AnyOfPig`
+ """
+ model = AnyOfPig()
+ if include_optional:
+ return AnyOfPig(
+ class_name = '',
+ color = '',
+ size = 56
+ )
+ else:
+ return AnyOfPig(
+ class_name = '',
+ color = '',
+ size = 56,
+ )
+ """
+
+ def testAnyOfPig(self):
+ """Test AnyOfPig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_array_of_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_array_of_model.py
new file mode 100644
index 00000000000..a96ea540171
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_array_of_model.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel
+
+class TestArrayOfArrayOfModel(unittest.TestCase):
+ """ArrayOfArrayOfModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ArrayOfArrayOfModel:
+ """Test ArrayOfArrayOfModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ArrayOfArrayOfModel`
+ """
+ model = ArrayOfArrayOfModel()
+ if include_optional:
+ return ArrayOfArrayOfModel(
+ another_property = [
+ [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ]
+ ]
+ )
+ else:
+ return ArrayOfArrayOfModel(
+ )
+ """
+
+ def testArrayOfArrayOfModel(self):
+ """Test ArrayOfArrayOfModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_array_of_number_only.py
new file mode 100644
index 00000000000..bd89ba2188d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_array_of_number_only.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
+
+class TestArrayOfArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ArrayOfArrayOfNumberOnly:
+ """Test ArrayOfArrayOfNumberOnly
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ArrayOfArrayOfNumberOnly`
+ """
+ model = ArrayOfArrayOfNumberOnly()
+ if include_optional:
+ return ArrayOfArrayOfNumberOnly(
+ array_array_number = [
+ [
+ 1.337
+ ]
+ ]
+ )
+ else:
+ return ArrayOfArrayOfNumberOnly(
+ )
+ """
+
+ def testArrayOfArrayOfNumberOnly(self):
+ """Test ArrayOfArrayOfNumberOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_number_only.py
new file mode 100644
index 00000000000..f67af039fce
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_of_number_only.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
+
+class TestArrayOfNumberOnly(unittest.TestCase):
+ """ArrayOfNumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ArrayOfNumberOnly:
+ """Test ArrayOfNumberOnly
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ArrayOfNumberOnly`
+ """
+ model = ArrayOfNumberOnly()
+ if include_optional:
+ return ArrayOfNumberOnly(
+ array_number = [
+ 1.337
+ ]
+ )
+ else:
+ return ArrayOfNumberOnly(
+ )
+ """
+
+ def testArrayOfNumberOnly(self):
+ """Test ArrayOfNumberOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_array_test.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_test.py
new file mode 100644
index 00000000000..21ce90c4c2c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_array_test.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.array_test import ArrayTest
+
+class TestArrayTest(unittest.TestCase):
+ """ArrayTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ArrayTest:
+ """Test ArrayTest
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ArrayTest`
+ """
+ model = ArrayTest()
+ if include_optional:
+ return ArrayTest(
+ array_of_string = [
+ ''
+ ],
+ array_of_nullable_float = [
+ 1.337
+ ],
+ array_array_of_integer = [
+ [
+ 56
+ ]
+ ],
+ array_array_of_model = [
+ [
+ petstore_api.models.read_only_first.ReadOnlyFirst(
+ bar = '',
+ baz = '', )
+ ]
+ ]
+ )
+ else:
+ return ArrayTest(
+ )
+ """
+
+ def testArrayTest(self):
+ """Test ArrayTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_base_discriminator.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_base_discriminator.py
new file mode 100644
index 00000000000..05ed4b3d4da
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_base_discriminator.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.base_discriminator import BaseDiscriminator
+
+class TestBaseDiscriminator(unittest.TestCase):
+ """BaseDiscriminator unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> BaseDiscriminator:
+ """Test BaseDiscriminator
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `BaseDiscriminator`
+ """
+ model = BaseDiscriminator()
+ if include_optional:
+ return BaseDiscriminator(
+ type_name = ''
+ )
+ else:
+ return BaseDiscriminator(
+ )
+ """
+
+ def testBaseDiscriminator(self):
+ """Test BaseDiscriminator"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_basque_pig.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_basque_pig.py
new file mode 100644
index 00000000000..f79d16cd858
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_basque_pig.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.basque_pig import BasquePig
+
+class TestBasquePig(unittest.TestCase):
+ """BasquePig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> BasquePig:
+ """Test BasquePig
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `BasquePig`
+ """
+ model = BasquePig()
+ if include_optional:
+ return BasquePig(
+ class_name = '',
+ color = ''
+ )
+ else:
+ return BasquePig(
+ class_name = '',
+ color = '',
+ )
+ """
+
+ def testBasquePig(self):
+ """Test BasquePig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_bathing.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_bathing.py
new file mode 100644
index 00000000000..f2b6a75a95a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_bathing.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.bathing import Bathing
+
+class TestBathing(unittest.TestCase):
+ """Bathing unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Bathing:
+ """Test Bathing
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Bathing`
+ """
+ model = Bathing()
+ if include_optional:
+ return Bathing(
+ task_name = 'cleaning_deep',
+ function_name = 'care_nourish',
+ content = ''
+ )
+ else:
+ return Bathing(
+ task_name = 'cleaning_deep',
+ function_name = 'care_nourish',
+ content = '',
+ )
+ """
+
+ def testBathing(self):
+ """Test Bathing"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_capitalization.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_capitalization.py
new file mode 100644
index 00000000000..6e8f95b7acf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_capitalization.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.capitalization import Capitalization
+
+class TestCapitalization(unittest.TestCase):
+ """Capitalization unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Capitalization:
+ """Test Capitalization
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Capitalization`
+ """
+ model = Capitalization()
+ if include_optional:
+ return Capitalization(
+ small_camel = '',
+ capital_camel = '',
+ small_snake = '',
+ capital_snake = '',
+ sca_eth_flow_points = '',
+ att_name = ''
+ )
+ else:
+ return Capitalization(
+ )
+ """
+
+ def testCapitalization(self):
+ """Test Capitalization"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_cat.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_cat.py
new file mode 100644
index 00000000000..15034d82ed3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_cat.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.cat import Cat
+
+class TestCat(unittest.TestCase):
+ """Cat unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Cat:
+ """Test Cat
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Cat`
+ """
+ model = Cat()
+ if include_optional:
+ return Cat(
+ declawed = True
+ )
+ else:
+ return Cat(
+ )
+ """
+
+ def testCat(self):
+ """Test Cat"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_category.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_category.py
new file mode 100644
index 00000000000..014917bf17f
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_category.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.category import Category
+
+class TestCategory(unittest.TestCase):
+ """Category unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Category:
+ """Test Category
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Category`
+ """
+ model = Category()
+ if include_optional:
+ return Category(
+ id = 56,
+ name = 'default-name'
+ )
+ else:
+ return Category(
+ name = 'default-name',
+ )
+ """
+
+ def testCategory(self):
+ """Test Category"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_circular_all_of_ref.py
new file mode 100644
index 00000000000..9d81ff91b15
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_circular_all_of_ref.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.circular_all_of_ref import CircularAllOfRef
+
+class TestCircularAllOfRef(unittest.TestCase):
+ """CircularAllOfRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> CircularAllOfRef:
+ """Test CircularAllOfRef
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CircularAllOfRef`
+ """
+ model = CircularAllOfRef()
+ if include_optional:
+ return CircularAllOfRef(
+ name = '',
+ second_circular_all_of_ref = [
+ petstore_api.models.second_circular_all_of_ref.SecondCircularAllOfRef()
+ ]
+ )
+ else:
+ return CircularAllOfRef(
+ )
+ """
+
+ def testCircularAllOfRef(self):
+ """Test CircularAllOfRef"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_circular_reference_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_circular_reference_model.py
new file mode 100644
index 00000000000..18148b2b7d1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_circular_reference_model.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.circular_reference_model import CircularReferenceModel
+
+class TestCircularReferenceModel(unittest.TestCase):
+ """CircularReferenceModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> CircularReferenceModel:
+ """Test CircularReferenceModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CircularReferenceModel`
+ """
+ model = CircularReferenceModel()
+ if include_optional:
+ return CircularReferenceModel(
+ size = 56,
+ nested = petstore_api.models.first_ref.FirstRef(
+ category = '',
+ self_ref = petstore_api.models.second_ref.SecondRef(
+ category = '',
+ circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.first_ref.FirstRef(
+ category = '', ), ), ), )
+ )
+ else:
+ return CircularReferenceModel(
+ )
+ """
+
+ def testCircularReferenceModel(self):
+ """Test CircularReferenceModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_class_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_class_model.py
new file mode 100644
index 00000000000..1826cbf5398
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_class_model.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.class_model import ClassModel
+
+class TestClassModel(unittest.TestCase):
+ """ClassModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ClassModel:
+ """Test ClassModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ClassModel`
+ """
+ model = ClassModel()
+ if include_optional:
+ return ClassModel(
+ var_class = ''
+ )
+ else:
+ return ClassModel(
+ )
+ """
+
+ def testClassModel(self):
+ """Test ClassModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_client.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_client.py
new file mode 100644
index 00000000000..1586543c171
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_client.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.client import Client
+
+class TestClient(unittest.TestCase):
+ """Client unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Client:
+ """Test Client
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Client`
+ """
+ model = Client()
+ if include_optional:
+ return Client(
+ client = ''
+ )
+ else:
+ return Client(
+ )
+ """
+
+ def testClient(self):
+ """Test Client"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_color.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_color.py
new file mode 100644
index 00000000000..2ebb0ec04de
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_color.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.color import Color
+
+class TestColor(unittest.TestCase):
+ """Color unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Color:
+ """Test Color
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Color`
+ """
+ model = Color()
+ if include_optional:
+ return Color(
+ )
+ else:
+ return Color(
+ )
+ """
+
+ def testColor(self):
+ """Test Color"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_creature.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_creature.py
new file mode 100644
index 00000000000..eab8f68f3a5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_creature.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.creature import Creature
+
+class TestCreature(unittest.TestCase):
+ """Creature unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Creature:
+ """Test Creature
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Creature`
+ """
+ model = Creature()
+ if include_optional:
+ return Creature(
+ info = petstore_api.models.creature_info.CreatureInfo(
+ name = '', ),
+ type = ''
+ )
+ else:
+ return Creature(
+ info = petstore_api.models.creature_info.CreatureInfo(
+ name = '', ),
+ type = '',
+ )
+ """
+
+ def testCreature(self):
+ """Test Creature"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_creature_info.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_creature_info.py
new file mode 100644
index 00000000000..d645563a479
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_creature_info.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.creature_info import CreatureInfo
+
+class TestCreatureInfo(unittest.TestCase):
+ """CreatureInfo unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> CreatureInfo:
+ """Test CreatureInfo
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `CreatureInfo`
+ """
+ model = CreatureInfo()
+ if include_optional:
+ return CreatureInfo(
+ name = ''
+ )
+ else:
+ return CreatureInfo(
+ name = '',
+ )
+ """
+
+ def testCreatureInfo(self):
+ """Test CreatureInfo"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_danish_pig.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_danish_pig.py
new file mode 100644
index 00000000000..1dc992542c4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_danish_pig.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.danish_pig import DanishPig
+
+class TestDanishPig(unittest.TestCase):
+ """DanishPig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DanishPig:
+ """Test DanishPig
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DanishPig`
+ """
+ model = DanishPig()
+ if include_optional:
+ return DanishPig(
+ class_name = '',
+ size = 56
+ )
+ else:
+ return DanishPig(
+ class_name = '',
+ size = 56,
+ )
+ """
+
+ def testDanishPig(self):
+ """Test DanishPig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_data_output_format.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_data_output_format.py
new file mode 100644
index 00000000000..99ff7317920
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_data_output_format.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.data_output_format import DataOutputFormat
+
+class TestDataOutputFormat(unittest.TestCase):
+ """DataOutputFormat unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testDataOutputFormat(self):
+ """Test DataOutputFormat"""
+ # inst = DataOutputFormat()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_default_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_default_api.py
new file mode 100644
index 00000000000..eb421a8edc1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_default_api.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.default_api import DefaultApi
+
+
+class TestDefaultApi(unittest.TestCase):
+ """DefaultApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = DefaultApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_foo_get(self) -> None:
+ """Test case for foo_get
+
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_deprecated_object.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_deprecated_object.py
new file mode 100644
index 00000000000..e63842997ae
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_deprecated_object.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.deprecated_object import DeprecatedObject
+
+class TestDeprecatedObject(unittest.TestCase):
+ """DeprecatedObject unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DeprecatedObject:
+ """Test DeprecatedObject
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DeprecatedObject`
+ """
+ model = DeprecatedObject()
+ if include_optional:
+ return DeprecatedObject(
+ name = ''
+ )
+ else:
+ return DeprecatedObject(
+ )
+ """
+
+ def testDeprecatedObject(self):
+ """Test DeprecatedObject"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_discriminator_all_of_sub.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_discriminator_all_of_sub.py
new file mode 100644
index 00000000000..f52f3d33f13
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_discriminator_all_of_sub.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
+
+class TestDiscriminatorAllOfSub(unittest.TestCase):
+ """DiscriminatorAllOfSub unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DiscriminatorAllOfSub:
+ """Test DiscriminatorAllOfSub
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DiscriminatorAllOfSub`
+ """
+ model = DiscriminatorAllOfSub()
+ if include_optional:
+ return DiscriminatorAllOfSub(
+ )
+ else:
+ return DiscriminatorAllOfSub(
+ )
+ """
+
+ def testDiscriminatorAllOfSub(self):
+ """Test DiscriminatorAllOfSub"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_discriminator_all_of_super.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_discriminator_all_of_super.py
new file mode 100644
index 00000000000..830fa0a829a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_discriminator_all_of_super.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
+
+class TestDiscriminatorAllOfSuper(unittest.TestCase):
+ """DiscriminatorAllOfSuper unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DiscriminatorAllOfSuper:
+ """Test DiscriminatorAllOfSuper
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DiscriminatorAllOfSuper`
+ """
+ model = DiscriminatorAllOfSuper()
+ if include_optional:
+ return DiscriminatorAllOfSuper(
+ element_type = ''
+ )
+ else:
+ return DiscriminatorAllOfSuper(
+ element_type = '',
+ )
+ """
+
+ def testDiscriminatorAllOfSuper(self):
+ """Test DiscriminatorAllOfSuper"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_dog.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_dog.py
new file mode 100644
index 00000000000..c11f61c99c0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_dog.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.dog import Dog
+
+class TestDog(unittest.TestCase):
+ """Dog unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Dog:
+ """Test Dog
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Dog`
+ """
+ model = Dog()
+ if include_optional:
+ return Dog(
+ breed = ''
+ )
+ else:
+ return Dog(
+ )
+ """
+
+ def testDog(self):
+ """Test Dog"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_dummy_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_dummy_model.py
new file mode 100644
index 00000000000..8b276ec140b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_dummy_model.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.dummy_model import DummyModel
+
+class TestDummyModel(unittest.TestCase):
+ """DummyModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DummyModel:
+ """Test DummyModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `DummyModel`
+ """
+ model = DummyModel()
+ if include_optional:
+ return DummyModel(
+ category = '',
+ self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '', ), )
+ )
+ else:
+ return DummyModel(
+ )
+ """
+
+ def testDummyModel(self):
+ """Test DummyModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_arrays.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_arrays.py
new file mode 100644
index 00000000000..f3d731b3f59
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_arrays.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_arrays import EnumArrays
+
+class TestEnumArrays(unittest.TestCase):
+ """EnumArrays unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> EnumArrays:
+ """Test EnumArrays
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `EnumArrays`
+ """
+ model = EnumArrays()
+ if include_optional:
+ return EnumArrays(
+ just_symbol = '>=',
+ array_enum = [
+ 'fish'
+ ]
+ )
+ else:
+ return EnumArrays(
+ )
+ """
+
+ def testEnumArrays(self):
+ """Test EnumArrays"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_class.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_class.py
new file mode 100644
index 00000000000..5730ded0ad3
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_class.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_class import EnumClass
+
+class TestEnumClass(unittest.TestCase):
+ """EnumClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumClass(self):
+ """Test EnumClass"""
+ # inst = EnumClass()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_number_vendor_ext.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_number_vendor_ext.py
new file mode 100644
index 00000000000..62ff78318c7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_number_vendor_ext.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt
+
+class TestEnumNumberVendorExt(unittest.TestCase):
+ """EnumNumberVendorExt unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumNumberVendorExt(self):
+ """Test EnumNumberVendorExt"""
+ # inst = EnumNumberVendorExt()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_ref_with_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_ref_with_default_value.py
new file mode 100644
index 00000000000..839d9583998
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_ref_with_default_value.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue
+
+class TestEnumRefWithDefaultValue(unittest.TestCase):
+ """EnumRefWithDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> EnumRefWithDefaultValue:
+ """Test EnumRefWithDefaultValue
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `EnumRefWithDefaultValue`
+ """
+ model = EnumRefWithDefaultValue()
+ if include_optional:
+ return EnumRefWithDefaultValue(
+ report_format = 'JSON'
+ )
+ else:
+ return EnumRefWithDefaultValue(
+ )
+ """
+
+ def testEnumRefWithDefaultValue(self):
+ """Test EnumRefWithDefaultValue"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string1.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string1.py
new file mode 100644
index 00000000000..e6a85884120
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string1.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_string1 import EnumString1
+
+class TestEnumString1(unittest.TestCase):
+ """EnumString1 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumString1(self):
+ """Test EnumString1"""
+ # inst = EnumString1()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string2.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string2.py
new file mode 100644
index 00000000000..6a52c081d3c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string2.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_string2 import EnumString2
+
+class TestEnumString2(unittest.TestCase):
+ """EnumString2 unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumString2(self):
+ """Test EnumString2"""
+ # inst = EnumString2()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string_vendor_ext.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string_vendor_ext.py
new file mode 100644
index 00000000000..e82d7957d34
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_string_vendor_ext.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt
+
+class TestEnumStringVendorExt(unittest.TestCase):
+ """EnumStringVendorExt unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testEnumStringVendorExt(self):
+ """Test EnumStringVendorExt"""
+ # inst = EnumStringVendorExt()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_test.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_test.py
new file mode 100644
index 00000000000..d84613bc946
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_enum_test.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.enum_test import EnumTest
+
+class TestEnumTest(unittest.TestCase):
+ """EnumTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> EnumTest:
+ """Test EnumTest
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `EnumTest`
+ """
+ model = EnumTest()
+ if include_optional:
+ return EnumTest(
+ enum_string = 'UPPER',
+ enum_string_required = 'UPPER',
+ enum_integer_default = 1,
+ enum_integer = 1,
+ enum_number = 1.1,
+ enum_string_single_member = 'abc',
+ enum_integer_single_member = 100,
+ outer_enum = 'placed',
+ outer_enum_integer = 2,
+ outer_enum_default_value = 'placed',
+ outer_enum_integer_default_value = -1,
+ enum_number_vendor_ext = 42,
+ enum_string_vendor_ext = 'FOO'
+ )
+ else:
+ return EnumTest(
+ enum_string_required = 'UPPER',
+ )
+ """
+
+ def testEnumTest(self):
+ """Test EnumTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_fake_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_fake_api.py
new file mode 100644
index 00000000000..11920b00480
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_fake_api.py
@@ -0,0 +1,279 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.fake_api import FakeApi
+
+
+class TestFakeApi(unittest.TestCase):
+ """FakeApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = FakeApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_fake_any_type_request_body(self) -> None:
+ """Test case for fake_any_type_request_body
+
+ test any type request body
+ """
+ pass
+
+ def test_fake_enum_ref_query_parameter(self) -> None:
+ """Test case for fake_enum_ref_query_parameter
+
+ test enum reference query parameter
+ """
+ pass
+
+ def test_fake_health_get(self) -> None:
+ """Test case for fake_health_get
+
+ Health check endpoint
+ """
+ pass
+
+ def test_fake_http_signature_test(self) -> None:
+ """Test case for fake_http_signature_test
+
+ test http signature authentication
+ """
+ pass
+
+ def test_fake_outer_boolean_serialize(self) -> None:
+ """Test case for fake_outer_boolean_serialize
+
+ """
+ pass
+
+ def test_fake_outer_composite_serialize(self) -> None:
+ """Test case for fake_outer_composite_serialize
+
+ """
+ pass
+
+ def test_fake_outer_number_serialize(self) -> None:
+ """Test case for fake_outer_number_serialize
+
+ """
+ pass
+
+ def test_fake_outer_string_serialize(self) -> None:
+ """Test case for fake_outer_string_serialize
+
+ """
+ pass
+
+ def test_fake_property_enum_integer_serialize(self) -> None:
+ """Test case for fake_property_enum_integer_serialize
+
+ """
+ pass
+
+ def test_fake_ref_enum_string(self) -> None:
+ """Test case for fake_ref_enum_string
+
+ test ref to enum string
+ """
+ pass
+
+ def test_fake_return_boolean(self) -> None:
+ """Test case for fake_return_boolean
+
+ test returning boolean
+ """
+ pass
+
+ def test_fake_return_byte_like_json(self) -> None:
+ """Test case for fake_return_byte_like_json
+
+ test byte like json
+ """
+ pass
+
+ def test_fake_return_enum(self) -> None:
+ """Test case for fake_return_enum
+
+ test returning enum
+ """
+ pass
+
+ def test_fake_return_enum_like_json(self) -> None:
+ """Test case for fake_return_enum_like_json
+
+ test enum like json
+ """
+ pass
+
+ def test_fake_return_float(self) -> None:
+ """Test case for fake_return_float
+
+ test returning float
+ """
+ pass
+
+ def test_fake_return_int(self) -> None:
+ """Test case for fake_return_int
+
+ test returning int
+ """
+ pass
+
+ def test_fake_return_list_of_objects(self) -> None:
+ """Test case for fake_return_list_of_objects
+
+ test returning list of objects
+ """
+ pass
+
+ def test_fake_return_str_like_json(self) -> None:
+ """Test case for fake_return_str_like_json
+
+ test str like json
+ """
+ pass
+
+ def test_fake_return_string(self) -> None:
+ """Test case for fake_return_string
+
+ test returning string
+ """
+ pass
+
+ def test_fake_uuid_example(self) -> None:
+ """Test case for fake_uuid_example
+
+ test uuid example
+ """
+ pass
+
+ def test_test_additional_properties_reference(self) -> None:
+ """Test case for test_additional_properties_reference
+
+ test referenced additionalProperties
+ """
+ pass
+
+ def test_test_body_with_binary(self) -> None:
+ """Test case for test_body_with_binary
+
+ """
+ pass
+
+ def test_test_body_with_file_schema(self) -> None:
+ """Test case for test_body_with_file_schema
+
+ """
+ pass
+
+ def test_test_body_with_query_params(self) -> None:
+ """Test case for test_body_with_query_params
+
+ """
+ pass
+
+ def test_test_client_model(self) -> None:
+ """Test case for test_client_model
+
+ To test \"client\" model
+ """
+ pass
+
+ def test_test_date_time_query_parameter(self) -> None:
+ """Test case for test_date_time_query_parameter
+
+ """
+ pass
+
+ def test_test_empty_and_non_empty_responses(self) -> None:
+ """Test case for test_empty_and_non_empty_responses
+
+ test empty and non-empty responses
+ """
+ pass
+
+ def test_test_endpoint_parameters(self) -> None:
+ """Test case for test_endpoint_parameters
+
+ Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+ """
+ pass
+
+ def test_test_error_responses_with_model(self) -> None:
+ """Test case for test_error_responses_with_model
+
+ test error responses with model
+ """
+ pass
+
+ def test_test_group_parameters(self) -> None:
+ """Test case for test_group_parameters
+
+ Fake endpoint to test group parameters (optional)
+ """
+ pass
+
+ def test_test_inline_additional_properties(self) -> None:
+ """Test case for test_inline_additional_properties
+
+ test inline additionalProperties
+ """
+ pass
+
+ def test_test_inline_freeform_additional_properties(self) -> None:
+ """Test case for test_inline_freeform_additional_properties
+
+ test inline free-form additionalProperties
+ """
+ pass
+
+ def test_test_json_form_data(self) -> None:
+ """Test case for test_json_form_data
+
+ test json serialization of form data
+ """
+ pass
+
+ def test_test_object_for_multipart_requests(self) -> None:
+ """Test case for test_object_for_multipart_requests
+
+ """
+ pass
+
+ def test_test_query_parameter_collection_format(self) -> None:
+ """Test case for test_query_parameter_collection_format
+
+ """
+ pass
+
+ def test_test_string_map_reference(self) -> None:
+ """Test case for test_string_map_reference
+
+ test referenced string map
+ """
+ pass
+
+ def test_upload_file_with_additional_properties(self) -> None:
+ """Test case for upload_file_with_additional_properties
+
+ uploads a file and additional properties using multipart/form-data
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_fake_classname_tags123_api.py
new file mode 100644
index 00000000000..9282bf7150c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_fake_classname_tags123_api.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
+
+
+class TestFakeClassnameTags123Api(unittest.TestCase):
+ """FakeClassnameTags123Api unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = FakeClassnameTags123Api()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_test_classname(self) -> None:
+ """Test case for test_classname
+
+ To test class name in snake case
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_feeding.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_feeding.py
new file mode 100644
index 00000000000..fc9d904716e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_feeding.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.feeding import Feeding
+
+class TestFeeding(unittest.TestCase):
+ """Feeding unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Feeding:
+ """Test Feeding
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Feeding`
+ """
+ model = Feeding()
+ if include_optional:
+ return Feeding(
+ task_name = 'cleaning',
+ function_name = 'care_nourish',
+ content = ''
+ )
+ else:
+ return Feeding(
+ task_name = 'cleaning',
+ function_name = 'care_nourish',
+ content = '',
+ )
+ """
+
+ def testFeeding(self):
+ """Test Feeding"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_file.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_file.py
new file mode 100644
index 00000000000..d050f598246
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_file.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.file import File
+
+class TestFile(unittest.TestCase):
+ """File unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> File:
+ """Test File
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `File`
+ """
+ model = File()
+ if include_optional:
+ return File(
+ source_uri = ''
+ )
+ else:
+ return File(
+ )
+ """
+
+ def testFile(self):
+ """Test File"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_file_schema_test_class.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_file_schema_test_class.py
new file mode 100644
index 00000000000..ebbf1f58705
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_file_schema_test_class.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.file_schema_test_class import FileSchemaTestClass
+
+class TestFileSchemaTestClass(unittest.TestCase):
+ """FileSchemaTestClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> FileSchemaTestClass:
+ """Test FileSchemaTestClass
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `FileSchemaTestClass`
+ """
+ model = FileSchemaTestClass()
+ if include_optional:
+ return FileSchemaTestClass(
+ file = petstore_api.models.file.File(
+ source_uri = '', ),
+ files = [
+ petstore_api.models.file.File(
+ source_uri = '', )
+ ]
+ )
+ else:
+ return FileSchemaTestClass(
+ )
+ """
+
+ def testFileSchemaTestClass(self):
+ """Test FileSchemaTestClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_first_ref.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_first_ref.py
new file mode 100644
index 00000000000..38520ad2e63
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_first_ref.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.first_ref import FirstRef
+
+class TestFirstRef(unittest.TestCase):
+ """FirstRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> FirstRef:
+ """Test FirstRef
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `FirstRef`
+ """
+ model = FirstRef()
+ if include_optional:
+ return FirstRef(
+ category = '',
+ self_ref = petstore_api.models.second_ref.SecondRef(
+ category = '',
+ circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.first_ref.FirstRef(
+ category = '', ), ), )
+ )
+ else:
+ return FirstRef(
+ )
+ """
+
+ def testFirstRef(self):
+ """Test FirstRef"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_foo.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_foo.py
new file mode 100644
index 00000000000..430ee19bf69
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_foo.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.foo import Foo
+
+class TestFoo(unittest.TestCase):
+ """Foo unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Foo:
+ """Test Foo
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Foo`
+ """
+ model = Foo()
+ if include_optional:
+ return Foo(
+ bar = 'bar'
+ )
+ else:
+ return Foo(
+ )
+ """
+
+ def testFoo(self):
+ """Test Foo"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_foo_get_default_response.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_foo_get_default_response.py
new file mode 100644
index 00000000000..c5524b88d2b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_foo_get_default_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
+
+class TestFooGetDefaultResponse(unittest.TestCase):
+ """FooGetDefaultResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> FooGetDefaultResponse:
+ """Test FooGetDefaultResponse
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `FooGetDefaultResponse`
+ """
+ model = FooGetDefaultResponse()
+ if include_optional:
+ return FooGetDefaultResponse(
+ string = petstore_api.models.foo.Foo(
+ bar = 'bar', )
+ )
+ else:
+ return FooGetDefaultResponse(
+ )
+ """
+
+ def testFooGetDefaultResponse(self):
+ """Test FooGetDefaultResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_format_test.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_format_test.py
new file mode 100644
index 00000000000..8cde3f67815
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_format_test.py
@@ -0,0 +1,70 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.format_test import FormatTest
+
+class TestFormatTest(unittest.TestCase):
+ """FormatTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> FormatTest:
+ """Test FormatTest
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `FormatTest`
+ """
+ model = FormatTest()
+ if include_optional:
+ return FormatTest(
+ integer = 10,
+ int32 = 20,
+ int64 = 56,
+ number = 32.1,
+ var_float = 54.3,
+ double = 67.8,
+ decimal = 1,
+ string = 'a',
+ string_with_double_quote_pattern = 'this is \"something\"',
+ byte = 'YQ==',
+ binary = bytes(b'blah'),
+ var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84',
+ password = '0123456789',
+ pattern_with_digits = '0480728880',
+ pattern_with_digits_and_delimiter = 'image_480'
+ )
+ else:
+ return FormatTest(
+ number = 32.1,
+ var_date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ password = '0123456789',
+ )
+ """
+
+ def testFormatTest(self):
+ """Test FormatTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_has_only_read_only.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_has_only_read_only.py
new file mode 100644
index 00000000000..59013015dc7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_has_only_read_only.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.has_only_read_only import HasOnlyReadOnly
+
+class TestHasOnlyReadOnly(unittest.TestCase):
+ """HasOnlyReadOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> HasOnlyReadOnly:
+ """Test HasOnlyReadOnly
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `HasOnlyReadOnly`
+ """
+ model = HasOnlyReadOnly()
+ if include_optional:
+ return HasOnlyReadOnly(
+ bar = '',
+ foo = ''
+ )
+ else:
+ return HasOnlyReadOnly(
+ )
+ """
+
+ def testHasOnlyReadOnly(self):
+ """Test HasOnlyReadOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_health_check_result.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_health_check_result.py
new file mode 100644
index 00000000000..a50444e6d87
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_health_check_result.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.health_check_result import HealthCheckResult
+
+class TestHealthCheckResult(unittest.TestCase):
+ """HealthCheckResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> HealthCheckResult:
+ """Test HealthCheckResult
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `HealthCheckResult`
+ """
+ model = HealthCheckResult()
+ if include_optional:
+ return HealthCheckResult(
+ nullable_message = ''
+ )
+ else:
+ return HealthCheckResult(
+ )
+ """
+
+ def testHealthCheckResult(self):
+ """Test HealthCheckResult"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_hunting_dog.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_hunting_dog.py
new file mode 100644
index 00000000000..8d9c106a872
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_hunting_dog.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.hunting_dog import HuntingDog
+
+class TestHuntingDog(unittest.TestCase):
+ """HuntingDog unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> HuntingDog:
+ """Test HuntingDog
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `HuntingDog`
+ """
+ model = HuntingDog()
+ if include_optional:
+ return HuntingDog(
+ is_trained = True
+ )
+ else:
+ return HuntingDog(
+ )
+ """
+
+ def testHuntingDog(self):
+ """Test HuntingDog"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_import_test_datetime_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_import_test_datetime_api.py
new file mode 100644
index 00000000000..6cd4fb8cbaf
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_import_test_datetime_api.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi
+
+
+class TestImportTestDatetimeApi(unittest.TestCase):
+ """ImportTestDatetimeApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = ImportTestDatetimeApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_import_test_return_datetime(self) -> None:
+ """Test case for import_test_return_datetime
+
+ test date time
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_info.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_info.py
new file mode 100644
index 00000000000..47075061d9a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_info.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.info import Info
+
+class TestInfo(unittest.TestCase):
+ """Info unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Info:
+ """Test Info
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Info`
+ """
+ model = Info()
+ if include_optional:
+ return Info(
+ val = petstore_api.models.base_discriminator.BaseDiscriminator()
+ )
+ else:
+ return Info(
+ )
+ """
+
+ def testInfo(self):
+ """Test Info"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_inner_dict_with_property.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_inner_dict_with_property.py
new file mode 100644
index 00000000000..1f80e90e29d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_inner_dict_with_property.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
+
+class TestInnerDictWithProperty(unittest.TestCase):
+ """InnerDictWithProperty unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> InnerDictWithProperty:
+ """Test InnerDictWithProperty
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `InnerDictWithProperty`
+ """
+ model = InnerDictWithProperty()
+ if include_optional:
+ return InnerDictWithProperty(
+ a_property = None
+ )
+ else:
+ return InnerDictWithProperty(
+ )
+ """
+
+ def testInnerDictWithProperty(self):
+ """Test InnerDictWithProperty"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_input_all_of.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_input_all_of.py
new file mode 100644
index 00000000000..212f59bea79
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_input_all_of.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.input_all_of import InputAllOf
+
+class TestInputAllOf(unittest.TestCase):
+ """InputAllOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> InputAllOf:
+ """Test InputAllOf
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `InputAllOf`
+ """
+ model = InputAllOf()
+ if include_optional:
+ return InputAllOf(
+ some_data = {
+ 'key' : petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ }
+ )
+ else:
+ return InputAllOf(
+ )
+ """
+
+ def testInputAllOf(self):
+ """Test InputAllOf"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_int_or_string.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_int_or_string.py
new file mode 100644
index 00000000000..a649aac2469
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_int_or_string.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.int_or_string import IntOrString
+
+class TestIntOrString(unittest.TestCase):
+ """IntOrString unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> IntOrString:
+ """Test IntOrString
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `IntOrString`
+ """
+ model = IntOrString()
+ if include_optional:
+ return IntOrString(
+ )
+ else:
+ return IntOrString(
+ )
+ """
+
+ def testIntOrString(self):
+ """Test IntOrString"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_list_class.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_list_class.py
new file mode 100644
index 00000000000..7da7d021f77
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_list_class.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.list_class import ListClass
+
+class TestListClass(unittest.TestCase):
+ """ListClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ListClass:
+ """Test ListClass
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ListClass`
+ """
+ model = ListClass()
+ if include_optional:
+ return ListClass(
+ var_123_list = ''
+ )
+ else:
+ return ListClass(
+ )
+ """
+
+ def testListClass(self):
+ """Test ListClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_map_of_array_of_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_map_of_array_of_model.py
new file mode 100644
index 00000000000..2d5637f8f34
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_map_of_array_of_model.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel
+
+class TestMapOfArrayOfModel(unittest.TestCase):
+ """MapOfArrayOfModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> MapOfArrayOfModel:
+ """Test MapOfArrayOfModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MapOfArrayOfModel`
+ """
+ model = MapOfArrayOfModel()
+ if include_optional:
+ return MapOfArrayOfModel(
+ shop_id_to_org_online_lip_map = {
+ 'key' : [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ]
+ }
+ )
+ else:
+ return MapOfArrayOfModel(
+ )
+ """
+
+ def testMapOfArrayOfModel(self):
+ """Test MapOfArrayOfModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_map_test.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_map_test.py
new file mode 100644
index 00000000000..6d15e3d0b34
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_map_test.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.map_test import MapTest
+
+class TestMapTest(unittest.TestCase):
+ """MapTest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> MapTest:
+ """Test MapTest
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MapTest`
+ """
+ model = MapTest()
+ if include_optional:
+ return MapTest(
+ map_map_of_string = {
+ 'key' : {
+ 'key' : ''
+ }
+ },
+ map_of_enum_string = {
+ 'UPPER' : 'UPPER'
+ },
+ direct_map = {
+ 'key' : True
+ },
+ indirect_map = {
+ 'key' : True
+ }
+ )
+ else:
+ return MapTest(
+ )
+ """
+
+ def testMapTest(self):
+ """Test MapTest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_mixed_properties_and_additional_properties_class.py
new file mode 100644
index 00000000000..33d884c768b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_mixed_properties_and_additional_properties_class.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
+
+class TestMixedPropertiesAndAdditionalPropertiesClass(unittest.TestCase):
+ """MixedPropertiesAndAdditionalPropertiesClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> MixedPropertiesAndAdditionalPropertiesClass:
+ """Test MixedPropertiesAndAdditionalPropertiesClass
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MixedPropertiesAndAdditionalPropertiesClass`
+ """
+ model = MixedPropertiesAndAdditionalPropertiesClass()
+ if include_optional:
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ uuid = '',
+ date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ map = {
+ 'key' : petstore_api.models.animal.Animal(
+ class_name = '',
+ color = 'red', )
+ }
+ )
+ else:
+ return MixedPropertiesAndAdditionalPropertiesClass(
+ )
+ """
+
+ def testMixedPropertiesAndAdditionalPropertiesClass(self):
+ """Test MixedPropertiesAndAdditionalPropertiesClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_model200_response.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_model200_response.py
new file mode 100644
index 00000000000..007f8a62395
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_model200_response.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.model200_response import Model200Response
+
+class TestModel200Response(unittest.TestCase):
+ """Model200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Model200Response:
+ """Test Model200Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Model200Response`
+ """
+ model = Model200Response()
+ if include_optional:
+ return Model200Response(
+ name = 56,
+ var_class = ''
+ )
+ else:
+ return Model200Response(
+ )
+ """
+
+ def testModel200Response(self):
+ """Test Model200Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_model_api_response.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_model_api_response.py
new file mode 100644
index 00000000000..beca8e34434
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_model_api_response.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.model_api_response import ModelApiResponse
+
+class TestModelApiResponse(unittest.TestCase):
+ """ModelApiResponse unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ModelApiResponse:
+ """Test ModelApiResponse
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ModelApiResponse`
+ """
+ model = ModelApiResponse()
+ if include_optional:
+ return ModelApiResponse(
+ code = 56,
+ type = '',
+ message = ''
+ )
+ else:
+ return ModelApiResponse(
+ )
+ """
+
+ def testModelApiResponse(self):
+ """Test ModelApiResponse"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_model_field.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_model_field.py
new file mode 100644
index 00000000000..eb8dee7981c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_model_field.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.model_field import ModelField
+
+class TestModelField(unittest.TestCase):
+ """ModelField unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ModelField:
+ """Test ModelField
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ModelField`
+ """
+ model = ModelField()
+ if include_optional:
+ return ModelField(
+ var_field = ''
+ )
+ else:
+ return ModelField(
+ )
+ """
+
+ def testModelField(self):
+ """Test ModelField"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_model_return.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_model_return.py
new file mode 100644
index 00000000000..2c2afa1d43b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_model_return.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.model_return import ModelReturn
+
+class TestModelReturn(unittest.TestCase):
+ """ModelReturn unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ModelReturn:
+ """Test ModelReturn
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ModelReturn`
+ """
+ model = ModelReturn()
+ if include_optional:
+ return ModelReturn(
+ var_return = 56
+ )
+ else:
+ return ModelReturn(
+ )
+ """
+
+ def testModelReturn(self):
+ """Test ModelReturn"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_multi_arrays.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_multi_arrays.py
new file mode 100644
index 00000000000..bfd4f299881
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_multi_arrays.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.multi_arrays import MultiArrays
+
+class TestMultiArrays(unittest.TestCase):
+ """MultiArrays unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> MultiArrays:
+ """Test MultiArrays
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `MultiArrays`
+ """
+ model = MultiArrays()
+ if include_optional:
+ return MultiArrays(
+ tags = [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ],
+ files = [
+ petstore_api.models.file.File(
+ source_uri = '', )
+ ]
+ )
+ else:
+ return MultiArrays(
+ )
+ """
+
+ def testMultiArrays(self):
+ """Test MultiArrays"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_name.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_name.py
new file mode 100644
index 00000000000..db4e9cf37e9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_name.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.name import Name
+
+class TestName(unittest.TestCase):
+ """Name unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Name:
+ """Test Name
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Name`
+ """
+ model = Name()
+ if include_optional:
+ return Name(
+ name = 56,
+ snake_case = 56,
+ var_property = '',
+ var_123_number = 56
+ )
+ else:
+ return Name(
+ name = 56,
+ )
+ """
+
+ def testName(self):
+ """Test Name"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_nullable_class.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_nullable_class.py
new file mode 100644
index 00000000000..ecf5363b4ac
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_nullable_class.py
@@ -0,0 +1,76 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.nullable_class import NullableClass
+
+class TestNullableClass(unittest.TestCase):
+ """NullableClass unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> NullableClass:
+ """Test NullableClass
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `NullableClass`
+ """
+ model = NullableClass()
+ if include_optional:
+ return NullableClass(
+ required_integer_prop = 56,
+ integer_prop = 56,
+ number_prop = 1.337,
+ boolean_prop = True,
+ string_prop = '',
+ date_prop = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(),
+ datetime_prop = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ array_nullable_prop = [
+ None
+ ],
+ array_and_items_nullable_prop = [
+ None
+ ],
+ array_items_nullable = [
+ None
+ ],
+ object_nullable_prop = {
+ 'key' : None
+ },
+ object_and_items_nullable_prop = {
+ 'key' : None
+ },
+ object_items_nullable = {
+ 'key' : None
+ }
+ )
+ else:
+ return NullableClass(
+ required_integer_prop = 56,
+ )
+ """
+
+ def testNullableClass(self):
+ """Test NullableClass"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_nullable_property.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_nullable_property.py
new file mode 100644
index 00000000000..52bdc7874ed
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_nullable_property.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.nullable_property import NullableProperty
+
+class TestNullableProperty(unittest.TestCase):
+ """NullableProperty unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> NullableProperty:
+ """Test NullableProperty
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `NullableProperty`
+ """
+ model = NullableProperty()
+ if include_optional:
+ return NullableProperty(
+ id = 56,
+ name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>'
+ )
+ else:
+ return NullableProperty(
+ id = 56,
+ name = 'AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>',
+ )
+ """
+
+ def testNullableProperty(self):
+ """Test NullableProperty"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_number_only.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_number_only.py
new file mode 100644
index 00000000000..78d7c5cff92
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_number_only.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.number_only import NumberOnly
+
+class TestNumberOnly(unittest.TestCase):
+ """NumberOnly unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> NumberOnly:
+ """Test NumberOnly
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `NumberOnly`
+ """
+ model = NumberOnly()
+ if include_optional:
+ return NumberOnly(
+ just_number = 1.337
+ )
+ else:
+ return NumberOnly(
+ )
+ """
+
+ def testNumberOnly(self):
+ """Test NumberOnly"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_object_to_test_additional_properties.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_object_to_test_additional_properties.py
new file mode 100644
index 00000000000..62c9c505865
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_object_to_test_additional_properties.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties
+
+class TestObjectToTestAdditionalProperties(unittest.TestCase):
+ """ObjectToTestAdditionalProperties unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ObjectToTestAdditionalProperties:
+ """Test ObjectToTestAdditionalProperties
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ObjectToTestAdditionalProperties`
+ """
+ model = ObjectToTestAdditionalProperties()
+ if include_optional:
+ return ObjectToTestAdditionalProperties(
+ var_property = True
+ )
+ else:
+ return ObjectToTestAdditionalProperties(
+ )
+ """
+
+ def testObjectToTestAdditionalProperties(self):
+ """Test ObjectToTestAdditionalProperties"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_object_with_deprecated_fields.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_object_with_deprecated_fields.py
new file mode 100644
index 00000000000..bf6bf779339
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_object_with_deprecated_fields.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
+
+class TestObjectWithDeprecatedFields(unittest.TestCase):
+ """ObjectWithDeprecatedFields unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ObjectWithDeprecatedFields:
+ """Test ObjectWithDeprecatedFields
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ObjectWithDeprecatedFields`
+ """
+ model = ObjectWithDeprecatedFields()
+ if include_optional:
+ return ObjectWithDeprecatedFields(
+ uuid = '',
+ id = 1.337,
+ deprecated_ref = petstore_api.models.deprecated_object.DeprecatedObject(
+ name = '', ),
+ bars = [
+ 'bar'
+ ]
+ )
+ else:
+ return ObjectWithDeprecatedFields(
+ )
+ """
+
+ def testObjectWithDeprecatedFields(self):
+ """Test ObjectWithDeprecatedFields"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_one_of_enum_string.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_one_of_enum_string.py
new file mode 100644
index 00000000000..0434db164a7
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_one_of_enum_string.py
@@ -0,0 +1,50 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.one_of_enum_string import OneOfEnumString
+
+class TestOneOfEnumString(unittest.TestCase):
+ """OneOfEnumString unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> OneOfEnumString:
+ """Test OneOfEnumString
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `OneOfEnumString`
+ """
+ model = OneOfEnumString()
+ if include_optional:
+ return OneOfEnumString(
+ )
+ else:
+ return OneOfEnumString(
+ )
+ """
+
+ def testOneOfEnumString(self):
+ """Test OneOfEnumString"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_order.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_order.py
new file mode 100644
index 00000000000..a9b4980702d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_order.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.order import Order
+
+class TestOrder(unittest.TestCase):
+ """Order unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Order:
+ """Test Order
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Order`
+ """
+ model = Order()
+ if include_optional:
+ return Order(
+ id = 56,
+ pet_id = 56,
+ quantity = 56,
+ ship_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ status = 'placed',
+ complete = True
+ )
+ else:
+ return Order(
+ )
+ """
+
+ def testOrder(self):
+ """Test Order"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_composite.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_composite.py
new file mode 100644
index 00000000000..5024f1c483a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_composite.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.outer_composite import OuterComposite
+
+class TestOuterComposite(unittest.TestCase):
+ """OuterComposite unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> OuterComposite:
+ """Test OuterComposite
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `OuterComposite`
+ """
+ model = OuterComposite()
+ if include_optional:
+ return OuterComposite(
+ my_number = 1.337,
+ my_string = '',
+ my_boolean = True
+ )
+ else:
+ return OuterComposite(
+ )
+ """
+
+ def testOuterComposite(self):
+ """Test OuterComposite"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum.py
new file mode 100644
index 00000000000..2f82ecc94ba
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.outer_enum import OuterEnum
+
+class TestOuterEnum(unittest.TestCase):
+ """OuterEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnum(self):
+ """Test OuterEnum"""
+ # inst = OuterEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_default_value.py
new file mode 100644
index 00000000000..2a7ff27a824
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_default_value.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
+
+class TestOuterEnumDefaultValue(unittest.TestCase):
+ """OuterEnumDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumDefaultValue(self):
+ """Test OuterEnumDefaultValue"""
+ # inst = OuterEnumDefaultValue()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_integer.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_integer.py
new file mode 100644
index 00000000000..d74dcb0981a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_integer.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.outer_enum_integer import OuterEnumInteger
+
+class TestOuterEnumInteger(unittest.TestCase):
+ """OuterEnumInteger unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumInteger(self):
+ """Test OuterEnumInteger"""
+ # inst = OuterEnumInteger()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_integer_default_value.py
new file mode 100644
index 00000000000..230db8cb817
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_enum_integer_default_value.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
+
+class TestOuterEnumIntegerDefaultValue(unittest.TestCase):
+ """OuterEnumIntegerDefaultValue unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testOuterEnumIntegerDefaultValue(self):
+ """Test OuterEnumIntegerDefaultValue"""
+ # inst = OuterEnumIntegerDefaultValue()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_object_with_enum_property.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_object_with_enum_property.py
new file mode 100644
index 00000000000..a1c896ae661
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_outer_object_with_enum_property.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
+
+class TestOuterObjectWithEnumProperty(unittest.TestCase):
+ """OuterObjectWithEnumProperty unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> OuterObjectWithEnumProperty:
+ """Test OuterObjectWithEnumProperty
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `OuterObjectWithEnumProperty`
+ """
+ model = OuterObjectWithEnumProperty()
+ if include_optional:
+ return OuterObjectWithEnumProperty(
+ str_value = 'placed',
+ value = 2
+ )
+ else:
+ return OuterObjectWithEnumProperty(
+ value = 2,
+ )
+ """
+
+ def testOuterObjectWithEnumProperty(self):
+ """Test OuterObjectWithEnumProperty"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_parent.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_parent.py
new file mode 100644
index 00000000000..ea1242c24f4
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_parent.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.parent import Parent
+
+class TestParent(unittest.TestCase):
+ """Parent unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Parent:
+ """Test Parent
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Parent`
+ """
+ model = Parent()
+ if include_optional:
+ return Parent(
+ optional_dict = {
+ 'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
+ a_property = petstore_api.models.a_property.aProperty(), )
+ }
+ )
+ else:
+ return Parent(
+ )
+ """
+
+ def testParent(self):
+ """Test Parent"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_parent_with_optional_dict.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_parent_with_optional_dict.py
new file mode 100644
index 00000000000..7cc74f9e98e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_parent_with_optional_dict.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict
+
+class TestParentWithOptionalDict(unittest.TestCase):
+ """ParentWithOptionalDict unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ParentWithOptionalDict:
+ """Test ParentWithOptionalDict
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ParentWithOptionalDict`
+ """
+ model = ParentWithOptionalDict()
+ if include_optional:
+ return ParentWithOptionalDict(
+ optional_dict = {
+ 'key' : petstore_api.models.inner_dict_with_property.InnerDictWithProperty(
+ a_property = petstore_api.models.a_property.aProperty(), )
+ }
+ )
+ else:
+ return ParentWithOptionalDict(
+ )
+ """
+
+ def testParentWithOptionalDict(self):
+ """Test ParentWithOptionalDict"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_pet.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_pet.py
new file mode 100644
index 00000000000..3edc400fafc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_pet.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.pet import Pet
+
+class TestPet(unittest.TestCase):
+ """Pet unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Pet:
+ """Test Pet
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Pet`
+ """
+ model = Pet()
+ if include_optional:
+ return Pet(
+ id = 56,
+ category = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ tags = [
+ petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ ],
+ status = 'available'
+ )
+ else:
+ return Pet(
+ name = 'doggie',
+ photo_urls = [
+ ''
+ ],
+ )
+ """
+
+ def testPet(self):
+ """Test Pet"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_pet_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_pet_api.py
new file mode 100644
index 00000000000..4cf869d36a2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_pet_api.py
@@ -0,0 +1,94 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.pet_api import PetApi
+
+
+class TestPetApi(unittest.TestCase):
+ """PetApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = PetApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_add_pet(self) -> None:
+ """Test case for add_pet
+
+ Add a new pet to the store
+ """
+ pass
+
+ def test_delete_pet(self) -> None:
+ """Test case for delete_pet
+
+ Deletes a pet
+ """
+ pass
+
+ def test_find_pets_by_status(self) -> None:
+ """Test case for find_pets_by_status
+
+ Finds Pets by status
+ """
+ pass
+
+ def test_find_pets_by_tags(self) -> None:
+ """Test case for find_pets_by_tags
+
+ Finds Pets by tags
+ """
+ pass
+
+ def test_get_pet_by_id(self) -> None:
+ """Test case for get_pet_by_id
+
+ Find pet by ID
+ """
+ pass
+
+ def test_update_pet(self) -> None:
+ """Test case for update_pet
+
+ Update an existing pet
+ """
+ pass
+
+ def test_update_pet_with_form(self) -> None:
+ """Test case for update_pet_with_form
+
+ Updates a pet in the store with form data
+ """
+ pass
+
+ def test_upload_file(self) -> None:
+ """Test case for upload_file
+
+ uploads an image
+ """
+ pass
+
+ def test_upload_file_with_required_file(self) -> None:
+ """Test case for upload_file_with_required_file
+
+ uploads an image (required)
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_pig.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_pig.py
new file mode 100644
index 00000000000..c336579232b
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_pig.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.pig import Pig
+
+class TestPig(unittest.TestCase):
+ """Pig unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Pig:
+ """Test Pig
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Pig`
+ """
+ model = Pig()
+ if include_optional:
+ return Pig(
+ class_name = '',
+ color = '',
+ size = 56
+ )
+ else:
+ return Pig(
+ class_name = '',
+ color = '',
+ size = 56,
+ )
+ """
+
+ def testPig(self):
+ """Test Pig"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_pony_sizes.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_pony_sizes.py
new file mode 100644
index 00000000000..8586169f798
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_pony_sizes.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.pony_sizes import PonySizes
+
+class TestPonySizes(unittest.TestCase):
+ """PonySizes unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> PonySizes:
+ """Test PonySizes
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `PonySizes`
+ """
+ model = PonySizes()
+ if include_optional:
+ return PonySizes(
+ type = 2.0
+ )
+ else:
+ return PonySizes(
+ )
+ """
+
+ def testPonySizes(self):
+ """Test PonySizes"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_poop_cleaning.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_poop_cleaning.py
new file mode 100644
index 00000000000..5a12f965aef
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_poop_cleaning.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.poop_cleaning import PoopCleaning
+
+class TestPoopCleaning(unittest.TestCase):
+ """PoopCleaning unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> PoopCleaning:
+ """Test PoopCleaning
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `PoopCleaning`
+ """
+ model = PoopCleaning()
+ if include_optional:
+ return PoopCleaning(
+ task_name = 'cleaning',
+ function_name = 'care',
+ content = ''
+ )
+ else:
+ return PoopCleaning(
+ task_name = 'cleaning',
+ function_name = 'care',
+ content = '',
+ )
+ """
+
+ def testPoopCleaning(self):
+ """Test PoopCleaning"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_primitive_string.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_primitive_string.py
new file mode 100644
index 00000000000..67ec90914d0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_primitive_string.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.primitive_string import PrimitiveString
+
+class TestPrimitiveString(unittest.TestCase):
+ """PrimitiveString unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> PrimitiveString:
+ """Test PrimitiveString
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `PrimitiveString`
+ """
+ model = PrimitiveString()
+ if include_optional:
+ return PrimitiveString(
+ value = ''
+ )
+ else:
+ return PrimitiveString(
+ )
+ """
+
+ def testPrimitiveString(self):
+ """Test PrimitiveString"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_property_map.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_property_map.py
new file mode 100644
index 00000000000..2f2fed72a13
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_property_map.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.property_map import PropertyMap
+
+class TestPropertyMap(unittest.TestCase):
+ """PropertyMap unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> PropertyMap:
+ """Test PropertyMap
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `PropertyMap`
+ """
+ model = PropertyMap()
+ if include_optional:
+ return PropertyMap(
+ some_data = {
+ 'key' : petstore_api.models.tag.Tag(
+ id = 56,
+ name = '', )
+ }
+ )
+ else:
+ return PropertyMap(
+ )
+ """
+
+ def testPropertyMap(self):
+ """Test PropertyMap"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_property_name_collision.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_property_name_collision.py
new file mode 100644
index 00000000000..ab7919c7e6a
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_property_name_collision.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.property_name_collision import PropertyNameCollision
+
+class TestPropertyNameCollision(unittest.TestCase):
+ """PropertyNameCollision unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> PropertyNameCollision:
+ """Test PropertyNameCollision
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `PropertyNameCollision`
+ """
+ model = PropertyNameCollision()
+ if include_optional:
+ return PropertyNameCollision(
+ underscore_type = '',
+ type = '',
+ type_with_underscore = ''
+ )
+ else:
+ return PropertyNameCollision(
+ )
+ """
+
+ def testPropertyNameCollision(self):
+ """Test PropertyNameCollision"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_read_only_first.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_read_only_first.py
new file mode 100644
index 00000000000..ec7a1aa2414
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_read_only_first.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.read_only_first import ReadOnlyFirst
+
+class TestReadOnlyFirst(unittest.TestCase):
+ """ReadOnlyFirst unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ReadOnlyFirst:
+ """Test ReadOnlyFirst
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `ReadOnlyFirst`
+ """
+ model = ReadOnlyFirst()
+ if include_optional:
+ return ReadOnlyFirst(
+ bar = '',
+ baz = ''
+ )
+ else:
+ return ReadOnlyFirst(
+ )
+ """
+
+ def testReadOnlyFirst(self):
+ """Test ReadOnlyFirst"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_second_circular_all_of_ref.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_second_circular_all_of_ref.py
new file mode 100644
index 00000000000..21d9005a5e8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_second_circular_all_of_ref.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
+
+class TestSecondCircularAllOfRef(unittest.TestCase):
+ """SecondCircularAllOfRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> SecondCircularAllOfRef:
+ """Test SecondCircularAllOfRef
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SecondCircularAllOfRef`
+ """
+ model = SecondCircularAllOfRef()
+ if include_optional:
+ return SecondCircularAllOfRef(
+ name = '',
+ circular_all_of_ref = [
+ petstore_api.models.circular_all_of_ref.CircularAllOfRef()
+ ]
+ )
+ else:
+ return SecondCircularAllOfRef(
+ )
+ """
+
+ def testSecondCircularAllOfRef(self):
+ """Test SecondCircularAllOfRef"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_second_ref.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_second_ref.py
new file mode 100644
index 00000000000..f6117988c19
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_second_ref.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.second_ref import SecondRef
+
+class TestSecondRef(unittest.TestCase):
+ """SecondRef unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> SecondRef:
+ """Test SecondRef
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SecondRef`
+ """
+ model = SecondRef()
+ if include_optional:
+ return SecondRef(
+ category = '',
+ circular_ref = petstore_api.models.circular_reference_model.Circular-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.first_ref.FirstRef(
+ category = '',
+ self_ref = petstore_api.models.second_ref.SecondRef(
+ category = '', ), ), )
+ )
+ else:
+ return SecondRef(
+ )
+ """
+
+ def testSecondRef(self):
+ """Test SecondRef"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_self_reference_model.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_self_reference_model.py
new file mode 100644
index 00000000000..018bcd195b6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_self_reference_model.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.self_reference_model import SelfReferenceModel
+
+class TestSelfReferenceModel(unittest.TestCase):
+ """SelfReferenceModel unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> SelfReferenceModel:
+ """Test SelfReferenceModel
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SelfReferenceModel`
+ """
+ model = SelfReferenceModel()
+ if include_optional:
+ return SelfReferenceModel(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '',
+ self_ref = petstore_api.models.self_reference_model.Self-Reference-Model(
+ size = 56,
+ nested = petstore_api.models.dummy_model.Dummy-Model(
+ category = '', ), ), )
+ )
+ else:
+ return SelfReferenceModel(
+ )
+ """
+
+ def testSelfReferenceModel(self):
+ """Test SelfReferenceModel"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_single_ref_type.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_single_ref_type.py
new file mode 100644
index 00000000000..630b1c13708
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_single_ref_type.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.single_ref_type import SingleRefType
+
+class TestSingleRefType(unittest.TestCase):
+ """SingleRefType unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testSingleRefType(self):
+ """Test SingleRefType"""
+ # inst = SingleRefType()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_special_character_enum.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_special_character_enum.py
new file mode 100644
index 00000000000..464808e61b0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_special_character_enum.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.special_character_enum import SpecialCharacterEnum
+
+class TestSpecialCharacterEnum(unittest.TestCase):
+ """SpecialCharacterEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testSpecialCharacterEnum(self):
+ """Test SpecialCharacterEnum"""
+ # inst = SpecialCharacterEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_special_model_name.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_special_model_name.py
new file mode 100644
index 00000000000..e913fa28f51
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_special_model_name.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.special_model_name import SpecialModelName
+
+class TestSpecialModelName(unittest.TestCase):
+ """SpecialModelName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> SpecialModelName:
+ """Test SpecialModelName
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SpecialModelName`
+ """
+ model = SpecialModelName()
+ if include_optional:
+ return SpecialModelName(
+ special_property_name = 56
+ )
+ else:
+ return SpecialModelName(
+ )
+ """
+
+ def testSpecialModelName(self):
+ """Test SpecialModelName"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_special_name.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_special_name.py
new file mode 100644
index 00000000000..153768c9898
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_special_name.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.special_name import SpecialName
+
+class TestSpecialName(unittest.TestCase):
+ """SpecialName unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> SpecialName:
+ """Test SpecialName
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `SpecialName`
+ """
+ model = SpecialName()
+ if include_optional:
+ return SpecialName(
+ var_property = 56,
+ var_async = petstore_api.models.category.Category(
+ id = 56,
+ name = 'default-name', ),
+ var_schema = 'available'
+ )
+ else:
+ return SpecialName(
+ )
+ """
+
+ def testSpecialName(self):
+ """Test SpecialName"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_store_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_store_api.py
new file mode 100644
index 00000000000..603b0f7bc57
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_store_api.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.store_api import StoreApi
+
+
+class TestStoreApi(unittest.TestCase):
+ """StoreApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = StoreApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_delete_order(self) -> None:
+ """Test case for delete_order
+
+ Delete purchase order by ID
+ """
+ pass
+
+ def test_get_inventory(self) -> None:
+ """Test case for get_inventory
+
+ Returns pet inventories by status
+ """
+ pass
+
+ def test_get_order_by_id(self) -> None:
+ """Test case for get_order_by_id
+
+ Find purchase order by ID
+ """
+ pass
+
+ def test_place_order(self) -> None:
+ """Test case for place_order
+
+ Place an order for a pet
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_tag.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_tag.py
new file mode 100644
index 00000000000..92061e615e2
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_tag.py
@@ -0,0 +1,52 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.tag import Tag
+
+class TestTag(unittest.TestCase):
+ """Tag unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Tag:
+ """Test Tag
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Tag`
+ """
+ model = Tag()
+ if include_optional:
+ return Tag(
+ id = 56,
+ name = ''
+ )
+ else:
+ return Tag(
+ )
+ """
+
+ def testTag(self):
+ """Test Tag"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_task.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_task.py
new file mode 100644
index 00000000000..0044da80776
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_task.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.task import Task
+
+class TestTask(unittest.TestCase):
+ """Task unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Task:
+ """Test Task
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Task`
+ """
+ model = Task()
+ if include_optional:
+ return Task(
+ id = '',
+ activity = None
+ )
+ else:
+ return Task(
+ id = '',
+ activity = None,
+ )
+ """
+
+ def testTask(self):
+ """Test Task"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_task_activity.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_task_activity.py
new file mode 100644
index 00000000000..bd25e5887ac
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_task_activity.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.task_activity import TaskActivity
+
+class TestTaskActivity(unittest.TestCase):
+ """TaskActivity unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> TaskActivity:
+ """Test TaskActivity
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TaskActivity`
+ """
+ model = TaskActivity()
+ if include_optional:
+ return TaskActivity(
+ task_name = 'cleaning_deep',
+ function_name = 'care_nourish',
+ content = ''
+ )
+ else:
+ return TaskActivity(
+ task_name = 'cleaning_deep',
+ function_name = 'care_nourish',
+ content = '',
+ )
+ """
+
+ def testTaskActivity(self):
+ """Test TaskActivity"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_enum.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_enum.py
new file mode 100644
index 00000000000..aec65edf520
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_enum.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_enum import TestEnum
+
+class TestTestEnum(unittest.TestCase):
+ """TestEnum unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testTestEnum(self):
+ """Test TestEnum"""
+ # inst = TestEnum()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_enum_with_default.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_enum_with_default.py
new file mode 100644
index 00000000000..b51e4281955
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_enum_with_default.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_enum_with_default import TestEnumWithDefault
+
+class TestTestEnumWithDefault(unittest.TestCase):
+ """TestEnumWithDefault unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testTestEnumWithDefault(self):
+ """Test TestEnumWithDefault"""
+ # inst = TestEnumWithDefault()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_error_responses_with_model400_response.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_error_responses_with_model400_response.py
new file mode 100644
index 00000000000..72d243b82fc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_error_responses_with_model400_response.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response
+
+class TestTestErrorResponsesWithModel400Response(unittest.TestCase):
+ """TestErrorResponsesWithModel400Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> TestErrorResponsesWithModel400Response:
+ """Test TestErrorResponsesWithModel400Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TestErrorResponsesWithModel400Response`
+ """
+ model = TestErrorResponsesWithModel400Response()
+ if include_optional:
+ return TestErrorResponsesWithModel400Response(
+ reason400 = ''
+ )
+ else:
+ return TestErrorResponsesWithModel400Response(
+ )
+ """
+
+ def testTestErrorResponsesWithModel400Response(self):
+ """Test TestErrorResponsesWithModel400Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_error_responses_with_model404_response.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_error_responses_with_model404_response.py
new file mode 100644
index 00000000000..fff790172b1
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_error_responses_with_model404_response.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response
+
+class TestTestErrorResponsesWithModel404Response(unittest.TestCase):
+ """TestErrorResponsesWithModel404Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> TestErrorResponsesWithModel404Response:
+ """Test TestErrorResponsesWithModel404Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TestErrorResponsesWithModel404Response`
+ """
+ model = TestErrorResponsesWithModel404Response()
+ if include_optional:
+ return TestErrorResponsesWithModel404Response(
+ reason404 = ''
+ )
+ else:
+ return TestErrorResponsesWithModel404Response(
+ )
+ """
+
+ def testTestErrorResponsesWithModel404Response(self):
+ """Test TestErrorResponsesWithModel404Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_inline_freeform_additional_properties_request.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_inline_freeform_additional_properties_request.py
new file mode 100644
index 00000000000..add42258580
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_inline_freeform_additional_properties_request.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
+
+class TestTestInlineFreeformAdditionalPropertiesRequest(unittest.TestCase):
+ """TestInlineFreeformAdditionalPropertiesRequest unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> TestInlineFreeformAdditionalPropertiesRequest:
+ """Test TestInlineFreeformAdditionalPropertiesRequest
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TestInlineFreeformAdditionalPropertiesRequest`
+ """
+ model = TestInlineFreeformAdditionalPropertiesRequest()
+ if include_optional:
+ return TestInlineFreeformAdditionalPropertiesRequest(
+ some_property = ''
+ )
+ else:
+ return TestInlineFreeformAdditionalPropertiesRequest(
+ )
+ """
+
+ def testTestInlineFreeformAdditionalPropertiesRequest(self):
+ """Test TestInlineFreeformAdditionalPropertiesRequest"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_model_with_enum_default.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_model_with_enum_default.py
new file mode 100644
index 00000000000..e58802b59de
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_model_with_enum_default.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault
+
+class TestTestModelWithEnumDefault(unittest.TestCase):
+ """TestModelWithEnumDefault unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> TestModelWithEnumDefault:
+ """Test TestModelWithEnumDefault
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TestModelWithEnumDefault`
+ """
+ model = TestModelWithEnumDefault()
+ if include_optional:
+ return TestModelWithEnumDefault(
+ test_enum = 'ONE',
+ test_string = 'Just some string',
+ test_enum_with_default = 'ZWEI',
+ test_string_with_default = 'ahoy matey',
+ test_inline_defined_enum_with_default = 'B'
+ )
+ else:
+ return TestModelWithEnumDefault(
+ test_enum = 'ONE',
+ )
+ """
+
+ def testTestModelWithEnumDefault(self):
+ """Test TestModelWithEnumDefault"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_test_object_for_multipart_requests_request_marker.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_object_for_multipart_requests_request_marker.py
new file mode 100644
index 00000000000..585a39c8fe6
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_test_object_for_multipart_requests_request_marker.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
+
+class TestTestObjectForMultipartRequestsRequestMarker(unittest.TestCase):
+ """TestObjectForMultipartRequestsRequestMarker unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> TestObjectForMultipartRequestsRequestMarker:
+ """Test TestObjectForMultipartRequestsRequestMarker
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `TestObjectForMultipartRequestsRequestMarker`
+ """
+ model = TestObjectForMultipartRequestsRequestMarker()
+ if include_optional:
+ return TestObjectForMultipartRequestsRequestMarker(
+ name = ''
+ )
+ else:
+ return TestObjectForMultipartRequestsRequestMarker(
+ )
+ """
+
+ def testTestObjectForMultipartRequestsRequestMarker(self):
+ """Test TestObjectForMultipartRequestsRequestMarker"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_tiger.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_tiger.py
new file mode 100644
index 00000000000..2d153c1749c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_tiger.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.tiger import Tiger
+
+class TestTiger(unittest.TestCase):
+ """Tiger unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> Tiger:
+ """Test Tiger
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `Tiger`
+ """
+ model = Tiger()
+ if include_optional:
+ return Tiger(
+ skill = ''
+ )
+ else:
+ return Tiger(
+ )
+ """
+
+ def testTiger(self):
+ """Test Tiger"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_type.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_type.py
new file mode 100644
index 00000000000..ecafff8199d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_type.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.type import Type
+
+class TestType(unittest.TestCase):
+ """Type unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def testType(self):
+ """Test Type"""
+ # inst = Type()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_unnamed_dict_with_additional_model_list_properties.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_unnamed_dict_with_additional_model_list_properties.py
new file mode 100644
index 00000000000..874af4e78f8
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_unnamed_dict_with_additional_model_list_properties.py
@@ -0,0 +1,56 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties
+
+class TestUnnamedDictWithAdditionalModelListProperties(unittest.TestCase):
+ """UnnamedDictWithAdditionalModelListProperties unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> UnnamedDictWithAdditionalModelListProperties:
+ """Test UnnamedDictWithAdditionalModelListProperties
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UnnamedDictWithAdditionalModelListProperties`
+ """
+ model = UnnamedDictWithAdditionalModelListProperties()
+ if include_optional:
+ return UnnamedDictWithAdditionalModelListProperties(
+ dict_property = {
+ 'key' : [
+ petstore_api.models.creature_info.CreatureInfo(
+ name = '', )
+ ]
+ }
+ )
+ else:
+ return UnnamedDictWithAdditionalModelListProperties(
+ )
+ """
+
+ def testUnnamedDictWithAdditionalModelListProperties(self):
+ """Test UnnamedDictWithAdditionalModelListProperties"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_unnamed_dict_with_additional_string_list_properties.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_unnamed_dict_with_additional_string_list_properties.py
new file mode 100644
index 00000000000..e0a94bc92dc
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_unnamed_dict_with_additional_string_list_properties.py
@@ -0,0 +1,55 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties
+
+class TestUnnamedDictWithAdditionalStringListProperties(unittest.TestCase):
+ """UnnamedDictWithAdditionalStringListProperties unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> UnnamedDictWithAdditionalStringListProperties:
+ """Test UnnamedDictWithAdditionalStringListProperties
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UnnamedDictWithAdditionalStringListProperties`
+ """
+ model = UnnamedDictWithAdditionalStringListProperties()
+ if include_optional:
+ return UnnamedDictWithAdditionalStringListProperties(
+ dict_property = {
+ 'key' : [
+ ''
+ ]
+ }
+ )
+ else:
+ return UnnamedDictWithAdditionalStringListProperties(
+ )
+ """
+
+ def testUnnamedDictWithAdditionalStringListProperties(self):
+ """Test UnnamedDictWithAdditionalStringListProperties"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_upload_file_with_additional_properties_request_object.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_upload_file_with_additional_properties_request_object.py
new file mode 100644
index 00000000000..8b3fa3b9084
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_upload_file_with_additional_properties_request_object.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
+
+class TestUploadFileWithAdditionalPropertiesRequestObject(unittest.TestCase):
+ """UploadFileWithAdditionalPropertiesRequestObject unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> UploadFileWithAdditionalPropertiesRequestObject:
+ """Test UploadFileWithAdditionalPropertiesRequestObject
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `UploadFileWithAdditionalPropertiesRequestObject`
+ """
+ model = UploadFileWithAdditionalPropertiesRequestObject()
+ if include_optional:
+ return UploadFileWithAdditionalPropertiesRequestObject(
+ name = ''
+ )
+ else:
+ return UploadFileWithAdditionalPropertiesRequestObject(
+ )
+ """
+
+ def testUploadFileWithAdditionalPropertiesRequestObject(self):
+ """Test UploadFileWithAdditionalPropertiesRequestObject"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_user.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_user.py
new file mode 100644
index 00000000000..19c32073322
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_user.py
@@ -0,0 +1,58 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.user import User
+
+class TestUser(unittest.TestCase):
+ """User unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> User:
+ """Test User
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `User`
+ """
+ model = User()
+ if include_optional:
+ return User(
+ id = 56,
+ username = '',
+ first_name = '',
+ last_name = '',
+ email = '',
+ password = '',
+ phone = '',
+ user_status = 56
+ )
+ else:
+ return User(
+ )
+ """
+
+ def testUser(self):
+ """Test User"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_user_api.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_user_api.py
new file mode 100644
index 00000000000..6b17c42093e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_user_api.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.api.user_api import UserApi
+
+
+class TestUserApi(unittest.TestCase):
+ """UserApi unit test stubs"""
+
+ def setUp(self) -> None:
+ self.api = UserApi()
+
+ def tearDown(self) -> None:
+ pass
+
+ def test_create_user(self) -> None:
+ """Test case for create_user
+
+ Create user
+ """
+ pass
+
+ def test_create_users_with_array_input(self) -> None:
+ """Test case for create_users_with_array_input
+
+ Creates list of users with given input array
+ """
+ pass
+
+ def test_create_users_with_list_input(self) -> None:
+ """Test case for create_users_with_list_input
+
+ Creates list of users with given input array
+ """
+ pass
+
+ def test_delete_user(self) -> None:
+ """Test case for delete_user
+
+ Delete user
+ """
+ pass
+
+ def test_get_user_by_name(self) -> None:
+ """Test case for get_user_by_name
+
+ Get user by user name
+ """
+ pass
+
+ def test_login_user(self) -> None:
+ """Test case for login_user
+
+ Logs user into the system
+ """
+ pass
+
+ def test_logout_user(self) -> None:
+ """Test case for logout_user
+
+ Logs out current logged in user session
+ """
+ pass
+
+ def test_update_user(self) -> None:
+ """Test case for update_user
+
+ Updated user
+ """
+ pass
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/test/test_with_nested_one_of.py b/samples/openapi3/client/petstore/python-lazyImports/test/test_with_nested_one_of.py
new file mode 100644
index 00000000000..6d8fd35bfc0
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/test/test_with_nested_one_of.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ OpenAPI Petstore
+
+ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+ The version of the OpenAPI document: 1.0.0
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from petstore_api.models.with_nested_one_of import WithNestedOneOf
+
+class TestWithNestedOneOf(unittest.TestCase):
+ """WithNestedOneOf unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WithNestedOneOf:
+ """Test WithNestedOneOf
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included """
+ # uncomment below to create an instance of `WithNestedOneOf`
+ """
+ model = WithNestedOneOf()
+ if include_optional:
+ return WithNestedOneOf(
+ size = 56,
+ nested_pig = None,
+ nested_oneof_enum_string = None
+ )
+ else:
+ return WithNestedOneOf(
+ )
+ """
+
+ def testWithNestedOneOf(self):
+ """Test WithNestedOneOf"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/testfiles/pix.gif b/samples/openapi3/client/petstore/python-lazyImports/testfiles/pix.gif
new file mode 100644
index 00000000000..f191b280ce9
Binary files /dev/null and b/samples/openapi3/client/petstore/python-lazyImports/testfiles/pix.gif differ
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/__init__.py b/samples/openapi3/client/petstore/python-lazyImports/tests/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_api.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api.py
new file mode 100644
index 00000000000..643e0fc61b5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api.py
@@ -0,0 +1,90 @@
+import json
+import unittest
+from unittest.mock import patch, Mock
+
+import pytest
+
+import petstore_api
+
+
+class TestMultipleResponseTypes(unittest.TestCase):
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.fake_api = petstore_api.FakeApi(self.api_client)
+
+ def test_204(self):
+ mock_resp = Mock()
+ mock_resp.status = 204
+ mock_resp.data = b""
+ mock_resp.getheaders.return_value = {}
+
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.test_empty_and_non_empty_responses()
+
+ assert returned is None
+
+ def test_206(self):
+ mock_resp = Mock()
+ mock_resp.status = 206
+ mock_resp.data = b"some text"
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.test_empty_and_non_empty_responses()
+
+ assert returned == "some text"
+
+
+class TestErrorResponsesWithModels(unittest.TestCase):
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.fake_api = petstore_api.FakeApi(self.api_client)
+
+ def test_400(self):
+ mock_resp = Mock()
+ mock_resp.status = 400
+ mock_resp.data = json.dumps({"reason400": "400 reason"}).encode("utf-8")
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader.return_value = ""
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ with pytest.raises(petstore_api.exceptions.BadRequestException) as exc_info:
+ self.fake_api.test_error_responses_with_model()
+
+ expected_resp = petstore_api.TestErrorResponsesWithModel400Response(
+ reason400="400 reason"
+ )
+ assert exc_info.value.data == expected_resp
+
+ def test_404(self):
+ mock_resp = Mock()
+ mock_resp.status = 404
+ mock_resp.data = json.dumps({"reason404": "404 reason"}).encode("utf-8")
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader.return_value = ""
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ with pytest.raises(petstore_api.exceptions.NotFoundException) as exc_info:
+ self.fake_api.test_error_responses_with_model()
+
+ expected_resp = petstore_api.TestErrorResponsesWithModel404Response(
+ reason404="404 reason"
+ )
+ assert exc_info.value.data == expected_resp
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_client.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_client.py
new file mode 100644
index 00000000000..cb0ed9080f5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_client.py
@@ -0,0 +1,301 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd OpenAPIetstore-python
+$ pytest
+"""
+
+import unittest
+from decimal import Decimal
+from enum import Enum
+
+from dateutil.parser import parse
+
+import petstore_api
+import petstore_api.configuration
+
+HOST = 'http://localhost/v2'
+
+
+class ApiClientTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+
+ def test_configuration(self):
+ config = petstore_api.Configuration()
+
+ config.api_key['api_key'] = '123456'
+ config.api_key_prefix['api_key'] = 'PREFIX'
+ config.username = 'test_username'
+ config.password = 'test_password'
+
+ header_params = {'test1': 'value1'}
+ query_params = {'test2': 'value2'}
+ auth_settings = ['api_key', 'unknown']
+
+ client = petstore_api.ApiClient(config)
+
+ # test prefix
+ self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key'])
+
+ # update parameters based on auth setting
+ client.update_params_for_auth(header_params, query_params,
+ auth_settings,
+ None, None, None)
+
+ # test api key auth
+ self.assertEqual(header_params['test1'], 'value1')
+ self.assertEqual(header_params['api_key'], 'PREFIX 123456')
+ self.assertEqual(query_params['test2'], 'value2')
+
+ # test basic auth
+ self.assertEqual('test_username', client.configuration.username)
+ self.assertEqual('test_password', client.configuration.password)
+
+ def test_ignore_operation_servers(self):
+ config = petstore_api.Configuration(host=HOST)
+ client = petstore_api.ApiClient(config)
+ user_api_instance = petstore_api.UserApi(client)
+
+ config_ignore = petstore_api.Configuration(host=HOST, ignore_operation_servers=True)
+ client_ignore = petstore_api.ApiClient(config_ignore)
+ user_api_instance_ignore = petstore_api.UserApi(client_ignore)
+
+ params_to_serialize = {
+ 'user': petstore_api.User(id=1, username='test'),
+ '_request_auth': None,
+ '_content_type': 'application/json',
+ '_headers': None,
+ '_host_index': 0
+ }
+
+ # operation servers should be used
+ _, url, *_ = user_api_instance._create_user_serialize(**params_to_serialize)
+ self.assertEqual(client.configuration.host, HOST)
+ self.assertEqual(url, 'http://localhost/v2/user')
+
+ # operation servers should be ignored
+ _, url_ignore, *_ = user_api_instance_ignore._create_user_serialize(**params_to_serialize)
+ self.assertEqual(client.configuration.host, HOST)
+ self.assertEqual(url_ignore, HOST + '/user')
+
+ def test_select_header_accept(self):
+ accepts = ['APPLICATION/JSON', 'APPLICATION/XML']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'APPLICATION/JSON')
+
+ accepts = ['application/json', 'application/xml']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json')
+
+ accepts = ['application/xml', 'application/json']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json')
+
+ accepts = ['application/xml', 'application/json-patch+json']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json-patch+json')
+
+ accepts = ['application/xml', 'application/json; charset=utf-8']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json; charset=utf-8')
+
+ accepts = ['application/xml', 'application/json;format=flowed']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'application/json;format=flowed')
+
+ accepts = ['text/plain', 'application/xml']
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, 'text/plain')
+
+ accepts = []
+ accept = self.api_client.select_header_accept(accepts)
+ self.assertEqual(accept, None)
+
+ def test_select_header_content_type(self):
+ content_types = ['APPLICATION/JSON', 'APPLICATION/XML']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'APPLICATION/JSON')
+
+ content_types = ['application/json', 'application/xml']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json')
+
+ content_types = ['application/xml', 'application/json']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json')
+
+ content_types = ['application/xml', 'application/json-patch+json']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json-patch+json')
+
+ content_types = ['application/xml', 'application/json; charset=utf-8']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json; charset=utf-8')
+
+ content_types = ['application/xml', 'application/json;format=flowed']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'application/json;format=flowed')
+
+ content_types = ['text/plain', 'application/xml']
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, 'text/plain')
+
+ # no content type, default to None
+ content_types = []
+ content_type = self.api_client.select_header_content_type(content_types)
+ self.assertEqual(content_type, None)
+
+ def test_sanitize_for_serialization_none(self):
+ data = None
+ result = self.api_client.sanitize_for_serialization(None)
+ self.assertEqual(result, data)
+
+ def test_sanitize_for_serialization_str(self):
+ data = "test string"
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ def test_sanitize_for_serialization_int(self):
+ data = 1
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ def test_sanitize_for_serialization_bool(self):
+ data = True
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ def test_sanitize_for_serialization_date(self):
+ data = parse("1997-07-16").date() # date
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, "1997-07-16")
+
+ def test_sanitize_for_serialization_datetime(self):
+ data = parse("1997-07-16T19:20:30.45+01:00") # datetime
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00")
+
+ def test_sanitize_for_serialization_decimal(self):
+ data = Decimal("1.0")
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, "1.0")
+
+ def test_sanitize_for_serialization_list_enum(self):
+ class EnumSerialization(int, Enum):
+ NUMBER_0 = 0
+ NUMBER_1 = 1
+
+ data = [EnumSerialization.NUMBER_1]
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, [1])
+ self.assertNotIsInstance(result[0], EnumSerialization)
+
+ def test_sanitize_for_serialization_list(self):
+ data = [1]
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ def test_sanitize_for_serialization_dict(self):
+ data = {"test key": "test value"}
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, data)
+
+ def test_sanitize_for_serialization_model(self):
+ pet_dict = {"id": 1, "name": "monkey",
+ "category": {"id": 1, "name": "test category"},
+ "tags": [{"id": 1, "name": "test tag1"},
+ {"id": 2, "name": "test tag2"}],
+ "status": "available",
+ "photoUrls": ["http://foo.bar.com/3",
+ "http://foo.bar.com/4"]}
+ pet = petstore_api.Pet(name="monkey", photoUrls=["http://foo.bar.com/3", "http://foo.bar.com/4"])
+ pet.id = 1
+ cate = petstore_api.Category(name="test category")
+ cate.id = 1
+ pet.category = cate
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ tag1.name = "test tag1"
+ tag2 = petstore_api.Tag()
+ tag2.id = 2
+ tag2.name = "test tag2"
+ pet.tags = [tag1, tag2]
+ pet.status = "available"
+
+ data = pet
+ result = self.api_client.sanitize_for_serialization(data)
+ self.assertEqual(result, pet_dict)
+
+ # list of models
+ list_of_pet_dict = [pet_dict]
+ result = self.api_client.sanitize_for_serialization([pet])
+ self.assertEqual(result, list_of_pet_dict)
+
+ def test_parameters_to_url_query_simple_values(self):
+ data = 'value={"category": "example", "category2": "example2"}'
+ dictionary = {
+ "category": "example",
+ "category2": "example2"
+ }
+ result = self.api_client.parameters_to_url_query([('value', dictionary)], {})
+ self.assertEqual(result,
+ "value=%7B%22category%22%3A%20%22example%22%2C%20%22category2%22%3A%20%22example2%22%7D")
+
+ def test_parameters_to_url_query_complex_values(self):
+ data = 'value={"number": 1, "string": "str", "bool": true, "dict": {"number": 1, "string": "str", "bool": true}}'
+ dictionary = {
+ "number": 1,
+ "string": "str",
+ "bool": True,
+ "dict": {
+ "number": 1,
+ "string": "str",
+ "bool": True
+ }
+ }
+ result = self.api_client.parameters_to_url_query([('value', dictionary)], {})
+ self.assertEqual(result,
+ 'value=%7B%22number%22%3A%201%2C%20%22string%22%3A%20%22str%22%2C%20%22bool%22%3A%20true%2C%20%22dict%22%3A%20%7B%22number%22%3A%201%2C%20%22string%22%3A%20%22str%22%2C%20%22bool%22%3A%20true%7D%7D')
+
+ def test_parameters_to_url_query_dict_values(self):
+ data = 'value={"strValues": ["one", "two", "three"], "dictValues": [{"name": "value1", "age": 14}, {"name": "value2", "age": 12}]}'
+ dictionary = {
+ "strValues": [
+ "one",
+ "two",
+ "three"
+ ],
+ "dictValues": [
+ {
+ "name": "value1",
+ "age": 14
+ },
+ {
+ "name": "value2",
+ "age": 12
+ },
+ ]
+ }
+ result = self.api_client.parameters_to_url_query([('value', dictionary)], {})
+ self.assertEqual(result,
+ 'value=%7B%22strValues%22%3A%20%5B%22one%22%2C%20%22two%22%2C%20%22three%22%5D%2C%20%22dictValues%22%3A%20%5B%7B%22name%22%3A%20%22value1%22%2C%20%22age%22%3A%2014%7D%2C%20%7B%22name%22%3A%20%22value2%22%2C%20%22age%22%3A%2012%7D%5D%7D')
+
+ def test_parameters_to_url_query_boolean_value(self):
+ result = self.api_client.parameters_to_url_query([('boolean', True)], {})
+ self.assertEqual(result, "boolean=true")
+
+ def test_parameters_to_url_query_list_value(self):
+ params = self.api_client.parameters_to_url_query(params=[('list', [1, 2, 3])],
+ collection_formats={'list': 'multi'})
+ self.assertEqual(params, "list=1&list=2&list=3")
+
+ def test_parameters_to_url_query_list_value_encoded(self):
+ params = self.api_client.parameters_to_url_query(params=[('list', [" !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", "2023-01-01T00:00:00+01:00"])],
+ collection_formats={'list': 'multi'})
+ self.assertEqual(params, "list=%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-./%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E_%60%7B%7C%7D~&list=2023-01-01T00%3A00%3A00%2B01%3A00")
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_exception.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_exception.py
new file mode 100644
index 00000000000..bf2ce66af1d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_exception.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd petstore_api-python
+$ pytest
+"""
+
+import os
+import sys
+import unittest
+
+import petstore_api
+from petstore_api import Configuration
+from petstore_api.rest import ApiException
+
+from .util import id_gen
+
+HOST = 'http://localhost/v2'
+
+class ApiExceptionTests(unittest.TestCase):
+
+ def setUp(self):
+ config = Configuration()
+ config.host = HOST
+ config.access_token = 'ACCESS_TOKEN'
+ self.api_client = petstore_api.ApiClient(config)
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(name="dog")
+ self.category.id = id_gen()
+ self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "blank"
+ self.pet = petstore_api.Pet(name="hello kity", photoUrls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ def test_404_error(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+ self.pet_api.delete_pet(pet_id=self.pet.id)
+
+ with self.checkRaiseRegex(ApiException, "Pet not found"):
+ self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+
+ try:
+ self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ except ApiException as e:
+ self.assertEqual(e.status, 404)
+ self.assertEqual(e.reason, "Not Found")
+ self.checkRegex(e.body, "Pet not found")
+
+ def test_500_error(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+
+ with self.checkRaiseRegex(ApiException, "Internal Server Error"):
+ self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata="special",
+ file=None
+ )
+
+ try:
+ self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata="special",
+ file=None
+ )
+ except ApiException as e:
+ self.assertEqual(e.status, 500)
+ self.assertEqual(e.reason, "Internal Server Error")
+ self.checkRegex(e.body, "Error 500 Internal Server Error")
+
+ def checkRaiseRegex(self, expected_exception, expected_regex):
+ return self.assertRaisesRegex(expected_exception, expected_regex)
+
+ def checkRegex(self, text, expected_regex):
+ return self.assertRegex(text, expected_regex)
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py
new file mode 100644
index 00000000000..da1634eeceb
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_api_validation.py
@@ -0,0 +1,123 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd petstore_api-python
+$ pytest
+"""
+
+import os
+import sys
+import unittest
+
+import petstore_api
+from petstore_api.rest import ApiException
+from pydantic import BaseModel, ValidationError
+
+from .util import id_gen
+
+
+class ApiExceptionTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(name="dog")
+ self.category.id = id_gen()
+ self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "blank"
+ self.pet = petstore_api.Pet(name="hello kity", photoUrls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ def test_set_param_validation(self):
+ try:
+ self.pet_api.find_pets_by_tags(["a", "a"])
+ except ValidationError as e:
+ self.assertTrue("the list has duplicated items" in str(e))
+
+ def test_required_param_validation(self):
+ try:
+ self.pet_api.get_pet_by_id() # type: ignore
+ except ValidationError as e:
+ self.assertIn("1 validation error for PetApi.get_pet_by_id", str(e))
+ self.assertIn("Missing required argument", str(e))
+
+ def test_integer_validation(self):
+ try:
+ self.pet_api.get_pet_by_id("123") # type: ignore
+ except ValidationError as e:
+ # 1 validation error for get_pet_by_id
+ # pet_id
+ # Input should be a valid integer [type=int_type, input_value='123', input_type=str]
+ # For further information visit https://errors.pydantic.dev/2.3/v/int_type
+ self.assertIn("1 validation error for PetApi.get_pet_by_id", str(e))
+ self.assertIn("Input should be a valid integer", str(e))
+
+ def test_string_enum_validation(self):
+ try:
+ self.pet_api.find_pets_by_status(["Cat"])
+ except ValidationError as e:
+ # 1 validation error for FindPetsByStatus
+ # status -> 0
+ # unexpected value; permitted: 'available', 'pending', 'sold' (type=value_error.const; given=Cat; permitted=('available', 'pending', 'sold'))
+ self.assertIn("1 validation error for FindPetsByStatus", str(e))
+ self.assertIn("unexpected value; permitted: 'available', 'pending', 'sold'", str(e))
+
+ def test_request_timeout_validation(self):
+ assert self.pet.id is not None
+ try:
+ # should be a number
+ self.pet_api.get_pet_by_id(self.pet.id, _request_timeout="1.0") # type: ignore
+ self.assertTrue(False)
+ except ValidationError as e:
+ pass
+ try:
+ # should be a number or a pair
+ self.pet_api.get_pet_by_id(self.pet.id, _request_timeout=()) # type: ignore
+ self.assertTrue(False)
+ except ValidationError as e:
+ pass
+ try:
+ # should be a a pair
+ self.pet_api.get_pet_by_id(self.pet.id, _request_timeout=(1.0, 1.0, 1.0)) # type: ignore
+ self.assertTrue(False)
+ except ValidationError as e:
+ pass
+
+
+ def test_host_index_validation(self):
+ assert self.pet.id is not None
+ try:
+ # should be a number
+ self.pet_api.get_pet_by_id(self.pet.id, _host_index="1") # type: ignore
+ self.assertTrue(False)
+ except ValidationError as e:
+ pass
+ try:
+ self.pet_api.get_pet_by_id(self.pet.id, _host_index=1)
+ self.assertTrue(False)
+ except ValidationError as e:
+ pass
+ try:
+ self.pet_api.get_pet_by_id(self.pet.id, _host_index=-1)
+ self.assertTrue(False)
+ except ValidationError as e:
+ pass
+
+
+ def checkRaiseRegex(self, expected_exception, expected_regex):
+ return self.assertRaisesRegex(expected_exception, expected_regex)
+
+ def checkRegex(self, text, expected_regex):
+ return self.assertRegex(text, expected_regex)
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_configuration.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_configuration.py
new file mode 100644
index 00000000000..af9fa6eef15
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_configuration.py
@@ -0,0 +1,101 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd petstore_api-python
+$ pytest
+"""
+from __future__ import absolute_import
+
+import unittest
+
+import petstore_api
+
+
+class TestConfiguration(unittest.TestCase):
+ """Animal unit test stubs"""
+
+ def setUp(self):
+ self.config = petstore_api.Configuration()
+
+ def tearDown(self):
+ # reset Configuration
+ petstore_api.Configuration.set_default(None)
+
+ def testConfiguration(self):
+ # check that different instances use different dictionaries
+ c1 = petstore_api.Configuration()
+ c2 = petstore_api.Configuration()
+ self.assertNotEqual(id(c1), id(c2))
+ self.assertNotEqual(id(c1.api_key), id(c2.api_key))
+ self.assertNotEqual(id(c1.api_key_prefix), id(c2.api_key_prefix))
+
+ def testDefaultConfiguration(self):
+ # prepare default configuration
+ c1 = petstore_api.Configuration(host="example.com")
+ c1.debug = True
+ petstore_api.Configuration.set_default(c1)
+
+ # get default configuration
+ c2 = petstore_api.Configuration.get_default_copy()
+ self.assertEqual(c2.host, "example.com")
+ self.assertTrue(c2.debug)
+
+ self.assertEqual(id(c1), id(c2))
+ self.assertEqual(id(c1.api_key), id(c2.api_key))
+ self.assertEqual(id(c1.api_key_prefix), id(c2.api_key_prefix))
+
+ def testApiClientDefaultConfiguration(self):
+ # ensure the default configuration is the same
+ p1 = petstore_api.PetApi()
+ p2 = petstore_api.PetApi()
+ self.assertEqual(id(p1.api_client.configuration), id(p2.api_client.configuration))
+
+ def testAccessTokenWhenConstructingConfiguration(self):
+ c1 = petstore_api.Configuration(access_token="12345")
+ self.assertEqual(c1.access_token, "12345")
+
+ def test_ignore_operation_servers(self):
+ self.config.ignore_operation_servers = True
+ self.assertTrue(self.config.ignore_operation_servers)
+ self.config.ignore_operation_servers = False
+ self.assertFalse(self.config.ignore_operation_servers)
+
+ c1 = petstore_api.Configuration(ignore_operation_servers=True)
+ self.assertTrue(c1.ignore_operation_servers)
+
+ c2 = petstore_api.Configuration()
+ self.assertFalse(c2.ignore_operation_servers)
+
+ def test_get_host_settings(self):
+ host_settings = self.config.get_host_settings()
+
+ self.assertEqual('http://{server}.swagger.io:{port}/v2', host_settings[0]['url'])
+ self.assertEqual('petstore', host_settings[0]['variables']['server']['default_value'])
+
+ self.assertEqual('https://localhost:8080/{version}', host_settings[1]['url'])
+ self.assertEqual('v2', host_settings[1]['variables']['version']['default_value'])
+
+ def test_get_host_from_settings(self):
+ """ Test get_host_from_settings
+
+ Test get URL from host settings
+ """
+ self.assertEqual("http://petstore.swagger.io:80/v2", self.config.get_host_from_settings(0))
+ self.assertEqual("http://petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'port': '8080'}))
+ self.assertEqual("http://dev-petstore.swagger.io:8080/v2", self.config.get_host_from_settings(0, {'server': 'dev-petstore', 'port': '8080'}))
+
+ def testConfigurationDebug(self):
+ for debug, expected in [(True, True), (False, False), (None, False)]:
+ with self.subTest('expicitly passing debug parameter', debug=debug, expected=expected):
+ c = petstore_api.Configuration(debug=debug)
+ self.assertEqual(expected, c.debug)
+ with self.subTest('not passing debug parameter'):
+ c = petstore_api.Configuration()
+ self.assertFalse(c.debug)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_deserialization.py
new file mode 100644
index 00000000000..a8ebc21126c
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_deserialization.py
@@ -0,0 +1,348 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd OpenAPIPetstore-python
+$ pytest
+"""
+from collections import namedtuple
+import json
+import os
+import time
+import unittest
+import datetime
+from decimal import Decimal
+
+import pytest as pytest
+
+import petstore_api
+
+
+class DeserializationTests(unittest.TestCase):
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.deserialize = self.api_client.deserialize
+
+ def test_enum_test(self):
+ """ deserialize Dict[str, EnumTest] """
+ data = {
+ 'enum_test': {
+ "enum_string": "UPPER",
+ "enum_string_required": "lower",
+ "enum_integer": 1,
+ "enum_number": 1.1,
+ "outerEnum": "placed"
+ }
+ }
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, 'Dict[str, EnumTest]', 'application/json')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest))
+ self.assertEqual(deserialized['enum_test'],
+ petstore_api.EnumTest(enum_string="UPPER",
+ enum_string_required="lower",
+ enum_integer=1,
+ enum_number=1.1,
+ outerEnum=petstore_api.OuterEnum.PLACED))
+
+ def test_deserialize_dict_str_pet(self):
+ """ deserialize Dict[str, Pet] """
+ data = {
+ 'pet': {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }
+ }
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, 'Dict[str, Pet]', 'application/json')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet))
+
+ @pytest.mark.skip(reason="skipping for now as deserialization will be refactored")
+ def test_deserialize_dict_str_dog(self):
+ """ deserialize Dict[str, Animal], use discriminator"""
+ data = {
+ 'dog': {
+ "id": 0,
+ "className": "Dog",
+ "color": "white",
+ "bread": "Jack Russel Terrier"
+ }
+ }
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, 'Dict[str, Animal]', 'application/json')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog))
+
+ @pytest.mark.skip(reason="skipping for now as deserialization will be refactored")
+ def test_deserialize_dict_str_int(self):
+ """ deserialize Dict[str, int] """
+ data = {
+ 'integer': 1
+ }
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, 'Dict[str, int]', 'application/json')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized['integer'], int))
+
+ def test_deserialize_str(self):
+ """ deserialize str """
+ data = "test str"
+ response = data=json.dumps(data)
+
+ deserialized = self.deserialize(response, "str", 'application/json')
+ self.assertTrue(isinstance(deserialized, str))
+
+ def test_deserialize_date(self):
+ """ deserialize date """
+ data = "1997-07-16"
+ response = data=json.dumps(data)
+
+ deserialized = self.deserialize(response, "date", 'application/json')
+ self.assertTrue(isinstance(deserialized, datetime.date))
+
+ def test_deserialize_datetime(self):
+ """ deserialize datetime """
+ data = "1997-07-16T19:20:30.45+01:00"
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "datetime", 'application/json')
+ self.assertTrue(isinstance(deserialized, datetime.datetime))
+
+ def test_deserialize_decimal(self):
+ """ deserialize decimal """
+ data = 1.1
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "decimal", 'application/json')
+ self.assertTrue(isinstance(deserialized, Decimal))
+ self.assertEqual(deserialized, Decimal(1.1))
+
+ def test_deserialize_pet(self):
+ """ deserialize pet """
+ data = {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "Pet", 'application/json')
+ self.assertTrue(isinstance(deserialized, petstore_api.Pet))
+ self.assertEqual(deserialized.id, 0)
+ self.assertEqual(deserialized.name, "doggie")
+ self.assertTrue(isinstance(deserialized.category, petstore_api.Category))
+ self.assertEqual(deserialized.category.name, "string")
+ self.assertTrue(isinstance(deserialized.tags, list))
+ self.assertEqual(deserialized.tags[0].name, "string")
+
+ def test_deserialize_list_of_pet(self):
+ """ deserialize list[Pet] """
+ data = [
+ {
+ "id": 0,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie0",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ },
+ {
+ "id": 1,
+ "category": {
+ "id": 0,
+ "name": "string"
+ },
+ "name": "doggie1",
+ "photoUrls": [
+ "string"
+ ],
+ "tags": [
+ {
+ "id": 0,
+ "name": "string"
+ }
+ ],
+ "status": "available"
+ }]
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "List[Pet]", 'application/json')
+ self.assertTrue(isinstance(deserialized, list))
+ self.assertTrue(isinstance(deserialized[0], petstore_api.Pet))
+ self.assertEqual(deserialized[0].id, 0)
+ self.assertEqual(deserialized[1].id, 1)
+ self.assertEqual(deserialized[0].name, "doggie0")
+ self.assertEqual(deserialized[1].name, "doggie1")
+
+ def test_deserialize_nested_dict(self):
+ """ deserialize Dict[str, Dict[str, int]] """
+ data = {
+ "foo": {
+ "bar": 1
+ }
+ }
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "Dict[str, Dict[str, int]]", 'application/json')
+ self.assertTrue(isinstance(deserialized, dict))
+ self.assertTrue(isinstance(deserialized["foo"], dict))
+ self.assertTrue(isinstance(deserialized["foo"]["bar"], int))
+
+ def test_deserialize_nested_list(self):
+ """ deserialize list[list[str]] """
+ data = [["foo"]]
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "List[List[str]]", 'application/json')
+ self.assertTrue(isinstance(deserialized, list))
+ self.assertTrue(isinstance(deserialized[0], list))
+ self.assertTrue(isinstance(deserialized[0][0], str))
+
+ def test_deserialize_none(self):
+ """ deserialize None """
+ response = json.dumps(None)
+
+ deserialized = self.deserialize(response, "datetime", 'application/json')
+ self.assertIsNone(deserialized)
+
+ def test_deserialize_pig(self):
+ """ deserialize pig (oneOf) """
+ data = {
+ "className": "BasqueBig",
+ "color": "white"
+ }
+
+ response = json.dumps(data)
+ deserialized = self.deserialize(response, "Pig", 'application/json')
+ self.assertTrue(isinstance(deserialized.actual_instance,
+ petstore_api.BasquePig))
+ self.assertEqual(deserialized.actual_instance.class_name, "BasqueBig")
+ self.assertEqual(deserialized.actual_instance.color, "white")
+
+ def test_deserialize_animal(self):
+ """ deserialize animal with discriminator mapping """
+ data = {
+ "declawed": True,
+ "className": "Cat2222" # incorrect class name
+ }
+
+ response = json.dumps(data)
+
+ with pytest.raises(ValueError) as ex:
+ deserialized = self.deserialize(response, "Animal", 'application/json')
+ assert str(
+ ex.value) == 'Animal failed to lookup discriminator value from {"declawed": true, "className": ' \
+ '"Cat2222"}. Discriminator property name: className, mapping: {"Cat": "Cat", "Dog": "Dog"}'
+
+ data = {
+ "declawed": True,
+ "className": "Cat" # correct class name
+ }
+
+ response = json.dumps(data)
+
+ deserialized = self.deserialize(response, "Animal", 'application/json')
+ self.assertTrue(isinstance(deserialized, petstore_api.Cat))
+ self.assertEqual(deserialized.class_name, "Cat")
+ self.assertEqual(deserialized.declawed, True)
+ self.assertEqual(deserialized.to_json(), '{"className": "Cat", "color": "red", "declawed": true}')
+
+ # test from json
+ json_str = '{"className": "Cat", "color": "red", "declawed": true}'
+
+ deserialized = petstore_api.Animal.from_json(json_str)
+
+ # the following is necessary for mypy as it does not handle isinstance() within self.assertTrue() well
+ if not isinstance(deserialized, petstore_api.Cat):
+ self.assertTrue(False)
+ return
+
+ self.assertEqual(deserialized.class_name, "Cat")
+ self.assertEqual(deserialized.declawed, True)
+ self.assertEqual(deserialized.to_json(), '{"className": "Cat", "color": "red", "declawed": true}')
+
+ def test_deserialize_content_type(self):
+
+ response = json.dumps({"a": "a"})
+
+ deserialized = self.deserialize(response, "Dict[str, str]", 'application/json')
+ self.assertTrue(isinstance(deserialized, dict))
+
+
+ deserialized = self.deserialize(response, "Dict[str, str]", 'application/vnd.api+json')
+ self.assertTrue(isinstance(deserialized, dict))
+
+
+ deserialized = self.deserialize(response, "Dict[str, str]", 'application/json; charset=utf-8')
+ self.assertTrue(isinstance(deserialized, dict))
+
+ deserialized = self.deserialize(response, "Dict[str, str]", 'application/vnd.api+json; charset=utf-8')
+ self.assertTrue(isinstance(deserialized, dict))
+
+ deserialized = self.deserialize(response, "str", 'text/plain')
+ self.assertTrue(isinstance(deserialized, str))
+
+ deserialized = self.deserialize(response, "str", 'text/csv')
+ self.assertTrue(isinstance(deserialized, str))
+
+ deserialized = self.deserialize(response, "Dict[str, str]", 'APPLICATION/JSON')
+ self.assertTrue(isinstance(deserialized, dict))
+
+ with self.assertRaises(petstore_api.ApiException) as cm:
+ deserialized = self.deserialize(response, "str", 'text')
+
+ with self.assertRaises(petstore_api.ApiException) as cm:
+ deserialized = self.deserialize(response, "str", 'text/n0t-exist!ng')
+
+ with self.assertRaises(petstore_api.ApiException) as cm:
+ deserialized = self.deserialize(response, "Dict[str, str]", 'application/jsonnnnn')
+
+ with self.assertRaises(petstore_api.ApiException) as cm:
+ deserialized = self.deserialize(response, "Dict[str, str]", 'application/<+json')
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_fake_api.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_fake_api.py
new file mode 100644
index 00000000000..eade99256c5
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_fake_api.py
@@ -0,0 +1,242 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd petstore_api-python
+$ pytest
+"""
+from __future__ import absolute_import
+
+import unittest
+
+import unittest
+from unittest.mock import patch, Mock
+import petstore_api
+from petstore_api import OuterObjectWithEnumProperty, OuterEnumInteger
+
+
+class TestFakeApi(unittest.TestCase):
+ """StrLikeJson unit test stubs"""
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.fake_api = petstore_api.FakeApi(self.api_client)
+
+ def testReturnString(self):
+ """Test ReturnString"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'string'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_string()
+ self.assertEqual("string", returned)
+
+ def testReturnInt(self):
+ """Test ReturnInt"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'1'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_int()
+ self.assertEqual(1, returned)
+
+ def testReturnFloat(self):
+ """Test ReturnFloat"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'3.4'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_float()
+ self.assertEqual(3.4, returned)
+
+ def testReturnBoolean(self):
+ """Test ReturnBool"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'true'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_boolean()
+ self.assertEqual(True, returned)
+
+ def testReturnEnum(self):
+ """Test ReturnEnum"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'a'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_enum()
+ self.assertEqual("a", returned)
+
+ def testStrLikeJson(self):
+ """Test StrLikeJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'{"a": "a"}'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_str_like_json()
+ self.assertEqual('{"a": "a"}', returned)
+
+ def testEnumLikeJson(self):
+ """Test EnumLikeJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'{"a": "a"}'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_enum_like_json()
+ self.assertEqual('{"a": "a"}', returned)
+
+ def testByteLikeJson(self):
+ """Test ByteLikeJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'{"a": "a"}'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "text/plain" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_byte_like_json()
+ self.assertEqual(b'{"a": "a"}', returned)
+
+ def testIntEnumReturnsValue(self):
+ """
+ Fixes #18327 (https://github.com/OpenAPITools/openapi-generator/issues/18327)
+ The enum value should be used in the param and not the enum name
+ """
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'{"value": "0"}'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ) as call_api_mock:
+ self.fake_api.fake_property_enum_integer_serialize(
+ outer_object_with_enum_property=OuterObjectWithEnumProperty(value=OuterEnumInteger.NUMBER_0),
+ param=[OuterEnumInteger.NUMBER_0])
+ self.assertEqual(call_api_mock.call_args[0][1],
+ 'http://petstore.swagger.io:80/v2/fake/property/enum-int?param=0')
+
+ def testTopLevelStrJson(self):
+ """Test TopLevelStrJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'"a"'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_string()
+ self.assertEqual('a', returned)
+
+ def testTopLevelIntJson(self):
+ """Test TopLevelIntJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'1'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_int()
+ self.assertEqual(1, returned)
+
+ def testTopLevelFloatJson(self):
+ """Test TopLevelFloatJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'3.4'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_float()
+ self.assertEqual(3.4, returned)
+
+ def testTopLevelBoolJson(self):
+ """Test TopLevelBoolJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'true'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_boolean()
+ self.assertEqual(True, returned)
+
+ def testTopLevelEnumJson(self):
+ """Test TopLevelEnumJson"""
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'"a"'
+ mock_resp.getheaders.return_value = {}
+ mock_resp.getheader = (
+ lambda name: "application/json" if name == "content-type" else Mock()
+ )
+ with patch(
+ "petstore_api.api_client.ApiClient.call_api", return_value=mock_resp
+ ):
+ returned = self.fake_api.fake_return_enum()
+ self.assertEqual("a", returned)
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py
new file mode 100644
index 00000000000..1d5f05abb46
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py
@@ -0,0 +1,537 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ docker pull swaggerapi/petstore
+$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
+$ cd petstore_api-python
+$ pytest
+"""
+
+from collections import namedtuple
+from datetime import datetime, timedelta
+import base64
+import json
+import os
+import re
+import shutil
+from typing import Union
+import unittest
+from urllib.parse import urlencode, urlparse
+
+from Crypto.Hash import SHA256, SHA512
+from Crypto.PublicKey import ECC, RSA
+from Crypto.Hash.SHA512 import SHA512Hash
+from Crypto.Hash.SHA256 import SHA256Hash
+from Crypto.Signature import pkcs1_15, pss, DSS
+
+import petstore_api
+#from petstore_api.models import Category, Tag, Pet
+from petstore_api.api.pet_api import PetApi
+from petstore_api import Configuration, signing
+from petstore_api.rest import (
+ RESTClientObject,
+ RESTResponse
+)
+
+from petstore_api.exceptions import (
+ ApiException,
+ ApiValueError,
+ ApiTypeError,
+)
+
+from .util import id_gen
+
+import urllib3
+
+from unittest.mock import patch
+
+HOST = 'http://localhost/v2'
+
+# This test RSA private key below is published in Appendix C 'Test Values' of
+# https://www.ietf.org/id/draft-cavage-http-signatures-12.txt
+RSA_TEST_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
+NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
+UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
+AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
+QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
+kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
+f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
+412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
+mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
+kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
+gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
+G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
+7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
+-----END RSA PRIVATE KEY-----"""
+
+
+class TimeoutWithEqual(urllib3.Timeout):
+ def __init__(self, *arg, **kwargs):
+ super(TimeoutWithEqual, self).__init__(*arg, **kwargs)
+
+ def __eq__(self, other):
+ return self._read == other._read and self._connect == other._connect and self.total == other.total
+
+class MockPoolManager(urllib3.PoolManager):
+ def __init__(self, tc):
+ self._tc = tc
+ self._reqs = []
+
+ def expect_request(self, *args, **kwargs):
+ self._reqs.append((args, kwargs))
+
+ def set_signing_config(self, signing_cfg):
+ self.signing_cfg = signing_cfg
+ assert self.signing_cfg is not None
+ self.pubkey = self.signing_cfg.get_public_key()
+ assert self.pubkey is not None
+
+ def request(self, *actual_request_target, **actual_request_headers_and_body):
+ self._tc.assertTrue(len(self._reqs) > 0)
+ expected_results = self._reqs.pop(0)
+ self._tc.maxDiff = None
+ expected_request_target = expected_results[0] # The expected HTTP method and URL path.
+ expected_request_headers_and_body = expected_results[1] # dict that contains the expected body, headers
+ self._tc.assertEqual(expected_request_target, actual_request_target)
+ # actual_request_headers_and_body is a dict that contains the actual body, headers
+ for k, expected in expected_request_headers_and_body.items():
+ self._tc.assertIn(k, actual_request_headers_and_body)
+ if k == 'body':
+ actual_body = actual_request_headers_and_body[k]
+ self._tc.assertEqual(expected, actual_body)
+ elif k == 'headers':
+ actual_headers = actual_request_headers_and_body[k]
+ for expected_header_name, expected_header_value in expected.items():
+ # Validate the generated request contains the expected header.
+ self._tc.assertIn(expected_header_name, actual_headers)
+ actual_header_value = actual_headers[expected_header_name]
+ # Compare the actual value of the header against the expected value.
+ pattern = re.compile(expected_header_value)
+ m = pattern.match(actual_header_value)
+ self._tc.assertTrue(m, msg="Expected:\n{0}\nActual:\n{1}".format(
+ expected_header_value,actual_header_value))
+ if expected_header_name == 'Authorization':
+ self._validate_authorization_header(
+ expected_request_target, actual_headers, actual_header_value)
+ elif k == 'timeout':
+ self._tc.assertEqual(expected, actual_request_headers_and_body[k])
+ return urllib3.HTTPResponse(status=200, body=b'test')
+
+ def _validate_authorization_header(self, request_target, actual_headers, authorization_header):
+ """Validate the signature.
+ """
+ # Extract (created)
+ r1 = re.compile(r'created=([0-9]+)')
+ m1 = r1.search(authorization_header)
+ assert m1 is not None
+ created = m1.group(1)
+
+ # Extract list of signed headers
+ r1 = re.compile(r'headers="([^"]+)"')
+ m1 = r1.search(authorization_header)
+ assert m1 is not None
+ headers = m1.group(1).split(' ')
+ signed_headers_list = []
+ for h in headers:
+ if h == '(created)':
+ signed_headers_list.append((h, created))
+ elif h == '(request-target)':
+ url = request_target[1]
+ target_path = urlparse(url).path
+ signed_headers_list.append((h, "{0} {1}".format(request_target[0].lower(), target_path)))
+ else:
+ value = next((v for k, v in actual_headers.items() if k.lower() == h), None)
+ assert value is not None
+ signed_headers_list.append((h, value))
+ header_items = [
+ "{0}: {1}".format(key.lower(), value) for key, value in signed_headers_list]
+ string_to_sign = "\n".join(header_items)
+ digest: Union[SHA512Hash, SHA256Hash]
+ if self.signing_cfg.hash_algorithm == signing.HASH_SHA512:
+ digest = SHA512.new()
+ elif self.signing_cfg.hash_algorithm == signing.HASH_SHA256:
+ digest = SHA256.new()
+ else:
+ self._tc.fail("Unsupported hash algorithm: {0}".format(self.signing_cfg.hash_algorithm))
+
+ digest.update(string_to_sign.encode())
+ b64_body_digest = base64.b64encode(digest.digest()).decode()
+
+ # Extract the signature
+ r2 = re.compile(r'signature="([^"]+)"')
+ m2 = r2.search(authorization_header)
+ assert m2 is not None
+ b64_signature = m2.group(1)
+ signature = base64.b64decode(b64_signature)
+ # Build the message
+ signing_alg = self.signing_cfg.signing_algorithm
+ if signing_alg is None:
+ # Determine default
+ if isinstance(self.pubkey, RSA.RsaKey):
+ signing_alg = signing.ALGORITHM_RSASSA_PSS
+ elif isinstance(self.pubkey, ECC.EccKey):
+ signing_alg = signing.ALGORITHM_ECDSA_MODE_FIPS_186_3
+ else:
+ self._tc.fail("Unsupported key: {0}".format(type(self.pubkey)))
+
+ if signing_alg == signing.ALGORITHM_RSASSA_PKCS1v15:
+ pkcs1_15.new(self.pubkey).verify(digest, signature)
+ elif signing_alg == signing.ALGORITHM_RSASSA_PSS:
+ pss.new(self.pubkey).verify(digest, signature)
+ elif signing_alg == signing.ALGORITHM_ECDSA_MODE_FIPS_186_3:
+ verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
+ encoding='der')
+ verifier.verify(digest, signature)
+ elif signing_alg == signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979:
+ verifier = DSS.new(key=self.pubkey, mode=signing.ALGORITHM_ECDSA_MODE_DETERMINISTIC_RFC6979,
+ encoding='der')
+ verifier.verify(digest, signature)
+ else:
+ self._tc.fail("Unsupported signing algorithm: {0}".format(signing_alg))
+
+class PetApiTests(unittest.TestCase):
+ rsa_key_path: str
+ rsa4096_key_path: str
+ ec_p521_key_path: str
+ pet: petstore_api.Pet
+ test_file_dir: str
+ private_key_passphrase: str
+
+ @classmethod
+ def setUpClass(cls):
+ cls.setUpModels()
+ cls.setUpFiles()
+
+ @classmethod
+ def tearDownClass(cls):
+ file_paths = [
+ cls.rsa_key_path,
+ cls.rsa4096_key_path,
+ cls.ec_p521_key_path,
+ ]
+ for file_path in file_paths:
+ os.unlink(file_path)
+
+ @classmethod
+ def setUpModels(cls):
+ category = petstore_api.Category(name="dog")
+ category.id = id_gen()
+ tag = petstore_api.Tag()
+ tag.id = id_gen()
+ tag.name = "python-pet-tag"
+ cls.pet = petstore_api.Pet(
+ name="hello kity",
+ photoUrls=["http://foo.bar.com/1", "http://foo.bar.com/2"]
+ )
+ cls.pet.id = id_gen()
+ cls.pet.status = "sold"
+ cls.pet.category = category
+ cls.pet.tags = [tag]
+
+ @classmethod
+ def setUpFiles(cls):
+ cls.test_file_dir = os.path.join(
+ os.path.dirname(__file__), "..", "testfiles")
+ cls.test_file_dir = os.path.realpath(cls.test_file_dir)
+ if not os.path.exists(cls.test_file_dir):
+ os.mkdir(cls.test_file_dir)
+
+ cls.private_key_passphrase = 'test-passphrase'
+ cls.rsa_key_path = os.path.join(cls.test_file_dir, 'rsa.pem')
+ cls.rsa4096_key_path = os.path.join(cls.test_file_dir, 'rsa4096.pem')
+ cls.ec_p521_key_path = os.path.join(cls.test_file_dir, 'ecP521.pem')
+
+ if not os.path.exists(cls.rsa_key_path):
+ with open(cls.rsa_key_path, 'w') as f:
+ f.write(RSA_TEST_PRIVATE_KEY)
+
+ key: Union[RSA.RsaKey, ECC.EccKey]
+
+ if not os.path.exists(cls.rsa4096_key_path):
+ key = RSA.generate(4096)
+ private_key = key.export_key(
+ passphrase=cls.private_key_passphrase,
+ protection='PEM'
+ )
+ with open(cls.rsa4096_key_path, "wb") as f:
+ f.write(private_key)
+
+ if not os.path.exists(cls.ec_p521_key_path):
+ key = ECC.generate(curve='P-521')
+ pkey = key.export_key(
+ format='PEM',
+ passphrase=cls.private_key_passphrase,
+ use_pkcs8=True,
+ protection='PBKDF2WithHMAC-SHA1AndAES128-CBC'
+ )
+ if isinstance(pkey, str):
+ private_key = pkey.encode("ascii")
+ else:
+ private_key = pkey
+ with open(cls.ec_p521_key_path, "wb") as f:
+ f.write(private_key)
+
+ def test_valid_http_signature(self):
+ privkey_path = self.rsa_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ signing.HEADER_HOST,
+ signing.HEADER_DATE,
+ signing.HEADER_DIGEST,
+ 'Content-Type'
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\) host date digest content-type",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_with_defaults(self):
+ privkey_path = self.rsa4096_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_rsassa_pkcs1v15(self):
+ privkey_path = self.rsa4096_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ signing_algorithm=signing.ALGORITHM_RSASSA_PKCS1v15,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_rsassa_pss(self):
+ privkey_path = self.rsa4096_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ signing_algorithm=signing.ALGORITHM_RSASSA_PSS,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_valid_http_signature_ec_p521(self):
+ privkey_path = self.ec_p521_key_path
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=privkey_path,
+ private_key_passphrase=self.private_key_passphrase,
+ hash_algorithm=signing.HASH_SHA512,
+ signed_headers=[
+ signing.HEADER_REQUEST_TARGET,
+ signing.HEADER_CREATED,
+ ]
+ )
+ config = Configuration(host=HOST, signing_info=signing_cfg)
+ # Set the OAuth2 access_token to None. Here we are interested in testing
+ # the HTTP signature scheme.
+ config.access_token = None
+
+ api_client = petstore_api.ApiClient(config)
+ pet_api = PetApi(api_client)
+
+ mock_pool = MockPoolManager(self)
+ api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.set_signing_config(signing_cfg)
+ mock_pool.expect_request('POST', HOST + '/pet',
+ #body=json.dumps(api_client.sanitize_for_serialization(self.pet)),
+ body=self.pet.to_json(),
+ headers={'Content-Type': r'application/json',
+ 'Authorization': r'Signature keyId="my-key-id",algorithm="hs2019",created=[0-9]+,'
+ r'headers="\(request-target\) \(created\)",'
+ r'signature="[a-zA-Z0-9+/=]+"',
+ 'User-Agent': r'OpenAPI-Generator/1.0.0/python'},
+ preload_content=True, timeout=None)
+
+ pet_api.add_pet(self.pet)
+
+ def test_invalid_configuration(self):
+ # Signing scheme must be valid.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme='foo',
+ private_key_path=self.ec_p521_key_path
+ )
+ self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Signing scheme must be specified.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ private_key_path=self.ec_p521_key_path,
+ signing_scheme=None # type: ignore
+ )
+ self.assertTrue(re.match('Unsupported security scheme', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Private key passphrase is missing but key is encrypted.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ )
+ self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # File containing private key must exist.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path='foobar',
+ )
+ self.assertTrue(re.match('Private key file does not exist', str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # The max validity must be a positive value.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ signature_max_validity=timedelta(hours=-1)
+ )
+ self.assertTrue(re.match('The signature max validity must be a positive value',
+ str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Cannot include the 'Authorization' header.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ signed_headers=['Authorization']
+ )
+ self.assertTrue(re.match("'Authorization' header cannot be included", str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
+ # Cannot specify duplicate headers.
+ with self.assertRaises(Exception) as cm:
+ signing_cfg = signing.HttpSigningConfiguration(
+ key_id="my-key-id",
+ signing_scheme=signing.SCHEME_HS2019,
+ private_key_path=self.ec_p521_key_path,
+ signed_headers=['Host', 'Date', 'Host']
+ )
+ self.assertTrue(re.match('Cannot have duplicates in the signed_headers parameter',
+ str(cm.exception)),
+ 'Exception message: {0}'.format(str(cm.exception)))
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_map_test.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_map_test.py
new file mode 100644
index 00000000000..8c0cb48f432
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_map_test.py
@@ -0,0 +1,117 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd petstore_api-python
+$ pytest
+"""
+
+import os
+import time
+import unittest
+
+import petstore_api
+
+
+class MapTestTests(unittest.TestCase):
+
+ def test_maptest_init(self):
+ #
+ # Test MapTest construction with valid values
+ #
+ up_or_low_dict = {
+ 'UPPER': "UP",
+ 'lower': "low"
+ }
+# map_enum_test = petstore_api.MapTest(map_of_enum_string=up_or_low_dict)
+#
+# self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+#
+# map_of_map_of_strings = {
+# 'val1': 1,
+# 'valText': "Text",
+# 'valueDict': up_or_low_dict
+# }
+# map_enum_test = petstore_api.MapTest(map_map_of_string=map_of_map_of_strings)
+#
+# self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
+#
+# #
+# # Make sure that the init fails for invalid enum values
+# #
+# black_or_white_dict = {
+# 'black': "UP",
+# 'white': "low"
+# }
+# try:
+# map_enum_test = petstore_api.MapTest(map_of_enum_string=black_or_white_dict)
+# self.assertTrue(0)
+# except ValueError:
+# self.assertTrue(1)
+#
+# def test_maptest_setter(self):
+# #
+# # Check with some valid values
+# #
+# map_enum_test = petstore_api.MapTest()
+# up_or_low_dict = {
+# 'UPPER': "UP",
+# 'lower': "low"
+# }
+# map_enum_test.map_of_enum_string = up_or_low_dict
+# self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+#
+# #
+# # Check if the setter fails for invalid enum values
+# #
+# map_enum_test = petstore_api.MapTest()
+# black_or_white_dict = {
+# 'black': "UP",
+# 'white': "low"
+# }
+# try:
+# map_enum_test.map_of_enum_string = black_or_white_dict
+# except ValueError:
+# self.assertEqual(map_enum_test.map_of_enum_string, None)
+#
+# def test_todict(self):
+# #
+# # Check dictionary serialization
+# #
+# map_enum_test = petstore_api.MapTest()
+# up_or_low_dict = {
+# 'UPPER': "UP",
+# 'lower': "low"
+# }
+# map_of_map_of_strings = {
+# 'val1': 1,
+# 'valText': "Text",
+# 'valueDict': up_or_low_dict
+# }
+# indirect_map = {
+# 'option1': True
+# }
+# direct_map = {
+# 'option2': False
+# }
+# map_enum_test.map_of_enum_string = up_or_low_dict
+# map_enum_test.map_map_of_string = map_of_map_of_strings
+# map_enum_test.indirect_map = indirect_map
+# map_enum_test.direct_map = direct_map
+#
+# self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict)
+# self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings)
+# self.assertEqual(map_enum_test.indirect_map, indirect_map)
+# self.assertEqual(map_enum_test.direct_map, direct_map)
+#
+# expected_dict = {
+# 'map_of_enum_string': up_or_low_dict,
+# 'map_map_of_string': map_of_map_of_strings,
+# 'indirect_map': indirect_map,
+# 'direct_map': direct_map
+# }
+#
+# self.assertEqual(map_enum_test.to_dict(), expected_dict)
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_model.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_model.py
new file mode 100644
index 00000000000..6049def8b88
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_model.py
@@ -0,0 +1,684 @@
+# coding: utf-8
+
+# flake8: noqa
+
+from datetime import date
+import json
+import os
+import time
+import unittest
+
+from pydantic import ValidationError, SecretStr, BaseModel, StrictStr, Field
+import pytest
+
+import petstore_api
+from petstore_api import InnerDictWithProperty
+
+
+class ModelTests(unittest.TestCase):
+
+ def setUp(self):
+ self.pet = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet.id = 1
+ self.pet.status = "available"
+ cate = petstore_api.Category(name="dog")
+ cate.id = 1
+ cate.name = "dog"
+ self.pet.category = cate
+ tag = petstore_api.Tag()
+ tag.id = 1
+ self.pet.tags = [tag]
+
+ def test_cat(self):
+ self.cat = petstore_api.Cat(className="cat")
+ self.assertEqual("cat", self.cat.class_name)
+ self.assertEqual("red", self.cat.color)
+ cat_str = ("{'additional_properties': {},\n"
+ " 'className': 'cat',\n"
+ " 'color': 'red',\n"
+ " 'declawed': None}")
+ self.assertEqual(cat_str, self.cat.to_str())
+
+ def test_to_str(self):
+ data = ("{'additional_properties': {},\n"
+ " 'category': {'additional_properties': {}, 'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photoUrls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'additional_properties': {}, 'id': 1, 'name': None}]}")
+ self.assertEqual(data, self.pet.to_str())
+
+ def test_equal(self):
+ self.pet1 = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet1.id = 1
+ self.pet1.status = "available"
+ cate1 = petstore_api.Category(name="dog")
+ cate1.id = 1
+ # cate1.name = "dog"
+ self.pet.category = cate1
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ self.pet1.tags = [tag1]
+
+ self.pet2 = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet2.id = 1
+ self.pet2.status = "available"
+ cate2 = petstore_api.Category(name="dog")
+ cate2.id = 1
+ cate2.name = "dog"
+ self.pet.category = cate2
+ tag2 = petstore_api.Tag()
+ tag2.id = 1
+ self.pet2.tags = [tag2]
+
+ self.assertTrue(self.pet1 == self.pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ self.pet1.tags = []
+ self.assertFalse(self.pet1 == self.pet2)
+
+ def test_oneof_schema_2_validator(self):
+ new_color = petstore_api.Color()
+ array_of_integers = [12, 34, 56]
+
+ try:
+ new_color.oneof_schema_2_validator = array_of_integers
+ self.fail(f"Should have failed: {new_color.oneof_schema_2_validator}")
+ except ValueError as e:
+ self.assertTrue("List should have at least 4 items after validation, not 3" in str(e))
+
+ def test_oneOf_array_of_integers(self):
+ # test new Color
+ new_color = petstore_api.Color()
+ self.assertEqual("null", new_color.to_json())
+ self.assertEqual(None, new_color.actual_instance)
+
+ # test the oneof schema validator
+ json_str = '[12,34,56]'
+ array_of_integers = json.loads(json_str)
+ # no error should be thrown
+ new_color.oneof_schema_1_validator = array_of_integers
+ new_color.actual_instance = array_of_integers
+ new_color.actual_instance = None
+
+ # test the oneof schema validator with invalid input
+ json_str = '[12,34,56120938]'
+ array_of_integers = json.loads(json_str)
+ try:
+ new_color.oneof_schema_1_validator = array_of_integers
+ except ValueError as e:
+ self.assertTrue("Input should be less than or equal to 255" in str(e))
+
+ try:
+ new_color.actual_instance = array_of_integers
+ except ValueError as e:
+ self.assertTrue("Input should be less than or equal to 255" in str(e))
+
+ # test from_josn
+ json_str = '[12,34,56]'
+ p = petstore_api.Color.from_json(json_str)
+ self.assertEqual(p.actual_instance, [12, 34, 56])
+
+ try:
+ p = petstore_api.Color.from_json('[2342112,0,0,0]')
+ except ValueError as e:
+ self.assertTrue("Input should be less than or equal to 255" in str(e))
+
+ # test to_json, to_dict method
+ json_str = '[12,34,56]'
+ p = petstore_api.Color.from_json(json_str)
+ self.assertEqual(p.to_json(), "[12, 34, 56]")
+ self.assertEqual(p.to_dict(), [12, 34, 56])
+
+ # test nullable
+ p = petstore_api.Color.from_json(None)
+ self.assertEqual(p.actual_instance, None)
+
+ def test_oneof_enum_string_from_json(self):
+ # test from_json
+ oneof_enum = petstore_api.OneOfEnumString.from_json('"a"')
+
+ def test_oneof_nested_from_enum_string(self):
+ # test from_dict
+ oneof_enum = petstore_api.OneOfEnumString.from_dict("a")
+ assert oneof_enum is not None
+ nested = petstore_api.WithNestedOneOf(size = 1, nested_oneof_enum_string = oneof_enum)
+ # test to_json
+ self.assertEqual(nested.to_json(), '{"size": 1, "nested_oneof_enum_string": "a"}')
+
+ def test_oneof_nested_from_json(self):
+ nested = petstore_api.WithNestedOneOf.from_json('{"size": 1, "nested_oneof_enum_string": "c"}')
+ assert nested is not None
+ self.assertEqual(nested.to_json(), '{"size": 1, "nested_oneof_enum_string": "c"}')
+
+ def test_oneof_nested_from_dict(self):
+ nested = petstore_api.WithNestedOneOf.from_dict({"size": 1, "nested_oneof_enum_string": "c"})
+ assert nested is not None
+ # test to_dict
+ self.assertEqual(nested.to_dict(), {"size": 1, "nested_oneof_enum_string": "c"})
+
+ def test_oneof_nested_from_json_invalid(self):
+ try:
+ nested2 = petstore_api.WithNestedOneOf.from_json('{"size": 1, "nested_oneof_enum_string": "e"}')
+ except ValueError as e:
+ self.assertTrue("'e' is not a valid EnumString1, 'e' is not a valid EnumString" in str(e))
+
+ def test_oneof_enum_string(self):
+ # test the constructor
+ enum_string1 = petstore_api.EnumString1('a')
+ constructor1 = petstore_api.OneOfEnumString(actual_instance=enum_string1)
+ self.assertEqual(constructor1.actual_instance, enum_string1)
+ constructor2 = petstore_api.OneOfEnumString(enum_string1)
+ self.assertEqual(constructor2.actual_instance, enum_string1)
+ constructor3 = petstore_api.OneOfEnumString()
+ self.assertEqual(constructor3.actual_instance, None)
+
+ def test_anyOf_array_of_integers(self):
+ # test new Color
+ new_color = petstore_api.AnyOfColor()
+ self.assertEqual("null", new_color.to_json())
+ self.assertEqual(None, new_color.actual_instance)
+
+ # test the oneof schema validator
+ json_str = '[12,34,56]'
+ array_of_integers = json.loads(json_str)
+ # no error should be thrown
+ new_color.anyof_schema_1_validator = array_of_integers
+ new_color.actual_instance = array_of_integers
+
+ # test the oneof schema validator with invalid input
+ json_str = '[12,34,56120938]'
+ array_of_integers = json.loads(json_str)
+ try:
+ new_color.anyof_schema_1_validator = array_of_integers
+ except ValueError as e:
+ self.assertIn("Input should be less than or equal to 255", str(e))
+
+ try:
+ new_color.actual_instance = array_of_integers
+ except ValueError as e:
+ self.assertIn("Input should be less than or equal to 255", str(e))
+
+ # test from_josn
+ json_str = '[12,34,56]'
+ p = petstore_api.AnyOfColor.from_json(json_str)
+ self.assertEqual(p.actual_instance, [12, 34,56])
+
+ try:
+ p = petstore_api.AnyOfColor.from_json('[2342112,0,0,0]')
+ except ValueError as e:
+ self.assertIn("Input should be less than or equal to 255", str(e))
+
+ def test_oneOf(self):
+ # test new Pig
+ bp = petstore_api.BasquePig.from_dict({"className": "BasquePig", "color": "red"})
+ new_pig = petstore_api.Pig()
+ self.assertEqual("null", new_pig.to_json())
+ self.assertEqual(None, new_pig.actual_instance)
+ new_pig2 = petstore_api.Pig(actual_instance=bp)
+ self.assertEqual('{"className": "BasquePig", "color": "red"}', new_pig2.to_json())
+ new_pig3 = petstore_api.Pig(bp)
+ self.assertEqual('{"className": "BasquePig", "color": "red"}', new_pig3.to_json())
+ try:
+ new_pig4 = petstore_api.Pig(bp, actual_instance=bp)
+ except ValueError as e:
+ self.assertTrue("If position argument is used, keyword argument cannot be used.", str(e))
+ try:
+ new_pig5 = petstore_api.Pig(bp, bp)
+ except ValueError as e:
+ self.assertTrue("If position argument is used, only 1 is allowed to set `actual_instance`", str(e))
+
+ # test from_json
+ json_str = '{"className": "BasquePig", "color": "red"}'
+ p = petstore_api.Pig.from_json(json_str)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test from_dict
+ json_dict = {"className": "BasquePig", "color": "red"}
+ p = petstore_api.Pig.from_dict(json_dict)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test init
+ basque_pig = p.actual_instance
+ pig2 = petstore_api.Pig(actual_instance=basque_pig)
+ self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
+
+ # test failed init
+ try:
+ pig3 = petstore_api.Pig(actual_instance="123")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ # pydantic_core._pydantic_core.ValidationError: 2 validation errors for Pig
+ # actual_instance.BasquePig
+ # Input should be a valid dictionary or instance of BasquePig [type=model_type, input_value='123', input_type=str]
+ # For further information visit https://errors.pydantic.dev/2.3/v/model_type
+ # actual_instance.DanishPig
+ # Input should be a valid dictionary or instance of DanishPig [type=model_type, input_value='123', input_type=str]
+ # For further information visit https://errors.pydantic.dev/2.3/v/model_type
+ self.assertIn("or instance of BasquePig", str(e))
+ self.assertIn("or instance of DanishPig", str(e))
+
+ # failure
+ try:
+ p2 = petstore_api.Pig.from_json("1")
+ self.assertTrue(False) # this line shouldn't execute
+ except AttributeError as e:
+ self.assertEqual(str(e), "'int' object has no attribute 'get'")
+ # comment out below as the error message is different using oneOf discriminator lookup option
+ #except ValueError as e:
+ # error_message = (
+ # "No match found when deserializing the JSON string into Pig with oneOf schemas: BasquePig, DanishPig. "
+ # "Details: 1 validation error for BasquePig\n"
+ # "__root__\n"
+ # " BasquePig expected dict not int (type=type_error), 1 validation error for DanishPig\n"
+ # "__root__\n"
+ # " DanishPig expected dict not int (type=type_error)")
+ # self.assertEqual(str(e), error_message)
+
+ # test to_json
+ self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
+
+ # test nested property
+ nested = petstore_api.WithNestedOneOf(size = 1, nested_pig = p)
+ self.assertEqual(nested.to_json(), '{"size": 1, "nested_pig": {"className": "BasquePig", "color": "red"}}')
+
+ nested_json = nested.to_json()
+ nested2 = petstore_api.WithNestedOneOf.from_json(nested_json)
+ assert nested2 is not None
+ self.assertEqual(nested2.to_json(), nested_json)
+
+ def test_anyOf(self):
+ # test new AnyOfPig
+ new_anypig = petstore_api.AnyOfPig()
+ self.assertEqual("null", new_anypig.to_json())
+ self.assertEqual(None, new_anypig.actual_instance)
+
+ # test from_json
+ json_str = '{"className": "BasquePig", "color": "red"}'
+ p = petstore_api.AnyOfPig.from_json(json_str)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test from_dict
+ json_dict = {"className": "BasquePig", "color": "red"}
+ p = petstore_api.AnyOfPig.from_dict(json_dict)
+ self.assertIsInstance(p.actual_instance, petstore_api.BasquePig)
+
+ # test init
+ basque_pig = p.actual_instance
+ pig2 = petstore_api.AnyOfPig(actual_instance=basque_pig)
+ self.assertIsInstance(pig2.actual_instance, petstore_api.BasquePig)
+
+ # test failed init
+ try:
+ pig3 = petstore_api.AnyOfPig(actual_instance="123")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ # pydantic_core._pydantic_core.ValidationError: 1 validation error for AnyOfPig
+ # actual_instance
+ # Value error, No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, DanishPig. Details: Error! Input type `` is not `BasquePig`, Error! Input type `` is not `DanishPig` [type=value_error, input_value='123', input_type=str]
+ # For further information visit https://errors.pydantic.dev/2.4/v/value_error
+ self.assertIn("No match found when setting the actual_instance in AnyOfPig with anyOf schemas: BasquePig, DanishPig.", str(e))
+ self.assertIn("Input type `` is not `BasquePig`", str(e))
+ self.assertIn("Input type `` is not `DanishPig`", str(e))
+
+ # failure
+ try:
+ p2 = petstore_api.AnyOfPig.from_json("1")
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertIn("No match found when deserializing the JSON string into AnyOfPig with anyOf schemas: BasquePig, DanishPig", str(e))
+
+ # test to_json
+ self.assertEqual(p.to_json(), '{"className": "BasquePig", "color": "red"}')
+
+ def test_inheritance(self):
+ dog = petstore_api.Dog(breed="bulldog", className="dog", color="white")
+ self.assertEqual(dog.to_json(), '{"className": "dog", "color": "white", "breed": "bulldog"}')
+ self.assertEqual(dog.to_dict(), {'breed': 'bulldog', 'className':
+ 'dog', 'color': 'white'})
+ dog2 = petstore_api.Dog.from_json(dog.to_json())
+ assert dog2 is not None
+ self.assertEqual(dog2.breed, 'bulldog')
+ self.assertEqual(dog2.class_name, "dog")
+ self.assertEqual(dog2.color, 'white')
+
+ def test_inheritance_discriminators(self):
+ model = petstore_api.DiscriminatorAllOfSuper.from_dict({"elementType": "DiscriminatorAllOfSub"})
+ self.assertIsInstance(model, petstore_api.DiscriminatorAllOfSub)
+
+ def test_list(self):
+ # should throw exception as var_123_list should be string
+ try:
+ # Don't check the typing, because we are actually testing a typing error.
+ l3 = petstore_api.ListClass(**{"123-list": 123}) # type: ignore
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ # var_123_list
+ # Input should be a valid string [type=string_type, input_value=123, input_type=int]
+ # For further information visit https://errors.pydantic.dev/2.3/v/string_type
+ self.assertTrue("Input should be a valid string" in str(e))
+
+ l = petstore_api.ListClass(**{"123-list": "bulldog"}) # type: ignore
+ self.assertEqual(l.to_json(), '{"123-list": "bulldog"}')
+ self.assertEqual(l.to_dict(), {'123-list': 'bulldog'})
+
+ l2 = petstore_api.ListClass.from_json(l.to_json())
+ assert l2 is not None
+ self.assertEqual(l2.var_123_list, 'bulldog')
+ self.assertTrue(isinstance(l2, petstore_api.ListClass))
+
+ def test_enum_ref_property(self):
+ # test enum ref property
+ # test to_json
+ d = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d.to_json(), '{"value": 1}')
+ d2 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=petstore_api.OuterEnum.DELIVERED)
+ self.assertEqual(d2.to_json(), '{"str_value": "delivered", "value": 1}')
+ # test from_json (round trip)
+ d3 = petstore_api.OuterObjectWithEnumProperty.from_json(d2.to_json())
+ assert d3 is not None
+ self.assertEqual(d3.str_value, petstore_api.OuterEnum.DELIVERED)
+ self.assertEqual(d3.value, petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d3.to_json(), '{"str_value": "delivered", "value": 1}')
+ d4 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1, str_value=None)
+ self.assertEqual(d4.to_json(), '{"value": 1, "str_value": null}')
+ d5 = petstore_api.OuterObjectWithEnumProperty(value=petstore_api.OuterEnumInteger.NUMBER_1)
+ self.assertEqual(d5.model_fields_set, {'value'})
+ d5.str_value = None # set None explicitly
+ self.assertEqual(d5.model_fields_set, {'value', 'str_value'})
+ self.assertEqual(d5.to_json(), '{"value": 1, "str_value": null}')
+
+ def test_valdiator(self):
+ # test regular expression
+ a = petstore_api.FormatTest(number=123.45, byte=bytes("string", 'utf-8'), date=date(2013, 9, 17), password="testing09876")
+ try:
+ a.pattern_with_digits_and_delimiter = "123"
+ self.assertTrue(False) # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue(r"must validate the regular expression /^image_\d{1,3}$/i" in str(e))
+
+ # test None with optional string (with regualr expression)
+ a = petstore_api.FormatTest(number=123.45, byte=bytes("string", 'utf-8'), date=date(2013, 9, 17), password="testing09876")
+ a.string = None # shouldn't throw an exception
+
+ a.pattern_with_digits_and_delimiter = "IMAGE_123"
+ self.assertEqual(a.pattern_with_digits_and_delimiter, "IMAGE_123")
+ a.pattern_with_digits_and_delimiter = "image_123"
+ self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123")
+
+ # test sanitize for serialization with different data types
+ self.assertEqual(petstore_api.ApiClient().sanitize_for_serialization(a), {'byte': b'string', 'date': '2013-09-17', 'number': 123.45, 'password': 'testing09876', 'pattern_with_digits_and_delimiter': 'image_123'})
+
+ # test sanitize for serialization with SecretStr (format: password)
+ class LoginTest(BaseModel):
+ username: StrictStr = Field(min_length=2, strict=True, max_length=64)
+ password: SecretStr
+
+ l = LoginTest(username="admin", password=SecretStr("testing09876"))
+ self.assertEqual(petstore_api.ApiClient().sanitize_for_serialization(l), {'username': "admin", 'password': "testing09876"})
+
+ def test_inline_enum_validator(self):
+ self.pet = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet.id = 1
+ try:
+ self.pet.status = "error"
+ self.assertTrue(False, "should have failed with 'invalid status' error") # this line shouldn't execute
+ except ValueError as e:
+ self.assertTrue("must be one of enum values ('available', 'pending', 'sold')" in str(e))
+
+ def test_constraints(self):
+ rgb = [128, 128, 128]
+ rgba = [128, 128, 128, 128]
+ hex_color = "#00FF00"
+
+ # These should all pass
+ color = petstore_api.Color(oneof_schema_1_validator=rgb)
+ self.assertEqual(rgb, color.oneof_schema_1_validator)
+
+ color = petstore_api.Color(oneof_schema_2_validator=rgba)
+ self.assertEqual(rgba, color.oneof_schema_2_validator)
+
+ color = petstore_api.Color(oneof_schema_3_validator=hex_color)
+ self.assertEqual(hex_color, color.oneof_schema_3_validator)
+
+ try:
+ petstore_api.Color(oneof_schema_1_validator=rgba)
+ self.fail("invalid validation")
+ except ValidationError as e:
+ self.assertIn("List should have at most 3 items after validation, not 4", str(e))
+
+ try:
+ petstore_api.Color(oneof_schema_2_validator=rgb)
+ self.fail("invalid validation")
+ except ValidationError as e:
+ self.assertIn("List should have at least 4 items after validation, not 3", str(e))
+
+ try:
+ petstore_api.Color(oneof_schema_3_validator="too long string")
+ self.fail("invalid validation")
+ except ValidationError as e:
+ self.assertIn("String should have at most 7 characters", str(e))
+
+ def test_object_id(self):
+ pet_ap = petstore_api.Pet(name="test name", photoUrls=["string"])
+ pet_ap2 = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.assertNotEqual(id(pet_ap), id(pet_ap2))
+
+ pet_ap3 = petstore_api.Pet.from_dict(pet_ap.to_dict())
+ pet_ap4 = petstore_api.Pet.from_dict(pet_ap.to_dict())
+ self.assertNotEqual(id(pet_ap3), id(pet_ap4))
+
+
+ def test_additional_properties(self):
+ pet_ap = petstore_api.Pet(name="test name", photoUrls=["string"])
+ pet_ap.id = 1
+ pet_ap.status = "available"
+
+ pet_ap2 = petstore_api.Pet(name="test name", photoUrls=["string"])
+ pet_ap2.id = 1
+ pet_ap2.status = "available"
+
+ self.assertNotEqual(id(pet_ap.additional_properties), id(pet_ap2.additional_properties))
+
+ pet_ap.additional_properties["something-new"] = "haha"
+ self.assertEqual(pet_ap.to_json(), '{"id": 1, "name": "test name", "photoUrls": ["string"], "status": "available", "something-new": "haha"}')
+ self.assertEqual(type(pet_ap2.additional_properties), dict)
+ self.assertNotEqual(id(pet_ap.additional_properties), id(pet_ap2.additional_properties))
+ self.assertEqual(pet_ap.additional_properties["something-new"], "haha")
+
+ try:
+ _tmp = pet_ap2.additional_properties["something-new"]
+ self.assertTrue(False) # this line shouldn't execute
+ except KeyError as e:
+ self.assertEqual("'something-new'", str(e))
+
+ pet_ap_dict = pet_ap.to_dict()
+ pet_ap_dict["something-new"] = 123
+ pet_ap_dict["array"] = ["a", "b"]
+ pet_ap_dict["dict"] = {"key999": "value999"}
+
+ pet_ap3 = petstore_api.Pet.from_dict(pet_ap_dict)
+ assert pet_ap3 is not None
+
+ self.assertEqual(pet_ap3.additional_properties["array"], ["a", "b"])
+ self.assertEqual(pet_ap3.additional_properties["something-new"], 123)
+ self.assertEqual(pet_ap3.additional_properties["dict"], {"key999": "value999"})
+
+ def test_nullable(self):
+ h = petstore_api.HealthCheckResult(NullableMessage="Not none")
+ self.assertEqual(h.to_json(), '{"NullableMessage": "Not none"}')
+
+ h.nullable_message = None
+ self.assertEqual(h.to_json(), '{"NullableMessage": null}')
+
+ #import json
+ #dictionary ={
+ # "id": "04",
+ # "name": "sunil",
+ # "department": None
+ #}
+ #
+ ## Serializing json
+ #json_object = json.dumps(dictionary)
+ #self.assertEqual(json_object, "")
+
+ def test_inline_enum_default(self):
+ enum_test = petstore_api.EnumTest(enum_string_required="lower")
+ self.assertEqual(enum_test.enum_integer_default, 5)
+
+ def test_object_with_optional_dict(self):
+ # for https://github.com/OpenAPITools/openapi-generator/issues/14913
+ # shouldn't throw exception by the optional dict property
+ a = petstore_api.ParentWithOptionalDict.from_dict({})
+
+ b = petstore_api.ParentWithOptionalDict.from_dict({"optionalDict": {"key": {"aProperty": {"a": "b"}}}})
+ assert b is not None
+ assert b.optional_dict is not None
+ assert b.optional_dict["key"].a_property is not None
+ self.assertEqual(b.optional_dict["key"].a_property["a"], "b")
+
+ def test_freeform_object(self):
+ # Allows dict[str, Any] and is nullable
+ a = InnerDictWithProperty.from_dict({"aProperty": {"a": 12}})
+ a = InnerDictWithProperty.from_dict({"aProperty": None})
+
+ # Allows no other values
+ with pytest.raises(ValidationError):
+ a = InnerDictWithProperty.from_dict({"aProperty": {123: 45}})
+ with pytest.raises(ValidationError):
+ a = InnerDictWithProperty.from_dict({"aProperty": "abc"})
+ with pytest.raises(ValidationError):
+ a = InnerDictWithProperty.from_dict({"aProperty": 12})
+
+ def test_object_with_dict_of_dict_of_object(self):
+ # for https://github.com/OpenAPITools/openapi-generator/issues/15135
+ d = {"optionalDict": {"a": {"b": {"aProperty": "value"}}}}
+ a = petstore_api.Parent.from_dict(d)
+ assert a is not None
+ self.assertEqual(a.to_dict(), d)
+
+ def test_eum_class(self):
+ a = petstore_api.EnumClass("-efg")
+ self.assertEqual(a.value, "-efg")
+ self.assertEqual(a.name, "MINUS_EFG")
+ self.assertEqual(a, "-efg")
+
+ def test_nullable_property_pattern(self):
+ a = petstore_api.NullableProperty(id=12, name=None)
+ self.assertEqual(a.id, 12)
+ self.assertEqual(a.name, None)
+
+ def test_int_or_string_oneof(self):
+ a = petstore_api.IntOrString("-efg")
+ self.assertEqual(a.actual_instance, "-efg")
+ a = petstore_api.IntOrString(100)
+ self.assertEqual(a.actual_instance, 100)
+
+ try:
+ a = petstore_api.IntOrString(1)
+ except ValueError as e:
+ self.assertTrue("Input should be greater than or equal to 10" in str(e))
+
+ def test_map_of_array_of_model(self):
+ a = petstore_api.MapOfArrayOfModel()
+ t = petstore_api.Tag(id=123, name="tag name")
+ a.shop_id_to_org_online_lip_map = {"somekey": [t]}
+ self.assertEqual(a.to_dict(), {'shopIdToOrgOnlineLipMap': {'somekey': [{'id': 123, 'name': 'tag name'}]}})
+ self.assertEqual(a.to_json(), '{"shopIdToOrgOnlineLipMap": {"somekey": [{"id": 123, "name": "tag name"}]}}')
+ a2 = petstore_api.MapOfArrayOfModel.from_dict(a.to_dict())
+ assert a2 is not None
+ self.assertEqual(a.to_dict(), a2.to_dict())
+
+ def test_array_of_array_of_model(self):
+ a = petstore_api.ArrayOfArrayOfModel()
+ t = petstore_api.Tag(id=123, name="tag name")
+ a.another_property = [[t]]
+ self.assertEqual(a.to_dict(), {'another_property': [[ {'id': 123, 'name': 'tag name'} ]]})
+ self.assertEqual(a.to_json(), '{"another_property": [[{"id": 123, "name": "tag name"}]]}')
+ a2 = petstore_api.ArrayOfArrayOfModel.from_dict(a.to_dict())
+ assert a2 is not None
+ self.assertEqual(a.to_dict(), a2.to_dict())
+
+ def test_object_with_additional_properties(self):
+ a = petstore_api.ObjectToTestAdditionalProperties()
+ a.additional_properties = { "abc": 123 }
+ # should not throw the following errors:
+ # pydantic.errors.ConfigError: field "additional_properties" not yet prepared so type is still a ForwardRef, you might need to call ObjectToTestAdditionalProperties.update_forward_refs().
+
+ def test_first_ref(self):
+ # shouldn't throw "still a ForwardRef" error
+ a = petstore_api.FirstRef.from_dict({})
+ assert a is not None
+ self.assertEqual(a.to_json(), "{}")
+
+ def test_allof(self):
+ # for issue 16104
+ model = petstore_api.Tiger.from_json('{"skill": "none", "type": "tiger", "info": {"name": "creature info"}}')
+ # shouldn't throw NameError
+ assert model is not None
+ self.assertEqual(model.to_json(), '{"skill": "none", "type": "tiger", "info": {"name": "creature info"}}')
+
+ def test_allof_circular_imports(self):
+ # for issue 18271
+ model_a = petstore_api.models.circular_all_of_ref.CircularAllOfRef.from_json('{"_name": "nameA", "second_circular_all_of_ref": {"name": "nameB"}}')
+ model_b = petstore_api.models.second_circular_all_of_ref.SecondCircularAllOfRef.from_json('{"_name": "nameB", "circular_all_of_ref": {"name": "nameA"}}')
+ # shouldn't throw ImportError
+ assert model_a is not None
+ assert model_b is not None
+ self.assertEqual(model_a.to_json(), '{"_name": "nameA", "second_circular_all_of_ref": {"name": "nameB"}}')
+ self.assertEqual(model_b.to_json(), '{"_name": "nameB", "circular_all_of_ref": {"name": "nameA"}}')
+
+ def test_allof_discriminator_mapping(self):
+ # for issue 18498
+ user_info_json = '{"_typeName": "Info", "val": {"_typeName": "string", "_value": "some string"}}'
+ user_info = petstore_api.models.Info.from_json(user_info_json)
+ # shouldn't throw ValueError("BaseDiscriminator failed to lookup discriminator value...")
+ assert user_info is not None
+ self.assertEqual(user_info.to_json(), user_info_json)
+
+class TestdditionalPropertiesAnyType(unittest.TestCase):
+ def test_additional_properties(self):
+ a1 = petstore_api.AdditionalPropertiesAnyType()
+ a1.additional_properties = { "abc": 123 }
+ self.assertEqual(a1.to_dict(), {"abc": 123})
+ self.assertEqual(a1.to_json(), '{"abc": 123}')
+
+ a2 = petstore_api.AdditionalPropertiesObject()
+ a2.additional_properties = { "efg": 45.6 }
+ self.assertEqual(a2.to_dict(), {"efg": 45.6})
+ self.assertEqual(a2.to_json(), '{"efg": 45.6}')
+
+ a3 = petstore_api.AdditionalPropertiesWithDescriptionOnly()
+ a3.additional_properties = { "xyz": 45.6 }
+ self.assertEqual(a3.to_dict(), {"xyz": 45.6})
+ self.assertEqual(a3.to_json(), '{"xyz": 45.6}')
+
+class TestUnnamedDictWithAdditionalStringListProperties:
+ def test_empty_dict(self):
+ a = petstore_api.UnnamedDictWithAdditionalStringListProperties(dictProperty={})
+ assert a is not None
+ assert a.to_dict() == {"dictProperty": {}}
+
+ def test_empty_list(self):
+ a = petstore_api.UnnamedDictWithAdditionalStringListProperties(dictProperty={"b": []})
+ assert a is not None
+ assert a.to_dict() == {"dictProperty": {"b": []}}
+
+ def test_single_string_item(self):
+ a = petstore_api.UnnamedDictWithAdditionalStringListProperties(dictProperty={"b": ["c"]})
+ assert a.to_dict() == {"dictProperty": {"b": ["c"]}}
+
+class TestUnnamedDictWithAdditionalModelListProperties:
+ def test_empty_dict(self):
+ a = petstore_api.UnnamedDictWithAdditionalModelListProperties(dictProperty={})
+ assert a.to_dict() == {"dictProperty": {}}
+
+ def test_empty_list(self):
+ a = petstore_api.UnnamedDictWithAdditionalModelListProperties(dictProperty={"b": []})
+ assert a.to_dict() == {"dictProperty": {"b": []}}
+
+ def test_single_string_item(self):
+ value = {"b": [petstore_api.CreatureInfo(name="creature_name")]}
+ a = petstore_api.UnnamedDictWithAdditionalModelListProperties(dictProperty=value)
+ assert a.to_dict() == {"dictProperty": {"b": [{"name": "creature_name"}]}}
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_order_model.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_order_model.py
new file mode 100644
index 00000000000..7d4afba5b1d
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_order_model.py
@@ -0,0 +1,20 @@
+# coding: utf-8
+
+# flake8: noqa
+
+import os
+import time
+import unittest
+
+import petstore_api
+
+
+class OrderModelTests(unittest.TestCase):
+
+ def test_status(self):
+ order = petstore_api.Order()
+ # order.status = "placed"
+ # self.assertEqual("placed", order.status)
+
+ # with self.assertRaises(ValueError):
+ # order.status = "invalid"
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_pet_api.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_pet_api.py
new file mode 100644
index 00000000000..addfa801821
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_pet_api.py
@@ -0,0 +1,270 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ docker pull swaggerapi/petstore
+$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
+$ pip install -U pytest
+$ cd petstore_api-python
+$ pytest
+"""
+
+import os
+import unittest
+
+import petstore_api
+from petstore_api import Configuration
+from petstore_api.rest import ApiException
+
+from .util import id_gen
+
+import json
+
+import urllib3
+
+HOST = 'http://localhost/v2'
+
+
+class TimeoutWithEqual(urllib3.Timeout):
+ def __init__(self, *arg, **kwargs):
+ super(TimeoutWithEqual, self).__init__(*arg, **kwargs)
+
+ def __eq__(self, other):
+ return self._read == other._read and self._connect == other._connect and self.total == other.total
+
+
+class MockPoolManager(urllib3.PoolManager):
+ def __init__(self, tc):
+ self._tc = tc
+ self._reqs = []
+
+ def expect_request(self, *args, **kwargs):
+ self._reqs.append((args, kwargs))
+
+ def request(self, *args, **kwargs):
+ self._tc.assertTrue(len(self._reqs) > 0)
+ r = self._reqs.pop(0)
+ self._tc.maxDiff = None
+ self._tc.assertEqual(r[0], args)
+ self._tc.assertEqual(r[1], kwargs)
+ return urllib3.HTTPResponse(status=200, body=b'test')
+
+
+class PetApiTests(unittest.TestCase):
+
+ def setUp(self):
+ config = Configuration()
+ config.host = HOST
+ config.access_token = 'ACCESS_TOKEN'
+ self.api_client = petstore_api.ApiClient(config)
+ self.pet_api = petstore_api.PetApi(self.api_client)
+ self.setUpModels()
+ self.setUpFiles()
+
+ def setUpModels(self):
+ self.category = petstore_api.Category(name="dog")
+ self.category.id = id_gen()
+ # self.category.name = "dog"
+ self.tag = petstore_api.Tag()
+ self.tag.id = id_gen()
+ self.tag.name = "python-pet-tag"
+ self.pet = petstore_api.Pet(name="hello kity", photoUrls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet.id = id_gen()
+ self.pet.status = "sold"
+ self.pet.category = self.category
+ self.pet.tags = [self.tag]
+
+ self.pet2 = petstore_api.Pet(name="superman 2", photoUrls=["http://foo.bar.com/1", "http://foo.bar.com/2"])
+ self.pet2.id = id_gen() + 1
+ self.pet2.status = "available"
+ self.pet2.category = self.category
+ self.pet2.tags = [self.tag]
+
+ def setUpFiles(self):
+ self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
+ self.test_file_dir = os.path.realpath(self.test_file_dir)
+ self.foo = os.path.join(self.test_file_dir, "pix.gif")
+
+ def test_timeout(self):
+ mock_pool = MockPoolManager(self)
+ self.api_client.rest_client.pool_manager = mock_pool
+
+ mock_pool.expect_request('POST', HOST + '/pet',
+ body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
+ headers={'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ACCESS_TOKEN',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
+ preload_content=False, timeout=TimeoutWithEqual(total=5.0))
+ mock_pool.expect_request('POST', HOST + '/pet',
+ body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)),
+ headers={'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ACCESS_TOKEN',
+ 'User-Agent': 'OpenAPI-Generator/1.0.0/python'},
+ preload_content=False, timeout=TimeoutWithEqual(connect=1.0, read=2.0))
+
+ self.pet_api.add_pet(self.pet, _request_timeout=5.0)
+ self.pet_api.add_pet(self.pet, _request_timeout=(1.0, 2.0))
+
+ def test_accept_header_serialization(self):
+ (_, _, headers, *_) = self.pet_api._get_pet_by_id_serialize(
+ pet_id=self.pet.id,
+ _request_auth=None,
+ _content_type=None,
+ _headers=None,
+ _host_index=0
+ )
+ self.assertEqual(headers['Accept'], 'application/json')
+
+ (_, _, headers_overwritten, *_) = self.pet_api._get_pet_by_id_serialize(
+ pet_id=self.pet.id,
+ _request_auth=None,
+ _content_type=None,
+ _headers={'Accept': 'text/plain'},
+ _host_index=0
+ )
+ self.assertEqual(headers_overwritten['Accept'], 'text/plain')
+
+ def test_separate_default_config_instances(self):
+ # ensure the default api client is used
+ pet_api = petstore_api.PetApi()
+ pet_api2 = petstore_api.PetApi()
+ self.assertEqual(id(pet_api.api_client), id(pet_api2.api_client))
+ # ensure the default configuration is used
+ self.assertEqual(id(pet_api.api_client.configuration), id(pet_api2.api_client.configuration))
+
+ def test_add_pet_and_get_pet_by_id(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+
+ fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ assert fetched is not None
+ self.assertEqual(self.pet.id, fetched.id)
+ assert fetched.category is not None
+ assert self.pet.category is not None
+ self.assertEqual(self.pet.category.name, fetched.category.name)
+
+ def test_add_pet_and_get_pet_by_id_without_preload_content_flag(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+
+ fetched = self.pet_api.get_pet_by_id_without_preload_content(pet_id=self.pet.id)
+
+ self.assertIsInstance(fetched, urllib3.HTTPResponse)
+ self.assertFalse(fetched.closed)
+ read = fetched.read()
+ self.assertTrue(fetched.closed)
+ self.assertIsInstance(read, bytes)
+ self.assertEqual(fetched.data, b'')
+ self.assertEqual(fetched.read(), b'')
+ self.assertEqual(fetched.read(10), b'')
+ self.assertTrue(read.decode("utf-8").startswith('{"id":'))
+
+ def test_add_pet_and_get_pet_by_id_with_http_info(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+
+ # fetched is an ApiResponse object
+ fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id)
+ assert fetched.data is not None
+ self.assertEqual(self.pet.id, fetched.data.id)
+ assert fetched.data.category is not None
+ assert self.pet.category is not None
+ self.assertEqual(self.pet.category.name, fetched.data.category.name)
+
+ def test_get_pet_by_id_serialize(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+
+ fetched = self.pet_api._get_pet_by_id_serialize(self.pet.id, None, None, None, None)
+ assert fetched is not None
+ self.assertIsInstance(fetched, tuple)
+
+ def test_update_pet(self):
+ self.pet.name = "hello kity with updated"
+ self.pet_api.update_pet(self.pet)
+ assert self.pet.id is not None
+
+ fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ assert fetched is not None
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertEqual(self.pet.name, fetched.name)
+ assert fetched.category is not None
+ assert self.pet.category is not None
+ self.assertEqual(fetched.category.name, self.pet.category.name)
+
+ def test_find_pets_by_status(self):
+ self.pet_api.add_pet(self.pet)
+ self.pet_api.add_pet(self.pet2)
+
+ results = self.pet_api.find_pets_by_status(status=["pending", "available"])
+ self.assertIsInstance(results, list)
+ self.assertTrue(len(results) > 1)
+ # TODO
+ #for result in results:
+ # self.assertTrue(result.status in ["sold", "available"])
+
+ def test_find_pets_by_tags(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+ assert self.tag.name is not None
+
+ self.assertIn(
+ self.pet.id,
+ list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name, "here is another tag"])))
+ )
+
+ def test_update_pet_with_form(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+
+ name = "hello kity with form updated abc"
+ status = "pending"
+ self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status)
+
+ fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ self.assertEqual(self.pet.id, fetched.id)
+ self.assertEqual(name, fetched.name)
+ self.assertEqual(status, fetched.status)
+
+ def test_upload_file(self):
+ assert self.pet.id is not None
+ # upload file with form parameter
+ try:
+ additional_metadata = "special data 123"
+ self.pet_api.upload_file(
+ pet_id=self.pet.id,
+ additional_metadata=additional_metadata,
+ file=self.foo
+ )
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ # upload only file
+ try:
+ self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo)
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ try:
+ with open(self.foo, 'rb') as binary_file:
+ data = binary_file.read()
+ self.pet_api.upload_file(pet_id=self.pet.id, file=data)
+ except ApiException as e:
+ self.fail("upload_file() raised {0} unexpectedly".format(type(e)))
+
+ def test_delete_pet(self):
+ self.pet_api.add_pet(self.pet)
+ assert self.pet.id is not None
+ self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key")
+
+ try:
+ self.pet_api.get_pet_by_id(pet_id=self.pet.id)
+ raise Exception("expected an error")
+ except ApiException as e:
+ self.assertEqual(404, e.status)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_pet_model.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_pet_model.py
new file mode 100644
index 00000000000..4412255969e
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_pet_model.py
@@ -0,0 +1,120 @@
+# coding: utf-8
+
+# flake8: noqa
+
+import os
+import time
+import unittest
+
+import petstore_api
+import json
+from pydantic import ValidationError
+
+
+class PetModelTests(unittest.TestCase):
+
+ def setUp(self):
+ self.pet = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet.id = 1
+ self.pet.status = "available"
+ cate = petstore_api.Category(name="dog")
+ cate.id = 1
+ # cate.name = "dog"
+ self.pet.category = cate
+ tag = petstore_api.Tag()
+ tag.id = 1
+ self.pet.tags = [tag]
+
+ def test_to_str(self):
+ data = ("{'additional_properties': {},\n"
+ " 'category': {'additional_properties': {}, 'id': 1, 'name': 'dog'},\n"
+ " 'id': 1,\n"
+ " 'name': 'test name',\n"
+ " 'photoUrls': ['string'],\n"
+ " 'status': 'available',\n"
+ " 'tags': [{'additional_properties': {}, 'id': 1, 'name': None}]}")
+ self.assertEqual(data, self.pet.to_str())
+
+ def test_equal(self):
+ self.pet1 = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet1.id = 1
+ self.pet1.status = "available"
+ cate1 = petstore_api.Category(name="dog")
+ cate1.id = 1
+ # cate1.name = "dog"
+ self.pet1.category = cate1
+ tag1 = petstore_api.Tag()
+ tag1.id = 1
+ self.pet1.tags = [tag1]
+
+ self.pet2 = petstore_api.Pet(name="test name", photoUrls=["string"])
+ self.pet2.id = 1
+ self.pet2.status = "available"
+ cate2 = petstore_api.Category(name="dog")
+ cate2.id = 1
+ # cate2.name = "dog"
+ self.pet2.category = cate2
+ tag2 = petstore_api.Tag()
+ tag2.id = 1
+ self.pet2.tags = [tag2]
+
+ self.assertTrue(self.pet1 == self.pet2)
+
+ # reset pet1 tags to empty array so that object comparison returns false
+ self.pet1.tags = []
+ self.assertFalse(self.pet1 == self.pet2)
+
+ # test from_json, to_json, to_dict, from_dict
+ def test_from_to_methods(self):
+ json_str = ("{\"category\": {\"id\": 1, \"name\": \"dog\"},\n"
+ " \"id\": 1,\n"
+ " \"name\": \"test name\",\n"
+ " \"photoUrls\": [\"string\"],\n"
+ " \"status\": \"available\",\n"
+ " \"tags\": [{\"id\": 1, \"name\": \"None\"}]}")
+ pet = petstore_api.Pet.from_json(json_str)
+ assert pet is not None
+ self.assertEqual(pet.id, 1)
+ self.assertEqual(pet.status, "available")
+ self.assertEqual(pet.photo_urls, ["string"])
+ assert pet.tags is not None
+ self.assertEqual(pet.tags[0].id, 1)
+ self.assertEqual(pet.tags[0].name, "None")
+ assert pet.category is not None
+ self.assertEqual(pet.category.id, 1)
+ # test to_json
+ self.assertEqual(pet.to_json(),
+ '{"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ['
+ '"string"], "tags": [{"id": 1, "name": "None"}], "status": "available"}')
+
+ # test to_dict
+ self.assertEqual(pet.to_dict(),
+ {"id": 1, "category": {"id": 1, "name": "dog"}, "name": "test name", "photoUrls": ["string"],
+ "tags": [{"id": 1, "name": "None"}], "status": "available"})
+
+ # test from_dict
+ pet2 = petstore_api.Pet.from_dict(pet.to_dict())
+ assert pet2 is not None
+ self.assertEqual(pet2.id, 1)
+ self.assertEqual(pet2.status, "available")
+ self.assertEqual(pet2.photo_urls, ["string"])
+ assert pet2.tags is not None
+ self.assertEqual(pet2.tags[0].id, 1)
+ self.assertEqual(pet2.tags[0].name, "None")
+ assert pet2.category is not None
+ self.assertEqual(pet2.category.id, 1)
+
+ def test_unpack_operator(self):
+ pet = petstore_api.Pet(name="required name", id=123, photoUrls=["https://a.com", "https://b.com"])
+ self.assertEqual(pet.to_json(), '{"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
+ self.assertEqual(pet.to_dict(), {"id": 123, "name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
+
+ def test_optional_fields(self):
+ _pet = petstore_api.Pet(name="required name",
+ photoUrls=["https://a.com",
+ "https://b.com"])
+ self.assertEqual(_pet.to_json(),'{"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]}')
+ self.assertEqual(_pet.to_dict(), {"name": "required name", "photoUrls": ["https://a.com", "https://b.com"]})
+
+
+
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_rest.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_rest.py
new file mode 100644
index 00000000000..47989845e35
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_rest.py
@@ -0,0 +1,56 @@
+import os
+import unittest
+from unittest.mock import Mock, patch
+
+import petstore_api
+
+
+class TestMultipleResponseTypes(unittest.TestCase):
+ def setUpFiles(self):
+ self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles")
+ self.test_file_dir = os.path.realpath(self.test_file_dir)
+ self.test_file_path = os.path.join(self.test_file_dir, "pix.gif")
+
+ def setUp(self):
+ self.api_client = petstore_api.ApiClient()
+ self.fake_api = petstore_api.FakeApi(self.api_client)
+ self.setUpFiles()
+
+ def test_multipart_requests(self):
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b"some text"
+ mock_resp.headers = {}
+
+ marker = petstore_api.TestObjectForMultipartRequestsRequestMarker(
+ name="name",
+ )
+
+ with patch("urllib3.PoolManager.urlopen", return_value=mock_resp):
+ returned = self.fake_api.test_object_for_multipart_requests(marker=marker)
+ assert returned is None
+
+ def test_multipart_requests_with_file_and_additional_properties(self):
+ mock_resp = Mock()
+ mock_resp.status = 200
+ mock_resp.data = b'{"code": 200, "type": "success", "message": "OK"}'
+ mock_resp.headers = {"Content-Type": "application/json"}
+ with open(self.test_file_path, "rb") as f, patch(
+ "urllib3.PoolManager.urlopen", return_value=mock_resp
+ ):
+ returned = self.fake_api.upload_file_with_additional_properties(
+ file=(self.test_file_path, f.read()),
+ count=100,
+ object=petstore_api.UploadFileWithAdditionalPropertiesRequestObject(
+ name="foo"
+ ),
+ )
+
+ assert (
+ returned.code == 200
+ and returned.type == "success"
+ and returned.message == "OK"
+ )
+
+ # if the request is successful, both int and dict body parameters were
+ # successfully serialized
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_store_api.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_store_api.py
new file mode 100644
index 00000000000..178e44fd1fe
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_store_api.py
@@ -0,0 +1,32 @@
+# coding: utf-8
+
+# flake8: noqa
+
+"""
+Run the tests.
+$ pip install -U pytest
+$ cd OpenAP/Petstore-python
+$ pytest
+"""
+
+import os
+import time
+import unittest
+
+import petstore_api
+from petstore_api.rest import ApiException
+
+
+class StoreApiTests(unittest.TestCase):
+
+ def setUp(self):
+ self.store_api = petstore_api.StoreApi()
+
+ def tearDown(self):
+ # sleep 1 sec between two every 2 tests
+ time.sleep(1)
+
+ def test_get_inventory(self):
+ data = self.store_api.get_inventory()
+ self.assertIsNotNone(data)
+ self.assertTrue(isinstance(data, dict))
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/util.py b/samples/openapi3/client/petstore/python-lazyImports/tests/util.py
new file mode 100644
index 00000000000..113d7dcc547
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tests/util.py
@@ -0,0 +1,8 @@
+# flake8: noqa
+
+import random
+
+
+def id_gen(bits=32):
+ """ Returns a n-bit randomly generated int """
+ return int(random.getrandbits(bits))
diff --git a/samples/openapi3/client/petstore/python-lazyImports/tox.ini b/samples/openapi3/client/petstore/python-lazyImports/tox.ini
new file mode 100644
index 00000000000..8989fc3c4d9
--- /dev/null
+++ b/samples/openapi3/client/petstore/python-lazyImports/tox.ini
@@ -0,0 +1,9 @@
+[tox]
+envlist = py3
+
+[testenv]
+deps=-r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
+
+commands=
+ pytest --cov=petstore_api
diff --git a/samples/openapi3/client/petstore/python/petstore_api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/__init__.py
index 5fc37d48819..278f6dfecf4 100755
--- a/samples/openapi3/client/petstore/python/petstore_api/__init__.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/__init__.py
@@ -150,152 +150,7 @@ __all__ = [
"WithNestedOneOf",
]
-if __import__("typing").TYPE_CHECKING:
- # import apis into sdk package
- from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi
- from petstore_api.api.default_api import DefaultApi as DefaultApi
- from petstore_api.api.fake_api import FakeApi as FakeApi
- from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api as FakeClassnameTags123Api
- from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi as ImportTestDatetimeApi
- from petstore_api.api.pet_api import PetApi as PetApi
- from petstore_api.api.store_api import StoreApi as StoreApi
- from petstore_api.api.user_api import UserApi as UserApi
-
- # import ApiClient
- from petstore_api.api_response import ApiResponse as ApiResponse
- from petstore_api.api_client import ApiClient as ApiClient
- from petstore_api.configuration import Configuration as Configuration
- from petstore_api.exceptions import OpenApiException as OpenApiException
- from petstore_api.exceptions import ApiTypeError as ApiTypeError
- from petstore_api.exceptions import ApiValueError as ApiValueError
- from petstore_api.exceptions import ApiKeyError as ApiKeyError
- from petstore_api.exceptions import ApiAttributeError as ApiAttributeError
- from petstore_api.exceptions import ApiException as ApiException
- from petstore_api.signing import HttpSigningConfiguration as HttpSigningConfiguration
-
- # import models into sdk package
- from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType as AdditionalPropertiesAnyType
- from petstore_api.models.additional_properties_class import AdditionalPropertiesClass as AdditionalPropertiesClass
- from petstore_api.models.additional_properties_object import AdditionalPropertiesObject as AdditionalPropertiesObject
- from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly as AdditionalPropertiesWithDescriptionOnly
- from petstore_api.models.all_of_super_model import AllOfSuperModel as AllOfSuperModel
- from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef as AllOfWithSingleRef
- from petstore_api.models.animal import Animal as Animal
- from petstore_api.models.any_of_color import AnyOfColor as AnyOfColor
- from petstore_api.models.any_of_pig import AnyOfPig as AnyOfPig
- from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel as ArrayOfArrayOfModel
- from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly as ArrayOfArrayOfNumberOnly
- from petstore_api.models.array_of_number_only import ArrayOfNumberOnly as ArrayOfNumberOnly
- from petstore_api.models.array_test import ArrayTest as ArrayTest
- from petstore_api.models.base_discriminator import BaseDiscriminator as BaseDiscriminator
- from petstore_api.models.basque_pig import BasquePig as BasquePig
- from petstore_api.models.bathing import Bathing as Bathing
- from petstore_api.models.capitalization import Capitalization as Capitalization
- from petstore_api.models.cat import Cat as Cat
- from petstore_api.models.category import Category as Category
- from petstore_api.models.circular_all_of_ref import CircularAllOfRef as CircularAllOfRef
- from petstore_api.models.circular_reference_model import CircularReferenceModel as CircularReferenceModel
- from petstore_api.models.class_model import ClassModel as ClassModel
- from petstore_api.models.client import Client as Client
- from petstore_api.models.color import Color as Color
- from petstore_api.models.creature import Creature as Creature
- from petstore_api.models.creature_info import CreatureInfo as CreatureInfo
- from petstore_api.models.danish_pig import DanishPig as DanishPig
- from petstore_api.models.data_output_format import DataOutputFormat as DataOutputFormat
- from petstore_api.models.deprecated_object import DeprecatedObject as DeprecatedObject
- from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub as DiscriminatorAllOfSub
- from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper as DiscriminatorAllOfSuper
- from petstore_api.models.dog import Dog as Dog
- from petstore_api.models.dummy_model import DummyModel as DummyModel
- from petstore_api.models.enum_arrays import EnumArrays as EnumArrays
- from petstore_api.models.enum_class import EnumClass as EnumClass
- from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt as EnumNumberVendorExt
- from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue as EnumRefWithDefaultValue
- from petstore_api.models.enum_string1 import EnumString1 as EnumString1
- from petstore_api.models.enum_string2 import EnumString2 as EnumString2
- from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt as EnumStringVendorExt
- from petstore_api.models.enum_test import EnumTest as EnumTest
- from petstore_api.models.feeding import Feeding as Feeding
- from petstore_api.models.file import File as File
- from petstore_api.models.file_schema_test_class import FileSchemaTestClass as FileSchemaTestClass
- from petstore_api.models.first_ref import FirstRef as FirstRef
- from petstore_api.models.foo import Foo as Foo
- from petstore_api.models.foo_get_default_response import FooGetDefaultResponse as FooGetDefaultResponse
- from petstore_api.models.format_test import FormatTest as FormatTest
- from petstore_api.models.has_only_read_only import HasOnlyReadOnly as HasOnlyReadOnly
- from petstore_api.models.health_check_result import HealthCheckResult as HealthCheckResult
- from petstore_api.models.hunting_dog import HuntingDog as HuntingDog
- from petstore_api.models.info import Info as Info
- from petstore_api.models.inner_dict_with_property import InnerDictWithProperty as InnerDictWithProperty
- from petstore_api.models.input_all_of import InputAllOf as InputAllOf
- from petstore_api.models.int_or_string import IntOrString as IntOrString
- from petstore_api.models.list_class import ListClass as ListClass
- from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel as MapOfArrayOfModel
- from petstore_api.models.map_test import MapTest as MapTest
- from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass as MixedPropertiesAndAdditionalPropertiesClass
- from petstore_api.models.model200_response import Model200Response as Model200Response
- from petstore_api.models.model_api_response import ModelApiResponse as ModelApiResponse
- from petstore_api.models.model_field import ModelField as ModelField
- from petstore_api.models.model_return import ModelReturn as ModelReturn
- from petstore_api.models.multi_arrays import MultiArrays as MultiArrays
- from petstore_api.models.name import Name as Name
- from petstore_api.models.nullable_class import NullableClass as NullableClass
- from petstore_api.models.nullable_property import NullableProperty as NullableProperty
- from petstore_api.models.number_only import NumberOnly as NumberOnly
- from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties as ObjectToTestAdditionalProperties
- from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields as ObjectWithDeprecatedFields
- from petstore_api.models.one_of_enum_string import OneOfEnumString as OneOfEnumString
- from petstore_api.models.order import Order as Order
- from petstore_api.models.outer_composite import OuterComposite as OuterComposite
- from petstore_api.models.outer_enum import OuterEnum as OuterEnum
- from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue as OuterEnumDefaultValue
- from petstore_api.models.outer_enum_integer import OuterEnumInteger as OuterEnumInteger
- from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue as OuterEnumIntegerDefaultValue
- from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty as OuterObjectWithEnumProperty
- from petstore_api.models.parent import Parent as Parent
- from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict as ParentWithOptionalDict
- from petstore_api.models.pet import Pet as Pet
- from petstore_api.models.pig import Pig as Pig
- from petstore_api.models.pony_sizes import PonySizes as PonySizes
- from petstore_api.models.poop_cleaning import PoopCleaning as PoopCleaning
- from petstore_api.models.primitive_string import PrimitiveString as PrimitiveString
- from petstore_api.models.property_map import PropertyMap as PropertyMap
- from petstore_api.models.property_name_collision import PropertyNameCollision as PropertyNameCollision
- from petstore_api.models.read_only_first import ReadOnlyFirst as ReadOnlyFirst
- from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef as SecondCircularAllOfRef
- from petstore_api.models.second_ref import SecondRef as SecondRef
- from petstore_api.models.self_reference_model import SelfReferenceModel as SelfReferenceModel
- from petstore_api.models.single_ref_type import SingleRefType as SingleRefType
- from petstore_api.models.special_character_enum import SpecialCharacterEnum as SpecialCharacterEnum
- from petstore_api.models.special_model_name import SpecialModelName as SpecialModelName
- from petstore_api.models.special_name import SpecialName as SpecialName
- from petstore_api.models.tag import Tag as Tag
- from petstore_api.models.task import Task as Task
- from petstore_api.models.task_activity import TaskActivity as TaskActivity
- from petstore_api.models.test_enum import TestEnum as TestEnum
- from petstore_api.models.test_enum_with_default import TestEnumWithDefault as TestEnumWithDefault
- from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response as TestErrorResponsesWithModel400Response
- from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response as TestErrorResponsesWithModel404Response
- from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest as TestInlineFreeformAdditionalPropertiesRequest
- from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault as TestModelWithEnumDefault
- from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker as TestObjectForMultipartRequestsRequestMarker
- from petstore_api.models.tiger import Tiger as Tiger
- from petstore_api.models.type import Type as Type
- from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties as UnnamedDictWithAdditionalModelListProperties
- from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties as UnnamedDictWithAdditionalStringListProperties
- from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject as UploadFileWithAdditionalPropertiesRequestObject
- from petstore_api.models.user import User as User
- from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- ("__version__", __version__),
- ("__all__", __all__),
- """# import apis into sdk package
+# import apis into sdk package
from petstore_api.api.another_fake_api import AnotherFakeApi as AnotherFakeApi
from petstore_api.api.default_api import DefaultApi as DefaultApi
from petstore_api.api.fake_api import FakeApi as FakeApi
@@ -431,8 +286,3 @@ from petstore_api.models.upload_file_with_additional_properties_request_object i
from petstore_api.models.user import User as User
from petstore_api.models.with_nested_one_of import WithNestedOneOf as WithNestedOneOf
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py
index e77aed00eb5..79d2ab7dc93 100755
--- a/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/api/__init__.py
@@ -1,23 +1,6 @@
# flake8: noqa
-if __import__("typing").TYPE_CHECKING:
- # import apis into api package
- from petstore_api.api.another_fake_api import AnotherFakeApi
- from petstore_api.api.default_api import DefaultApi
- from petstore_api.api.fake_api import FakeApi
- from petstore_api.api.fake_classname_tags123_api import FakeClassnameTags123Api
- from petstore_api.api.import_test_datetime_api import ImportTestDatetimeApi
- from petstore_api.api.pet_api import PetApi
- from petstore_api.api.store_api import StoreApi
- from petstore_api.api.user_api import UserApi
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import apis into api package
+# import apis into api package
from petstore_api.api.another_fake_api import AnotherFakeApi
from petstore_api.api.default_api import DefaultApi
from petstore_api.api.fake_api import FakeApi
@@ -27,8 +10,3 @@ from petstore_api.api.pet_api import PetApi
from petstore_api.api.store_api import StoreApi
from petstore_api.api.user_api import UserApi
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py
index 68a0bf95df1..f34d053a1b7 100644
--- a/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py
+++ b/samples/openapi3/client/petstore/python/petstore_api/models/__init__.py
@@ -12,129 +12,7 @@
Do not edit the class manually.
""" # noqa: E501
-
-if __import__("typing").TYPE_CHECKING:
- # import models into model package
- from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
- from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
- from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
- from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
- from petstore_api.models.all_of_super_model import AllOfSuperModel
- from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
- from petstore_api.models.animal import Animal
- from petstore_api.models.any_of_color import AnyOfColor
- from petstore_api.models.any_of_pig import AnyOfPig
- from petstore_api.models.array_of_array_of_model import ArrayOfArrayOfModel
- from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly
- from petstore_api.models.array_of_number_only import ArrayOfNumberOnly
- from petstore_api.models.array_test import ArrayTest
- from petstore_api.models.base_discriminator import BaseDiscriminator
- from petstore_api.models.basque_pig import BasquePig
- from petstore_api.models.bathing import Bathing
- from petstore_api.models.capitalization import Capitalization
- from petstore_api.models.cat import Cat
- from petstore_api.models.category import Category
- from petstore_api.models.circular_all_of_ref import CircularAllOfRef
- from petstore_api.models.circular_reference_model import CircularReferenceModel
- from petstore_api.models.class_model import ClassModel
- from petstore_api.models.client import Client
- from petstore_api.models.color import Color
- from petstore_api.models.creature import Creature
- from petstore_api.models.creature_info import CreatureInfo
- from petstore_api.models.danish_pig import DanishPig
- from petstore_api.models.data_output_format import DataOutputFormat
- from petstore_api.models.deprecated_object import DeprecatedObject
- from petstore_api.models.discriminator_all_of_sub import DiscriminatorAllOfSub
- from petstore_api.models.discriminator_all_of_super import DiscriminatorAllOfSuper
- from petstore_api.models.dog import Dog
- from petstore_api.models.dummy_model import DummyModel
- from petstore_api.models.enum_arrays import EnumArrays
- from petstore_api.models.enum_class import EnumClass
- from petstore_api.models.enum_number_vendor_ext import EnumNumberVendorExt
- from petstore_api.models.enum_ref_with_default_value import EnumRefWithDefaultValue
- from petstore_api.models.enum_string1 import EnumString1
- from petstore_api.models.enum_string2 import EnumString2
- from petstore_api.models.enum_string_vendor_ext import EnumStringVendorExt
- from petstore_api.models.enum_test import EnumTest
- from petstore_api.models.feeding import Feeding
- from petstore_api.models.file import File
- from petstore_api.models.file_schema_test_class import FileSchemaTestClass
- from petstore_api.models.first_ref import FirstRef
- from petstore_api.models.foo import Foo
- from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
- from petstore_api.models.format_test import FormatTest
- from petstore_api.models.has_only_read_only import HasOnlyReadOnly
- from petstore_api.models.health_check_result import HealthCheckResult
- from petstore_api.models.hunting_dog import HuntingDog
- from petstore_api.models.info import Info
- from petstore_api.models.inner_dict_with_property import InnerDictWithProperty
- from petstore_api.models.input_all_of import InputAllOf
- from petstore_api.models.int_or_string import IntOrString
- from petstore_api.models.list_class import ListClass
- from petstore_api.models.map_of_array_of_model import MapOfArrayOfModel
- from petstore_api.models.map_test import MapTest
- from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass
- from petstore_api.models.model200_response import Model200Response
- from petstore_api.models.model_api_response import ModelApiResponse
- from petstore_api.models.model_field import ModelField
- from petstore_api.models.model_return import ModelReturn
- from petstore_api.models.multi_arrays import MultiArrays
- from petstore_api.models.name import Name
- from petstore_api.models.nullable_class import NullableClass
- from petstore_api.models.nullable_property import NullableProperty
- from petstore_api.models.number_only import NumberOnly
- from petstore_api.models.object_to_test_additional_properties import ObjectToTestAdditionalProperties
- from petstore_api.models.object_with_deprecated_fields import ObjectWithDeprecatedFields
- from petstore_api.models.one_of_enum_string import OneOfEnumString
- from petstore_api.models.order import Order
- from petstore_api.models.outer_composite import OuterComposite
- from petstore_api.models.outer_enum import OuterEnum
- from petstore_api.models.outer_enum_default_value import OuterEnumDefaultValue
- from petstore_api.models.outer_enum_integer import OuterEnumInteger
- from petstore_api.models.outer_enum_integer_default_value import OuterEnumIntegerDefaultValue
- from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
- from petstore_api.models.parent import Parent
- from petstore_api.models.parent_with_optional_dict import ParentWithOptionalDict
- from petstore_api.models.pet import Pet
- from petstore_api.models.pig import Pig
- from petstore_api.models.pony_sizes import PonySizes
- from petstore_api.models.poop_cleaning import PoopCleaning
- from petstore_api.models.primitive_string import PrimitiveString
- from petstore_api.models.property_map import PropertyMap
- from petstore_api.models.property_name_collision import PropertyNameCollision
- from petstore_api.models.read_only_first import ReadOnlyFirst
- from petstore_api.models.second_circular_all_of_ref import SecondCircularAllOfRef
- from petstore_api.models.second_ref import SecondRef
- from petstore_api.models.self_reference_model import SelfReferenceModel
- from petstore_api.models.single_ref_type import SingleRefType
- from petstore_api.models.special_character_enum import SpecialCharacterEnum
- from petstore_api.models.special_model_name import SpecialModelName
- from petstore_api.models.special_name import SpecialName
- from petstore_api.models.tag import Tag
- from petstore_api.models.task import Task
- from petstore_api.models.task_activity import TaskActivity
- from petstore_api.models.test_enum import TestEnum
- from petstore_api.models.test_enum_with_default import TestEnumWithDefault
- from petstore_api.models.test_error_responses_with_model400_response import TestErrorResponsesWithModel400Response
- from petstore_api.models.test_error_responses_with_model404_response import TestErrorResponsesWithModel404Response
- from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
- from petstore_api.models.test_model_with_enum_default import TestModelWithEnumDefault
- from petstore_api.models.test_object_for_multipart_requests_request_marker import TestObjectForMultipartRequestsRequestMarker
- from petstore_api.models.tiger import Tiger
- from petstore_api.models.type import Type
- from petstore_api.models.unnamed_dict_with_additional_model_list_properties import UnnamedDictWithAdditionalModelListProperties
- from petstore_api.models.unnamed_dict_with_additional_string_list_properties import UnnamedDictWithAdditionalStringListProperties
- from petstore_api.models.upload_file_with_additional_properties_request_object import UploadFileWithAdditionalPropertiesRequestObject
- from petstore_api.models.user import User
- from petstore_api.models.with_nested_one_of import WithNestedOneOf
-
-else:
- from lazy_imports import LazyModule, as_package, load
-
- load(
- LazyModule(
- *as_package(__file__),
- """# import models into model package
+# import models into model package
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
@@ -248,8 +126,3 @@ from petstore_api.models.upload_file_with_additional_properties_request_object i
from petstore_api.models.user import User
from petstore_api.models.with_nested_one_of import WithNestedOneOf
-""",
- name=__name__,
- doc=__doc__,
- )
- )
diff --git a/samples/openapi3/client/petstore/python/pyproject.toml b/samples/openapi3/client/petstore/python/pyproject.toml
index a466656e8b6..eed3d1a1ac4 100644
--- a/samples/openapi3/client/petstore/python/pyproject.toml
+++ b/samples/openapi3/client/petstore/python/pyproject.toml
@@ -17,7 +17,6 @@ dependencies = [
"pycryptodome (>=3.9.0)",
"pydantic (>=2)",
"typing-extensions (>=4.7.1)",
- "lazy-imports (>=1,<2)"
]
[project.urls]
diff --git a/samples/openapi3/client/petstore/python/requirements.txt b/samples/openapi3/client/petstore/python/requirements.txt
index ca83fcc1d25..a4d47b80f2c 100755
--- a/samples/openapi3/client/petstore/python/requirements.txt
+++ b/samples/openapi3/client/petstore/python/requirements.txt
@@ -4,4 +4,3 @@ pem >= 19.3.0
pycryptodome >= 3.9.0
pydantic >= 2
typing-extensions >= 4.7.1
-lazy-imports >= 1, < 2
diff --git a/samples/openapi3/client/petstore/python/setup.py b/samples/openapi3/client/petstore/python/setup.py
index 5edb21a69e6..35e7395c2b0 100755
--- a/samples/openapi3/client/petstore/python/setup.py
+++ b/samples/openapi3/client/petstore/python/setup.py
@@ -30,7 +30,6 @@ REQUIRES = [
"pycryptodome >= 3.9.0",
"pydantic >= 2",
"typing-extensions >= 4.7.1",
- "lazy-imports >= 1, < 2",
]
setup(
diff --git a/samples/openapi3/client/petstore/python/tests/test_api_client.py b/samples/openapi3/client/petstore/python/tests/test_api_client.py
index d0448d031f5..cb0ed9080f5 100644
--- a/samples/openapi3/client/petstore/python/tests/test_api_client.py
+++ b/samples/openapi3/client/petstore/python/tests/test_api_client.py
@@ -60,11 +60,11 @@ class ApiClientTests(unittest.TestCase):
def test_ignore_operation_servers(self):
config = petstore_api.Configuration(host=HOST)
client = petstore_api.ApiClient(config)
- user_api_instance = petstore_api.api.user_api.UserApi(client)
+ user_api_instance = petstore_api.UserApi(client)
config_ignore = petstore_api.Configuration(host=HOST, ignore_operation_servers=True)
client_ignore = petstore_api.ApiClient(config_ignore)
- user_api_instance_ignore = petstore_api.api.user_api.UserApi(client_ignore)
+ user_api_instance_ignore = petstore_api.UserApi(client_ignore)
params_to_serialize = {
'user': petstore_api.User(id=1, username='test'),