From 8b866560668e5343382126320e50dbbd0c99ca44 Mon Sep 17 00:00:00 2001 From: Matthew Giglio Date: Mon, 4 Nov 2024 19:41:35 -0500 Subject: [PATCH] mostly there --- .../pydantic_model/custom_config.py | 4 +- .../fern_aware_pydantic_model.py | 21 +- ...iscriminated_union_with_utils_generator.py | 39 +- .../pydantic_model_alias_generator.py | 6 +- .../pydantic_model/validators/__init__.py | 4 +- ..._custom_root_type_validators_generator.py} | 4 +- .../validator_generators/__init__.py | 6 +- ...c_custom_root_type_validator_generator.py} | 21 +- .../pydantic_codegen/pydantic_model.py | 34 +- .../.github/workflows/ci.yml | 63 + .../exhaustive/pydantic-v2-wrapped/.gitignore | 5 + .../.mock/definition/api.yml | 4 + .../.mock/definition/endpoints/container.yml | 48 + .../.mock/definition/endpoints/enum.yml | 12 + .../definition/endpoints/http-methods.yml | 43 + .../.mock/definition/endpoints/object.yml | 44 + .../.mock/definition/endpoints/params.yml | 57 + .../.mock/definition/endpoints/primitive.yml | 60 + .../.mock/definition/endpoints/union.yml | 12 + .../.mock/definition/general-errors.yml | 9 + .../.mock/definition/inlined-requests.yml | 25 + .../.mock/definition/no-auth.yml | 20 + .../.mock/definition/no-req-body.yml | 16 + .../.mock/definition/req-with-headers.yml | 14 + .../.mock/definition/types/enum.yml | 12 + .../.mock/definition/types/object.yml | 59 + .../.mock/definition/types/union.yml | 21 + .../.mock/fern.config.json | 1 + .../pydantic-v2-wrapped/.mock/generators.yml | 1 + .../exhaustive/pydantic-v2-wrapped/README.md | 140 + .../pydantic-v2-wrapped/pyproject.toml | 61 + .../pydantic-v2-wrapped/reference.md | 2829 ++++++ .../resolved-snippet-templates.md | 593 ++ .../snippet-templates.json | 8324 +++++++++++++++++ .../pydantic-v2-wrapped/snippet.json | 512 + .../pydantic-v2-wrapped/src/seed/__init__.py | 21 + .../pydantic-v2-wrapped/src/seed/client.py | 128 + .../src/seed/core/__init__.py | 47 + .../src/seed/core/api_error.py | 15 + .../src/seed/core/client_wrapper.py | 78 + .../src/seed/core/datetime_utils.py | 28 + .../pydantic-v2-wrapped/src/seed/core/file.py | 62 + .../src/seed/core/http_client.py | 487 + .../src/seed/core/jsonable_encoder.py | 101 + .../src/seed/core/pydantic_utilities.py | 296 + .../src/seed/core/query_encoder.py | 58 + .../src/seed/core/remove_none_from_dict.py | 11 + .../src/seed/core/request_options.py | 35 + .../src/seed/core/serialization.py | 272 + .../src/seed/endpoints/__init__.py | 5 + .../src/seed/endpoints/client.py | 42 + .../src/seed/endpoints/container/__init__.py | 2 + .../src/seed/endpoints/container/client.py | 834 ++ .../src/seed/endpoints/enum/__init__.py | 2 + .../src/seed/endpoints/enum/client.py | 127 + .../seed/endpoints/http_methods/__init__.py | 2 + .../src/seed/endpoints/http_methods/client.py | 701 ++ .../src/seed/endpoints/object/__init__.py | 2 + .../src/seed/endpoints/object/client.py | 1083 +++ .../src/seed/endpoints/params/__init__.py | 2 + .../src/seed/endpoints/params/client.py | 561 ++ .../src/seed/endpoints/primitive/__init__.py | 2 + .../src/seed/endpoints/primitive/client.py | 969 ++ .../src/seed/endpoints/union/__init__.py | 2 + .../src/seed/endpoints/union/client.py | 136 + .../src/seed/general_errors/__init__.py | 6 + .../seed/general_errors/errors/__init__.py | 5 + .../general_errors/errors/bad_request_body.py | 9 + .../src/seed/general_errors/types/__init__.py | 5 + .../types/bad_object_request_info.py | 11 + .../src/seed/inlined_requests/__init__.py | 2 + .../src/seed/inlined_requests/client.py | 235 + .../src/seed/no_auth/__init__.py | 2 + .../src/seed/no_auth/client.py | 152 + .../src/seed/no_req_body/__init__.py | 2 + .../src/seed/no_req_body/client.py | 200 + .../pydantic-v2-wrapped/src/seed/py.typed | 0 .../src/seed/req_with_headers/__init__.py | 2 + .../src/seed/req_with_headers/client.py | 143 + .../src/seed/types/__init__.py | 43 + .../src/seed/types/enum/__init__.py | 6 + .../src/seed/types/enum/errors/__init__.py | 5 + .../types/enum/errors/error_with_enum_body.py | 9 + .../src/seed/types/enum/types/__init__.py | 5 + .../seed/types/enum/types/weather_report.py | 5 + .../src/seed/types/object/__init__.py | 31 + .../src/seed/types/object/errors/__init__.py | 13 + ...nested_object_with_optional_field_error.py | 9 + ...nested_object_with_required_field_error.py | 9 + .../object_with_optional_field_error.py | 9 + .../object_with_required_field_error.py | 9 + .../src/seed/types/object/types/__init__.py | 19 + .../types/object/types/double_optional.py | 16 + .../nested_object_with_optional_field.py | 17 + .../nested_object_with_required_field.py | 15 + .../object/types/object_with_map_of_map.py | 13 + .../types/object_with_optional_field.py | 31 + .../types/object_with_required_field.py | 11 + .../seed/types/object/types/optional_alias.py | 19 + .../src/seed/types/union/__init__.py | 6 + .../src/seed/types/union/errors/__init__.py | 5 + .../union/errors/error_with_union_body.py | 9 + .../src/seed/types/union/types/__init__.py | 7 + .../src/seed/types/union/types/animal.py | 27 + .../src/seed/types/union/types/cat.py | 14 + .../src/seed/types/union/types/dog.py | 14 + .../pydantic-v2-wrapped/src/seed/version.py | 3 + .../pydantic-v2-wrapped/tests/__init__.py | 2 + .../pydantic-v2-wrapped/tests/conftest.py | 16 + .../tests/custom/test_client.py | 7 + .../tests/endpoints/__init__.py | 2 + .../tests/endpoints/test_container.py | 95 + .../tests/endpoints/test_enum.py | 16 + .../tests/endpoints/test_http_methods.py | 172 + .../tests/endpoints/test_object.py | 382 + .../tests/endpoints/test_params.py | 65 + .../tests/endpoints/test_primitive.py | 106 + .../tests/endpoints/test_union.py | 19 + .../tests/test_inlined_requests.py | 83 + .../pydantic-v2-wrapped/tests/test_no_auth.py | 16 + .../tests/test_no_req_body.py | 54 + .../tests/test_req_with_headers.py | 25 + .../pydantic-v2-wrapped/tests/utilities.py | 162 + .../tests/utils/__init__.py | 2 + .../tests/utils/assets/models/__init__.py | 21 + .../tests/utils/assets/models/circle.py | 11 + .../tests/utils/assets/models/color.py | 7 + .../assets/models/object_with_defaults.py | 16 + .../models/object_with_optional_field.py | 34 + .../tests/utils/assets/models/shape.py | 26 + .../tests/utils/assets/models/square.py | 11 + .../assets/models/undiscriminated_shape.py | 9 + .../tests/utils/test_http_client.py | 61 + .../tests/utils/test_query_encoding.py | 37 + .../tests/utils/test_serialization.py | 72 + seed/python-sdk/seed.yml | 5 + 136 files changed, 21856 insertions(+), 66 deletions(-) rename generators/python/src/fern_python/generators/pydantic_model/validators/{pydantic_v1_custom_root_type_validators_generator.py => pydantic_custom_root_type_validators_generator.py} (89%) rename generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/{pydantic_v1_custom_root_type_validator_generator.py => pydantic_custom_root_type_validator_generator.py} (77%) create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.github/workflows/ci.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.gitignore create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/api.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/container.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/enum.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/http-methods.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/object.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/params.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/primitive.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/union.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/general-errors.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/inlined-requests.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-auth.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-req-body.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/req-with-headers.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/enum.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/object.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/union.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/fern.config.json create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/generators.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/pyproject.toml create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/reference.md create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/resolved-snippet-templates.md create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet-templates.json create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/api_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/client_wrapper.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/datetime_utils.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/file.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/http_client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/jsonable_encoder.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/pydantic_utilities.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/query_encoder.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/remove_none_from_dict.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/request_options.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/serialization.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/bad_request_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/bad_object_request_info.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/py.typed create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/error_with_enum_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/weather_report.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_optional_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_required_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_optional_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_required_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/double_optional.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_optional_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_required_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_map_of_map.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_optional_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_required_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/optional_alias.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/error_with_union_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/animal.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/cat.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/dog.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/version.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/conftest.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_container.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_enum.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_http_methods.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_object.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_params.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_primitive.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_union.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_inlined_requests.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_auth.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_req_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_req_with_headers.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utilities.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/circle.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/color.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_defaults.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_optional_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/shape.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/square.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/undiscriminated_shape.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_http_client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_query_encoding.py create mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_serialization.py diff --git a/generators/python/src/fern_python/generators/pydantic_model/custom_config.py b/generators/python/src/fern_python/generators/pydantic_model/custom_config.py index 136cabbc5e5..198949f2311 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/custom_config.py +++ b/generators/python/src/fern_python/generators/pydantic_model/custom_config.py @@ -52,9 +52,9 @@ def check_wrapped_aliases_v1_only(self) -> Self: version_compat = self.version use_wrapped_aliases = self.wrapped_aliases - if use_wrapped_aliases and version_compat != PydanticVersionCompatibility.V1: + if use_wrapped_aliases and version_compat == PydanticVersionCompatibility.Both: raise ValueError( - "Wrapped aliases are only supported in Pydantic V1, please update your `version` field to be 'v1' to continue using wrapped aliases." + "Wrapped aliases are not supported for `both`, please update your `version` field to be 'v1' or `v2` to continue using wrapped aliases." ) if self.enum_type != "literals": diff --git a/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py b/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py index 06388894a53..62dfcf5c5d5 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py +++ b/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py @@ -262,22 +262,22 @@ def add_method_unsafe( ) -> AST.FunctionDeclaration: return self._pydantic_model.add_method(declaration=declaration, decorator=decorator) - def set_root_type_v1_only( + def set_root_type( self, root_type: ir_types.TypeReference, annotation: Optional[AST.Expression] = None, is_forward_ref: bool = False, ) -> None: - self.set_root_type_unsafe_v1_only( + self.set_root_type_unsafe( root_type=self.get_type_hint_for_type_reference(root_type), annotation=annotation, is_forward_ref=is_forward_ref, ) - def set_root_type_unsafe_v1_only( + def set_root_type_unsafe( self, root_type: AST.TypeHint, annotation: Optional[AST.Expression] = None, is_forward_ref: bool = False ) -> None: - self._pydantic_model.set_root_type_unsafe_v1_only(root_type=root_type, annotation=annotation) + self._pydantic_model.set_root_type_unsafe(root_type=root_type, annotation=annotation) def add_ghost_reference(self, type_id: ir_types.TypeId) -> None: self._pydantic_model.add_ghost_reference( @@ -286,10 +286,7 @@ def add_ghost_reference(self, type_id: ir_types.TypeId) -> None: def finish(self) -> None: if self._custom_config.include_validators: - if ( - self._pydantic_model._v1_root_type is None - and self._custom_config.version == PydanticVersionCompatibility.V1 - ): + if self._pydantic_model.root_type is None: self._pydantic_model.add_partial_class() self._get_validators_generator().add_validators() if self._model_contains_forward_refs or self._force_update_forward_refs: @@ -309,11 +306,11 @@ def finish(self) -> None: self._pydantic_model.finish() def _get_validators_generator(self) -> ValidatorsGenerator: - v1_root_type = self._pydantic_model.get_root_type_unsafe_v1_only() - if v1_root_type is not None and self._custom_config.version == PydanticVersionCompatibility.V1: + root_type = self._pydantic_model.get_root_type_unsafe() + if root_type is not None: return PydanticV1CustomRootTypeValidatorsGenerator( model=self._pydantic_model, - root_type=v1_root_type, + root_type=root_type, ) else: unique_name = [] @@ -374,4 +371,4 @@ def __exit__( excinst: Optional[BaseException], exctb: Optional[TracebackType], ) -> None: - self.finish() + self.finish() \ No newline at end of file diff --git a/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/discriminated_union/discriminated_union_with_utils_generator.py b/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/discriminated_union/discriminated_union_with_utils_generator.py index d384a10d06b..d5aa5521ae7 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/discriminated_union/discriminated_union_with_utils_generator.py +++ b/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/discriminated_union/discriminated_union_with_utils_generator.py @@ -362,27 +362,26 @@ def get_dict_method(writer: AST.NodeWriter) -> None: ) ) - if self._custom_config.version == PydanticVersionCompatibility.V1: - external_pydantic_model.set_root_type_unsafe_v1_only( - is_forward_ref=True, - root_type=root_type, - annotation=AST.Expression( - AST.FunctionInvocation( - function_definition=Pydantic.Field(), - kwargs=[ - ( - "discriminator", - AST.Expression( - f'"{self._get_discriminant_attr_name()}"', - ), - ) - ], - ) + external_pydantic_model.set_root_type_unsafe( + is_forward_ref=True, + root_type=root_type, + annotation=AST.Expression( + AST.FunctionInvocation( + function_definition=Pydantic.Field(), + kwargs=[ + ( + "discriminator", + AST.Expression( + f'"{self._get_discriminant_attr_name()}"', + ), + ) + ], ) - # can't use discriminator without single variant pydantic models - # https://github.com/pydantic/pydantic/pull/3639 - if len(internal_single_union_types) != 1 else None, ) + # can't use discriminator without single variant pydantic models + # https://github.com/pydantic/pydantic/pull/3639 + if len(internal_single_union_types) != 1 else None, + ) def _create_body_writer( self, @@ -499,4 +498,4 @@ def assert_never(arg: Never) -> Never: def get_field_name_for_single_property(property: ir_types.SingleUnionTypeProperty) -> str: - return property.name.name.snake_case.safe_name + return property.name.name.snake_case.safe_name \ No newline at end of file diff --git a/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/pydantic_models/pydantic_model_alias_generator.py b/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/pydantic_models/pydantic_model_alias_generator.py index 9210a3ae72f..6c6030411e4 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/pydantic_models/pydantic_model_alias_generator.py +++ b/generators/python/src/fern_python/generators/pydantic_model/type_declaration_handler/pydantic_models/pydantic_model_alias_generator.py @@ -50,8 +50,6 @@ def generate( should_export=True, ) else: - # NOTE: We validate the config to ensure wrapped aliases are only available for Pydantic V1 users. - # As such, we force the root field to be __root__ as opposed to conditional based on the Pydantic version. BUILDER_PARAMETER_NAME = "value" with FernAwarePydanticModel( class_name=self._context.get_class_name_for_type_id(self._name.type_id, as_request=False), @@ -62,7 +60,7 @@ def generate( docstring=self._docs, snippet=self._snippet, ) as pydantic_model: - pydantic_model.set_root_type_v1_only(self._alias.alias_of) + pydantic_model.set_root_type(self._alias.alias_of) pydantic_model.add_method( name=self._get_getter_name(self._alias.alias_of), parameters=[], @@ -147,4 +145,4 @@ def __init__( as_request=False, ) - # generate_snippet delegates to the parent class AliasSnippetGenerator + # generate_snippet delegates to the parent class AliasSnippetGenerator \ No newline at end of file diff --git a/generators/python/src/fern_python/generators/pydantic_model/validators/__init__.py b/generators/python/src/fern_python/generators/pydantic_model/validators/__init__.py index f231cc244b0..ce1298b2246 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/validators/__init__.py +++ b/generators/python/src/fern_python/generators/pydantic_model/validators/__init__.py @@ -1,7 +1,7 @@ -from .pydantic_v1_custom_root_type_validators_generator import ( +from .pydantic_custom_root_type_validators_generator import ( PydanticV1CustomRootTypeValidatorsGenerator, ) from .pydantic_validators_generator import PydanticValidatorsGenerator from .validators_generator import ValidatorsGenerator -__all__ = ["ValidatorsGenerator", "PydanticValidatorsGenerator", "PydanticV1CustomRootTypeValidatorsGenerator"] +__all__ = ["ValidatorsGenerator", "PydanticValidatorsGenerator", "PydanticV1CustomRootTypeValidatorsGenerator"] \ No newline at end of file diff --git a/generators/python/src/fern_python/generators/pydantic_model/validators/pydantic_v1_custom_root_type_validators_generator.py b/generators/python/src/fern_python/generators/pydantic_model/validators/pydantic_custom_root_type_validators_generator.py similarity index 89% rename from generators/python/src/fern_python/generators/pydantic_model/validators/pydantic_v1_custom_root_type_validators_generator.py rename to generators/python/src/fern_python/generators/pydantic_model/validators/pydantic_custom_root_type_validators_generator.py index 53e6e775ada..2e676aeb1a8 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/validators/pydantic_v1_custom_root_type_validators_generator.py +++ b/generators/python/src/fern_python/generators/pydantic_model/validators/pydantic_custom_root_type_validators_generator.py @@ -4,7 +4,7 @@ from fern_python.pydantic_codegen import PydanticModel from .validator_generators import ( - PydanticV1CustomRootTypeValidatorGenerator, + PydanticCustomRootTypeValidatorGenerator, ValidatorGenerator, ) from .validators_generator import ValidatorsGenerator @@ -14,7 +14,7 @@ class PydanticV1CustomRootTypeValidatorsGenerator(ValidatorsGenerator): def __init__(self, root_type: AST.TypeHint, model: PydanticModel): super().__init__(model=model) self._root_type = root_type - self._root_type_generator = PydanticV1CustomRootTypeValidatorGenerator( + self._root_type_generator = PydanticCustomRootTypeValidatorGenerator( root_type=root_type, model=model, reference_to_validators_class=self._get_reference_to_validators_class(), diff --git a/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/__init__.py b/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/__init__.py index fca17e94347..47f1f65ec71 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/__init__.py +++ b/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/__init__.py @@ -1,6 +1,6 @@ from .field_validator_generator import FieldValidatorGenerator -from .pydantic_v1_custom_root_type_validator_generator import ( - PydanticV1CustomRootTypeValidatorGenerator, +from .pydantic_custom_root_type_validator_generator import ( + PydanticCustomRootTypeValidatorGenerator, ) from .root_validator_generator import RootValidatorGenerator from .validator_generator import ValidatorGenerator @@ -9,5 +9,5 @@ "ValidatorGenerator", "FieldValidatorGenerator", "RootValidatorGenerator", - "PydanticV1CustomRootTypeValidatorGenerator", + "PydanticCustomRootTypeValidatorGenerator", ] diff --git a/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/pydantic_v1_custom_root_type_validator_generator.py b/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/pydantic_custom_root_type_validator_generator.py similarity index 77% rename from generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/pydantic_v1_custom_root_type_validator_generator.py rename to generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/pydantic_custom_root_type_validator_generator.py index 5a088216ae5..9b9da523920 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/pydantic_v1_custom_root_type_validator_generator.py +++ b/generators/python/src/fern_python/generators/pydantic_model/validators/validator_generators/pydantic_custom_root_type_validator_generator.py @@ -1,12 +1,13 @@ from typing import Tuple from fern_python.codegen import AST +from fern_python.external_dependencies.pydantic import PydanticVersionCompatibility from fern_python.pydantic_codegen import PydanticModel from .validator_generator import ValidatorGenerator -class PydanticV1CustomRootTypeValidatorGenerator(ValidatorGenerator): +class PydanticCustomRootTypeValidatorGenerator(ValidatorGenerator): _DECORATOR_FUNCTION_NAME = "validate" _VALIDATOR_CLASS_VALIDATORS_CLASS_VAR = "_validators" @@ -23,6 +24,7 @@ def add_validator_to_model(self) -> None: def _write_validator_body(self, writer: AST.NodeWriter) -> None: ROOT_VARIABLE_NAME = "value" INDIVIDUAL_VALIDATOR_NAME = "validator" + ROOT_PROPERTY_NAME = self._get_root_property_name() writer.write(f"{ROOT_VARIABLE_NAME} = ") writer.write_node( @@ -33,7 +35,7 @@ def _write_validator_body(self, writer: AST.NodeWriter) -> None: ), args=[ AST.Expression(self._root_type), - AST.Expression(f'{PydanticModel.VALIDATOR_VALUES_PARAMETER_NAME}.get("__root__")'), + AST.Expression(f'{PydanticModel.VALIDATOR_VALUES_PARAMETER_NAME}.get("{ROOT_PROPERTY_NAME}")'), ], ), ) @@ -44,7 +46,7 @@ def _write_validator_body(self, writer: AST.NodeWriter) -> None: ".".join( ( *self._reference_to_validators_class, - PydanticV1CustomRootTypeValidatorGenerator._VALIDATOR_CLASS_VALIDATORS_CLASS_VAR, + PydanticCustomRootTypeValidatorGenerator._VALIDATOR_CLASS_VALIDATORS_CLASS_VAR, ) ) + ":" @@ -62,7 +64,7 @@ def _write_validator_body(self, writer: AST.NodeWriter) -> None: ) writer.write_line() writer.write_line( - "return " + f'{{ **{PydanticModel.VALIDATOR_VALUES_PARAMETER_NAME}, "__root__": {ROOT_VARIABLE_NAME} }}' + f"return {{ **{PydanticModel.VALIDATOR_VALUES_PARAMETER_NAME}, '{ROOT_PROPERTY_NAME}': {ROOT_VARIABLE_NAME} }}" ) def add_to_validators_class(self, validators_class: AST.ClassDeclaration) -> None: @@ -71,20 +73,20 @@ def add_to_validators_class(self, validators_class: AST.ClassDeclaration) -> Non validator_type = AST.TypeHint.callable([self._root_type], self._root_type) validators_class.add_class_var( AST.VariableDeclaration( - name=PydanticV1CustomRootTypeValidatorGenerator._VALIDATOR_CLASS_VALIDATORS_CLASS_VAR, + name=PydanticCustomRootTypeValidatorGenerator._VALIDATOR_CLASS_VALIDATORS_CLASS_VAR, type_hint=AST.TypeHint.class_var(AST.TypeHint.list(validator_type)), initializer=AST.Expression("[]"), ) ) validators_class.add_method( declaration=AST.FunctionDeclaration( - name=PydanticV1CustomRootTypeValidatorGenerator._DECORATOR_FUNCTION_NAME, + name=PydanticCustomRootTypeValidatorGenerator._DECORATOR_FUNCTION_NAME, signature=AST.FunctionSignature( parameters=[AST.FunctionParameter(name=VALIDATOR_PARAMETER, type_hint=validator_type)], return_type=AST.TypeHint.none(), ), body=AST.CodeWriter( - f"cls.{PydanticV1CustomRootTypeValidatorGenerator._VALIDATOR_CLASS_VALIDATORS_CLASS_VAR}" + f"cls.{PydanticCustomRootTypeValidatorGenerator._VALIDATOR_CLASS_VALIDATORS_CLASS_VAR}" + f".append({VALIDATOR_PARAMETER})" ), ), @@ -94,7 +96,7 @@ def add_to_validators_class(self, validators_class: AST.ClassDeclaration) -> Non def write_example_for_docstring(self, writer: AST.NodeWriter) -> None: reference_to_decorator = ".".join( - (*self._reference_to_validators_class, PydanticV1CustomRootTypeValidatorGenerator._DECORATOR_FUNCTION_NAME) + (*self._reference_to_validators_class, PydanticCustomRootTypeValidatorGenerator._DECORATOR_FUNCTION_NAME) ) with writer.indent(): @@ -109,3 +111,6 @@ def write_example_for_docstring(self, writer: AST.NodeWriter) -> None: with writer.indent(): writer.write_line("...") + + def _get_root_property_name(self) -> str: + return "__root__" if self._model._version == PydanticVersionCompatibility.V1 else "root" \ No newline at end of file diff --git a/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py b/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py index 284c866fdde..508168f4c9f 100644 --- a/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py +++ b/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py @@ -61,7 +61,7 @@ def __init__( ) self._has_aliases = False self._version = version - self._v1_root_type: Optional[AST.TypeHint] = None + self._root_type: Optional[AST.TypeHint] = None self._fields: List[PydanticField] = [] self._extra_fields = extra_fields self._frozen = frozen @@ -250,15 +250,16 @@ def add_root_validator( ), ) - def set_root_type_unsafe_v1_only( + def set_root_type_unsafe( self, root_type: AST.TypeHint, annotation: Optional[AST.Expression] = None ) -> None: - if self._version != PydanticVersionCompatibility.V1: - raise RuntimeError("Overriding root types is only available in Pydantic v1") - - if self._v1_root_type is not None: + if self._version == PydanticVersionCompatibility.Both: + raise RuntimeError("Overriding root types is only available in Pydantic v1 or v2") + + if self._root_type is not None: raise RuntimeError("__root__ was already added") - self._v1_root_type = root_type + + self.root_type = root_type root_type_with_annotation = ( AST.TypeHint.annotated( @@ -269,12 +270,19 @@ def set_root_type_unsafe_v1_only( else root_type ) - self._class_declaration.add_statement( - AST.VariableDeclaration(name="__root__", type_hint=root_type_with_annotation) - ) + if self._version == PydanticVersionCompatibility.V1: + self._class_declaration.add_statement( + AST.VariableDeclaration(name="__root__", type_hint=root_type_with_annotation) + ) + + if self._version == PydanticVersionCompatibility.V2: + self._class_declaration.add_statement( + AST.VariableDeclaration(name="root", type_hint=root_type_with_annotation) + ) + - def get_root_type_unsafe_v1_only(self) -> Optional[AST.TypeHint]: - return self._v1_root_type + def get_root_type_unsafe(self) -> Optional[AST.TypeHint]: + return self.root_type def add_inner_class(self, inner_class: AST.ClassDeclaration) -> None: self._class_declaration.add_class(declaration=inner_class) @@ -508,4 +516,4 @@ def write(writer: AST.NodeWriter) -> None: def get_named_import_or_throw(reference: AST.Reference) -> str: if reference.import_ is None or reference.import_.named_import is None: raise RuntimeError("No named import defined on reference") - return reference.import_.named_import + return reference.import_.named_import \ No newline at end of file diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.github/workflows/ci.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.github/workflows/ci.yml new file mode 100644 index 00000000000..b7316b8cab7 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: ci + +on: [push] +jobs: + compile: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Compile + run: poetry run mypy . + test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + + - name: Install Fern + run: npm install -g fern-api + - name: Test + run: fern test --command "poetry run pytest -rP ." + + publish: + needs: [compile, test] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Publish to pypi + run: | + poetry config repositories.remote + poetry --no-interaction -v publish --build --repository remote --username "$" --password "$" + env: + : ${{ secrets. }} + : ${{ secrets. }} diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.gitignore b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.gitignore new file mode 100644 index 00000000000..0da665feeef --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.gitignore @@ -0,0 +1,5 @@ +dist/ +.mypy_cache/ +__pycache__/ +poetry.toml +.ruff_cache/ diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/api.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/api.yml new file mode 100644 index 00000000000..dd65915538f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/api.yml @@ -0,0 +1,4 @@ +name: exhaustive +auth: bearer +error-discrimination: + strategy: status-code diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/container.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/container.yml new file mode 100644 index 00000000000..165a039dc65 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/container.yml @@ -0,0 +1,48 @@ +imports: + objects: ../types/object.yml + +service: + auth: true + base-path: /container + endpoints: + getAndReturnListOfPrimitives: + path: /list-of-primitives + method: POST + request: list + response: list + + getAndReturnListOfObjects: + path: /list-of-objects + method: POST + request: list + response: list + + getAndReturnSetOfPrimitives: + path: /set-of-primitives + method: POST + request: set + response: set + + getAndReturnSetOfObjects: + path: /set-of-objects + method: POST + request: set + response: set + + getAndReturnMapPrimToPrim: + path: /map-prim-to-prim + method: POST + request: map + response: map + + getAndReturnMapOfPrimToObject: + path: /map-prim-to-object + method: POST + request: map + response: map + + getAndReturnOptional: + path: /opt-objects + method: POST + request: optional + response: optional diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/enum.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/enum.yml new file mode 100644 index 00000000000..335a0889cc7 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/enum.yml @@ -0,0 +1,12 @@ +imports: + enums: ../types/enum.yml + +service: + auth: true + base-path: /enum + endpoints: + getAndReturnEnum: + method: POST + path: "" + request: enums.WeatherReport + response: enums.WeatherReport diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/http-methods.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/http-methods.yml new file mode 100644 index 00000000000..51a54c0802c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/http-methods.yml @@ -0,0 +1,43 @@ +imports: + objects: ../types/object.yml + +service: + auth: true + base-path: /http-methods + + endpoints: + testGet: + method: GET + path: /{id} + path-parameters: + id: string + response: string + + testPost: + method: POST + path: "" + request: objects.ObjectWithRequiredField + response: objects.ObjectWithOptionalField + + testPut: + method: PUT + path: /{id} + path-parameters: + id: string + request: objects.ObjectWithRequiredField + response: objects.ObjectWithOptionalField + + testPatch: + method: PATCH + path: /{id} + path-parameters: + id: string + request: objects.ObjectWithOptionalField + response: objects.ObjectWithOptionalField + + testDelete: + method: DELETE + path: /{id} + path-parameters: + id: string + response: boolean diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/object.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/object.yml new file mode 100644 index 00000000000..9fad6aa2776 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/object.yml @@ -0,0 +1,44 @@ +imports: + objects: ../types/object.yml + +service: + auth: true + base-path: /object + endpoints: + getAndReturnWithOptionalField: + path: /get-and-return-with-optional-field + method: POST + request: objects.ObjectWithOptionalField + response: objects.ObjectWithOptionalField + + getAndReturnWithRequiredField: + path: /get-and-return-with-required-field + method: POST + request: objects.ObjectWithRequiredField + response: objects.ObjectWithRequiredField + + getAndReturnWithMapOfMap: + path: /get-and-return-with-map-of-map + method: POST + request: objects.ObjectWithMapOfMap + response: objects.ObjectWithMapOfMap + + getAndReturnNestedWithOptionalField: + path: /get-and-return-nested-with-optional-field + method: POST + request: objects.NestedObjectWithOptionalField + response: objects.NestedObjectWithOptionalField + + getAndReturnNestedWithRequiredField: + path: /get-and-return-nested-with-required-field/{string} + method: POST + path-parameters: + string: string + request: objects.NestedObjectWithRequiredField + response: objects.NestedObjectWithRequiredField + + getAndReturnNestedWithRequiredFieldAsList: + path: /get-and-return-nested-with-required-field-list + method: POST + request: list + response: objects.NestedObjectWithRequiredField diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/params.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/params.yml new file mode 100644 index 00000000000..7766547ad79 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/params.yml @@ -0,0 +1,57 @@ +service: + auth: true + base-path: /params + endpoints: + getWithPath: + docs: GET with path param + path: /path/{param} + path-parameters: + param: string + method: GET + response: string + + getWithQuery: + docs: GET with query param + path: "" + method: GET + request: + name: GetWithQuery + query-parameters: + query: string #mandatory for test + number: integer + + getWithAllowMultipleQuery: + docs: GET with multiple of same query param + path: "" + method: GET + request: + name: GetWithMultipleQuery + query-parameters: + query: + type: string + allow-multiple: true + numer: + type: integer + allow-multiple: true + + getWithPathAndQuery: + docs: GET with path and query params + path: /path-query/{param} + path-parameters: + param: string + method: GET + request: + name: GetWithPathAndQuery + query-parameters: + query: string #mandatory for test + + modifyWithPath: + docs: PUT to update with path param + path: /path/{param} + path-parameters: + param: string + method: PUT + request: + name: ModifyResourceAtPath + body: string + response: string diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/primitive.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/primitive.yml new file mode 100644 index 00000000000..8dd7674164c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/primitive.yml @@ -0,0 +1,60 @@ +imports: + objects: ../types/object.yml + +service: + auth: true + base-path: /primitive + endpoints: + getAndReturnString: + path: /string + method: POST + request: string + response: string + + getAndReturnInt: + path: /integer + method: POST + request: integer + response: integer + + getAndReturnLong: + path: /long + method: POST + request: long + response: long + + getAndReturnDouble: + path: /double + method: POST + request: double + response: double + + getAndReturnBool: + path: /boolean + method: POST + request: boolean + response: boolean + + getAndReturnDatetime: + path: /datetime + method: POST + request: datetime + response: datetime + + getAndReturnDate: + path: /date + method: POST + request: date + response: date + + getAndReturnUUID: + path: /uuid + method: POST + request: uuid + response: uuid + + getAndReturnBase64: + path: /base64 + method: POST + request: base64 + response: base64 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/union.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/union.yml new file mode 100644 index 00000000000..ce9021160d7 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/endpoints/union.yml @@ -0,0 +1,12 @@ +imports: + unions: ../types/union.yml + +service: + auth: true + base-path: /union + endpoints: + getAndReturnUnion: + method: POST + path: "" + request: unions.Animal + response: unions.Animal diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/general-errors.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/general-errors.yml new file mode 100644 index 00000000000..5fbf9cfc417 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/general-errors.yml @@ -0,0 +1,9 @@ +errors: + BadRequestBody: + status-code: 400 + type: BadObjectRequestInfo + +types: + BadObjectRequestInfo: + properties: + message: string diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/inlined-requests.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/inlined-requests.yml new file mode 100644 index 00000000000..9347fe7e335 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/inlined-requests.yml @@ -0,0 +1,25 @@ +imports: + objects: ./types/object.yml + errors: ./general-errors.yml + +# test req bodies, path params, query params, multiple query params, etc. +# test union and enum as well + +service: + auth: false + base-path: /req-bodies + endpoints: + postWithObjectBodyandResponse: + docs: POST with custom object in request body, response is an object + path: /object + method: POST + request: + name: PostWithObjectBody + body: + properties: + string: string + integer: integer + NestedObject: objects.ObjectWithOptionalField + response: objects.ObjectWithOptionalField + errors: + - errors.BadRequestBody diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-auth.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-auth.yml new file mode 100644 index 00000000000..e3c33ed7fab --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-auth.yml @@ -0,0 +1,20 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json + +imports: + general-errors: ./general-errors.yml + +service: + auth: false + base-path: /no-auth + endpoints: + postWithNoAuth: + auth: false + docs: POST request with no auth + path: "" + method: POST + request: + name: PostWithNoAuth + body: unknown + response: boolean + errors: + - general-errors.BadRequestBody diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-req-body.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-req-body.yml new file mode 100644 index 00000000000..daffd9a495c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/no-req-body.yml @@ -0,0 +1,16 @@ +imports: + objects: ./types/object.yml + +service: + auth: true + base-path: /no-req-body + endpoints: + getWithNoRequestBody: + path: "" + method: GET + response: objects.ObjectWithOptionalField + + postWithNoRequestBody: + path: "" + method: POST + response: string diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/req-with-headers.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/req-with-headers.yml new file mode 100644 index 00000000000..9e49725782f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/req-with-headers.yml @@ -0,0 +1,14 @@ +service: + base-path: /test-headers + auth: true + headers: + X-TEST-SERVICE-HEADER: string + endpoints: + getWithCustomHeader: + path: /custom-header + method: POST + request: + name: ReqWithHeaders + headers: + X-TEST-ENDPOINT-HEADER: string + body: string diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/enum.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/enum.yml new file mode 100644 index 00000000000..a90686092e9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/enum.yml @@ -0,0 +1,12 @@ +types: + WeatherReport: + enum: + - SUNNY + - CLOUDY + - RAINING + - SNOWING + +errors: + ErrorWithEnumBody: + status-code: 400 + type: WeatherReport #does this even make sense? the type of the error body would be enum, and it could only be one of the 4 values? diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/object.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/object.yml new file mode 100644 index 00000000000..a165ed94cfe --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/object.yml @@ -0,0 +1,59 @@ +types: + ObjectWithOptionalField: #generic object that supports any type, makes it easier to use when testing + properties: + string: + type: optional + docs: This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + integer: optional + long: optional + double: optional + bool: optional + datetime: optional + date: optional + uuid: optional + base64: optional + list: optional> + set: optional> + map: optional> + bigint: optional + + ObjectWithRequiredField: + properties: + string: string + + ObjectWithMapOfMap: + properties: + map: map> + + NestedObjectWithOptionalField: + properties: + string: optional + NestedObject: optional + + NestedObjectWithRequiredField: + properties: + string: string + NestedObject: ObjectWithOptionalField + + DoubleOptional: + properties: + optionalAlias: optional + + OptionalAlias: optional + +errors: + ObjectWithOptionalFieldError: + status-code: 400 + type: ObjectWithOptionalField + + ObjectWithRequiredFieldError: + status-code: 400 + type: ObjectWithRequiredField + + NestedObjectWithOptionalFieldError: + status-code: 400 + type: NestedObjectWithOptionalField + + NestedObjectWithRequiredFieldError: + status-code: 400 + type: NestedObjectWithRequiredField diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/union.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/union.yml new file mode 100644 index 00000000000..99ce8c75ed0 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/definition/types/union.yml @@ -0,0 +1,21 @@ +types: + Animal: + discriminant: animal + union: + dog: Dog + cat: Cat + + Dog: + properties: + name: string + likesToWoof: boolean + + Cat: + properties: + name: string + likesToMeow: boolean + +errors: + ErrorWithUnionBody: + status-code: 400 + type: Animal #has to send either dog or cat object in error body diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/fern.config.json b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/fern.config.json new file mode 100644 index 00000000000..4c8e54ac313 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/fern.config.json @@ -0,0 +1 @@ +{"organization": "fern-test", "version": "*"} \ No newline at end of file diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/generators.yml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/generators.yml new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.mock/generators.yml @@ -0,0 +1 @@ +{} diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md new file mode 100644 index 00000000000..1088758f90b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md @@ -0,0 +1,140 @@ +# Seed Python Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Seed%2FPython) +[![pypi](https://img.shields.io/pypi/v/fern_exhaustive)](https://pypi.python.org/pypi/fern_exhaustive) + +The Seed Python library provides convenient access to the Seed API from Python. + +## Installation + +```sh +pip install fern_exhaustive +``` + +## Reference + +A full reference for this library is available [here](./reference.md). + +## Usage + +Instantiate and use the client with the following: + +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_list_of_primitives( + request=["string", "string"], +) +``` + +## Async Client + +The SDK also exports an `async` client so that you can make non-blocking calls to our API. + +```python +import asyncio + +from seed import AsyncSeedExhaustive + +client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) + + +async def main() -> None: + await client.endpoints.container.get_and_return_list_of_primitives( + request=["string", "string"], + ) + + +asyncio.run(main()) +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error +will be thrown. + +```python +from seed.core.api_error import ApiError + +try: + client.endpoints.container.get_and_return_list_of_primitives(...) +except ApiError as e: + print(e.status_code) + print(e.body) +``` + +## Advanced + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retriable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retriable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) + +Use the `max_retries` request option to configure this behavior. + +```python +client.endpoints.container.get_and_return_list_of_primitives(..., request_options={ + "max_retries": 1 +}) +``` + +### Timeouts + +The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. + +```python + +from seed import SeedExhaustive + +client = SeedExhaustive( + ..., + timeout=20.0, +) + + +# Override timeout for a specific method +client.endpoints.container.get_and_return_list_of_primitives(..., request_options={ + "timeout_in_seconds": 1 +}) +``` + +### Custom Client + +You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies +and transports. +```python +import httpx +from seed import SeedExhaustive + +client = SeedExhaustive( + ..., + httpx_client=httpx.Client( + proxies="http://my.test.proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0"), + ), +) +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/pyproject.toml b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/pyproject.toml new file mode 100644 index 00000000000..e38c5c44634 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/pyproject.toml @@ -0,0 +1,61 @@ +[tool.poetry] +name = "fern_exhaustive" +version = "0.0.1" +description = "" +readme = "README.md" +authors = [] +keywords = [] + +classifiers = [ + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed" +] +packages = [ + { include = "seed", from = "src"} +] + +[project.urls] +Repository = 'https://github.com/exhaustive/fern' + +[tool.poetry.dependencies] +python = "^3.8" +httpx = ">=0.21.2" +pydantic = ">= 2.0.0" +pydantic-core = "^2.18.2" +typing_extensions = ">= 4.0.0" + +[tool.poetry.dev-dependencies] +mypy = "1.0.1" +pytest = "^7.4.0" +pytest-asyncio = "^0.23.5" +python-dateutil = "^2.9.0" +types-python-dateutil = "^2.9.0.20240316" +ruff = "^0.5.6" + +[tool.pytest.ini_options] +testpaths = [ "tests" ] +asyncio_mode = "auto" + +[tool.mypy] +plugins = ["pydantic.mypy"] + +[tool.ruff] +line-length = 120 + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/reference.md b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/reference.md new file mode 100644 index 00000000000..d7004e0c609 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/reference.md @@ -0,0 +1,2829 @@ +# Reference +## Endpoints Container +
client.endpoints.container.get_and_return_list_of_primitives(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_list_of_primitives( + request=["string", "string"], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Sequence[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.container.get_and_return_list_of_objects(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_list_of_objects( + request=[ + ObjectWithRequiredField( + string="string", + ), + ObjectWithRequiredField( + string="string", + ), + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Sequence[ObjectWithRequiredField]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.container.get_and_return_set_of_primitives(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_set_of_primitives( + request={"string"}, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Set[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.container.get_and_return_set_of_objects(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_set_of_objects( + request=[ + ObjectWithRequiredField( + string="string", + ) + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Sequence[ObjectWithRequiredField]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.container.get_and_return_map_prim_to_prim(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_map_prim_to_prim( + request={"string": "string"}, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Dict[str, str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.container.get_and_return_map_of_prim_to_object(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_map_of_prim_to_object( + request={ + "string": ObjectWithRequiredField( + string="string", + ) + }, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Dict[str, ObjectWithRequiredField]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.container.get_and_return_optional(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.container.get_and_return_optional( + request=ObjectWithRequiredField( + string="string", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Optional[ObjectWithRequiredField]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Endpoints Enum +
client.endpoints.enum.get_and_return_enum(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.enum.get_and_return_enum( + request="SUNNY", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `WeatherReport` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Endpoints HttpMethods +
client.endpoints.http_methods.test_get(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.http_methods.test_get( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.http_methods.test_post(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.http_methods.test_post( + string="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**string:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.http_methods.test_put(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.http_methods.test_put( + id="id", + string="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**string:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.http_methods.test_patch(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime +import uuid + +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.http_methods.test_patch( + id="id", + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**string:** `typing.Optional[str]` — This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + +
+
+ +
+
+ +**integer:** `typing.Optional[int]` + +
+
+ +
+
+ +**long_:** `typing.Optional[int]` + +
+
+ +
+
+ +**double:** `typing.Optional[float]` + +
+
+ +
+
+ +**bool_:** `typing.Optional[bool]` + +
+
+ +
+
+ +**datetime:** `typing.Optional[dt.datetime]` + +
+
+ +
+
+ +**date:** `typing.Optional[dt.date]` + +
+
+ +
+
+ +**uuid_:** `typing.Optional[uuid.UUID]` + +
+
+ +
+
+ +**base_64:** `typing.Optional[str]` + +
+
+ +
+
+ +**list_:** `typing.Optional[typing.Sequence[str]]` + +
+
+ +
+
+ +**set_:** `typing.Optional[typing.Set[str]]` + +
+
+ +
+
+ +**map_:** `typing.Optional[typing.Dict[int, str]]` + +
+
+ +
+
+ +**bigint:** `typing.Optional[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.http_methods.test_delete(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.http_methods.test_delete( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Endpoints Object +
client.endpoints.object.get_and_return_with_optional_field(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime +import uuid + +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.object.get_and_return_with_optional_field( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**string:** `typing.Optional[str]` — This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + +
+
+ +
+
+ +**integer:** `typing.Optional[int]` + +
+
+ +
+
+ +**long_:** `typing.Optional[int]` + +
+
+ +
+
+ +**double:** `typing.Optional[float]` + +
+
+ +
+
+ +**bool_:** `typing.Optional[bool]` + +
+
+ +
+
+ +**datetime:** `typing.Optional[dt.datetime]` + +
+
+ +
+
+ +**date:** `typing.Optional[dt.date]` + +
+
+ +
+
+ +**uuid_:** `typing.Optional[uuid.UUID]` + +
+
+ +
+
+ +**base_64:** `typing.Optional[str]` + +
+
+ +
+
+ +**list_:** `typing.Optional[typing.Sequence[str]]` + +
+
+ +
+
+ +**set_:** `typing.Optional[typing.Set[str]]` + +
+
+ +
+
+ +**map_:** `typing.Optional[typing.Dict[int, str]]` + +
+
+ +
+
+ +**bigint:** `typing.Optional[str]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.object.get_and_return_with_required_field(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.object.get_and_return_with_required_field( + string="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**string:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.object.get_and_return_with_map_of_map(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.object.get_and_return_with_map_of_map( + map_={"map": {"map": "map"}}, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**map_:** `typing.Dict[str, typing.Dict[str, str]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.object.get_and_return_nested_with_optional_field(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime +import uuid + +from seed import SeedExhaustive +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.object.get_and_return_nested_with_optional_field( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**string:** `typing.Optional[str]` + +
+
+ +
+
+ +**nested_object:** `typing.Optional[ObjectWithOptionalField]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.object.get_and_return_nested_with_required_field(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime +import uuid + +from seed import SeedExhaustive +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.object.get_and_return_nested_with_required_field( + string_="string", + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**string_:** `str` + +
+
+ +
+
+ +**string:** `str` + +
+
+ +
+
+ +**nested_object:** `ObjectWithOptionalField` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.object.get_and_return_nested_with_required_field_as_list(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime +import uuid + +from seed import SeedExhaustive +from seed.types.object import ( + NestedObjectWithRequiredField, + ObjectWithOptionalField, +) + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.object.get_and_return_nested_with_required_field_as_list( + request=[ + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + ], +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Sequence[NestedObjectWithRequiredField]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Endpoints Params +
client.endpoints.params.get_with_path(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +GET with path param +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.params.get_with_path( + param="param", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**param:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.params.get_with_query(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +GET with query param +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.params.get_with_query( + query="query", + number=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**query:** `str` + +
+
+ +
+
+ +**number:** `int` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.params.get_with_allow_multiple_query(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +GET with multiple of same query param +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.params.get_with_allow_multiple_query( + query="query", + numer=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**query:** `typing.Union[str, typing.Sequence[str]]` + +
+
+ +
+
+ +**numer:** `typing.Union[int, typing.Sequence[int]]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.params.get_with_path_and_query(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +GET with path and query params +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.params.get_with_path_and_query( + param="param", + query="query", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**param:** `str` + +
+
+ +
+
+ +**query:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.params.modify_with_path(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +PUT to update with path param +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.params.modify_with_path( + param="param", + request="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**param:** `str` + +
+
+ +
+
+ +**request:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Endpoints Primitive +
client.endpoints.primitive.get_and_return_string(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_string( + request="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_int(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_int( + request=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `int` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_long(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_long( + request=1000000, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `int` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_double(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_double( + request=1.1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `float` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_bool(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_bool( + request=True, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `bool` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_datetime(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime + +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_datetime( + request=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `dt.datetime` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_date(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime + +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_date( + request=datetime.date.fromisoformat( + "2023-01-15", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `dt.date` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_uuid(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import uuid + +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_uuid( + request=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `uuid.UUID` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.endpoints.primitive.get_and_return_base_64(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.primitive.get_and_return_base_64( + request="SGVsbG8gd29ybGQh", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Endpoints Union +
client.endpoints.union.get_and_return_union(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive +from seed.types.union import Animal_Dog + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.endpoints.union.get_and_return_union( + request=Animal_Dog( + name="name", + likes_to_woof=True, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `Animal` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## InlinedRequests +
client.inlined_requests.post_with_object_bodyand_response(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +POST with custom object in request body, response is an object +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +import datetime +import uuid + +from seed import SeedExhaustive +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.inlined_requests.post_with_object_bodyand_response( + string="string", + integer=1, + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**string:** `str` + +
+
+ +
+
+ +**integer:** `int` + +
+
+ +
+
+ +**nested_object:** `ObjectWithOptionalField` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## NoAuth +
client.no_auth.post_with_no_auth(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +POST request with no auth +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.no_auth.post_with_no_auth( + request={"key": "value"}, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `typing.Optional[typing.Any]` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## NoReqBody +
client.no_req_body.get_with_no_request_body() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.no_req_body.get_with_no_request_body() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.no_req_body.post_with_no_request_body() +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.no_req_body.post_with_no_request_body() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## ReqWithHeaders +
client.req_with_headers.get_with_custom_header(...) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from seed import SeedExhaustive + +client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", +) +client.req_with_headers.get_with_custom_header( + x_test_service_header="X-TEST-SERVICE-HEADER", + x_test_endpoint_header="X-TEST-ENDPOINT-HEADER", + request="string", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**x_test_service_header:** `str` + +
+
+ +
+
+ +**x_test_endpoint_header:** `str` + +
+
+ +
+
+ +**request:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/resolved-snippet-templates.md b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/resolved-snippet-templates.md new file mode 100644 index 00000000000..df18e904d60 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/resolved-snippet-templates.md @@ -0,0 +1,593 @@ +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_list_of_primitives( + request=[ + "string", + "string" + ] +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_list_of_objects( + request=[ + ObjectWithRequiredField( + string="string" + ), + ObjectWithRequiredField( + string="string" + ) + ] +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_set_of_primitives( + +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_set_of_objects( + +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_map_prim_to_prim( + request={ + "string": "string" + } +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_map_of_prim_to_object( + request={ + "string": ObjectWithRequiredField( + string="string" + ) + } +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithRequiredField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.container.get_and_return_optional( + request=ObjectWithRequiredField( + string="string" + ) +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +undefined + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.http_methods.test_get( + id="id" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.http_methods.test_post( + string="string" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.http_methods.test_put( + id="id", + string="string" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.http_methods.test_patch( + id="id", + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + list_=[ + "list", + "list" + ], + map_={ + "1": "map" + }, + bigint="1000000" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.http_methods.test_delete( + id="id" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.object.get_and_return_with_optional_field( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + list_=[ + "list", + "list" + ], + map_={ + "1": "map" + }, + bigint="1000000" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.object.get_and_return_with_required_field( + string="string" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.object.get_and_return_with_map_of_map( + map_={ + "map": { + "map": "map" + } + } +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.object.get_and_return_nested_with_optional_field( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + list_=[ + "list", + "list" + ], + map_={ + "1": "map" + }, + bigint="1000000" + ) +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.object.get_and_return_nested_with_required_field( + string="string", + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + list_=[ + "list", + "list" + ], + map_={ + "1": "map" + }, + bigint="1000000" + ) +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import NestedObjectWithRequiredField +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.object.get_and_return_nested_with_required_field_as_list( + request=[ + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + map_={ + "1": "map" + }, + bigint="1000000" + ) + ), + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + map_={ + "1": "map" + }, + bigint="1000000" + ) + ) + ] +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.params.get_with_path( + param="param" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.params.get_with_query( + query="query", + number=1 +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.params.get_with_allow_multiple_query( + query="query", + numer=1 +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.params.get_with_path_and_query( + param="param", + query="query" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.params.modify_with_path( + param="param", + request="string" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_string( + request="string" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_int( + request=1 +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_long( + request=1000000 +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_double( + request=1.1 +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_bool( + request=true +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_datetime( + request="2024-01-15T09:30:00Z" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_date( + request="2023-01-15" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_uuid( + request="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.primitive.get_and_return_base_64( + request="SGVsbG8gd29ybGQh" +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.union import Animal_Dog + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.endpoints.union.get_and_return_union( + request=request=Animal_Dog(name="name", likes_to_woof=true, ) +) + +``` + + +```python +from seed import SeedExhaustive +from seed.types.object import ObjectWithOptionalField + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.inlined_requests.post_with_object_bodyand_response( + string="string", + integer=1, + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=true, + datetime="2024-01-15T09:30:00Z", + date="2023-01-15", + uuid_="d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + base_64="SGVsbG8gd29ybGQh", + list_=[ + "list", + "list" + ], + map_={ + "1": "map" + }, + bigint="1000000" + ) +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.no_auth.post_with_no_auth( + request={"key":"value"} +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.no_req_body.get_with_no_request_body( + +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.no_req_body.post_with_no_request_body( + +) + +``` + + +```python +from seed import SeedExhaustive + +client = SeedExhaustive(base_url="https://yourhost.com/path/to/api", token="YOUR_TOKEN", ) +client.req_with_headers.get_with_custom_header( + x_test_endpoint_header="X-TEST-ENDPOINT-HEADER", + request="string" +) + +``` + + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet-templates.json b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet-templates.json new file mode 100644 index 00000000000..65dfae3aba5 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet-templates.json @@ -0,0 +1,8324 @@ +[ + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/list-of-primitives", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnListOfPrimitives" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_list_of_primitives(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "iterable" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_list_of_primitives(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "iterable" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/list-of-objects", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnListOfObjects" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_list_of_objects(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [ + "from seed.types.object import ObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "ObjectWithRequiredField(\n\t\t\t$FERN_INPUT\n\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t", + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "iterable" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_list_of_objects(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [ + "from seed.types.object import ObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "ObjectWithRequiredField(\n\t\t\t$FERN_INPUT\n\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t", + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "iterable" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/set-of-primitives", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnSetOfPrimitives" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_set_of_primitives(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_set_of_primitives(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/set-of-objects", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnSetOfObjects" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_set_of_objects(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_set_of_objects(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/map-prim-to-prim", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnMapPrimToPrim" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_map_prim_to_prim(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "dict" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_map_prim_to_prim(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "dict" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/map-prim-to-object", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnMapOfPrimToObject" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_map_of_prim_to_object(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [ + "from seed.types.object import ObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "ObjectWithRequiredField(\n\t\t\t$FERN_INPUT\n\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t", + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "dict" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_map_of_prim_to_object(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [ + "from seed.types.object import ObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "ObjectWithRequiredField(\n\t\t\t$FERN_INPUT\n\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t", + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "dict" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/container/opt-objects", + "method": "POST", + "identifierOverride": "endpoint_endpoints/container.getAndReturnOptional" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.container.get_and_return_optional(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "request=ObjectWithRequiredField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.container.get_and_return_optional(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "request=ObjectWithRequiredField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/enum", + "method": "POST", + "identifierOverride": "endpoint_endpoints/enum.getAndReturnEnum" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.enum.get_and_return_enum(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "values": { + "SUNNY": "\"SUNNY\"", + "CLOUDY": "\"CLOUDY\"", + "RAINING": "\"RAINING\"", + "SNOWING": "\"SNOWING\"" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "enum" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.enum.get_and_return_enum(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "values": { + "SUNNY": "\"SUNNY\"", + "CLOUDY": "\"CLOUDY\"", + "RAINING": "\"RAINING\"", + "SNOWING": "\"SNOWING\"" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "enum" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/http-methods/{id}", + "method": "GET", + "identifierOverride": "endpoint_endpoints/http-methods.testGet" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.http_methods.test_get(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.http_methods.test_get(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/http-methods", + "method": "POST", + "identifierOverride": "endpoint_endpoints/http-methods.testPost" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.http_methods.test_post(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.http_methods.test_post(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/http-methods/{id}", + "method": "PUT", + "identifierOverride": "endpoint_endpoints/http-methods.testPut" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.http_methods.test_put(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.http_methods.test_put(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/http-methods/{id}", + "method": "PATCH", + "identifierOverride": "endpoint_endpoints/http-methods.testPatch" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.http_methods.test_patch(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.http_methods.test_patch(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/http-methods/{id}", + "method": "DELETE", + "identifierOverride": "endpoint_endpoints/http-methods.testDelete" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.http_methods.test_delete(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.http_methods.test_delete(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "id=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "id", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/object/get-and-return-with-optional-field", + "method": "POST", + "identifierOverride": "endpoint_endpoints/object.getAndReturnWithOptionalField" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.object.get_and_return_with_optional_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.object.get_and_return_with_optional_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/object/get-and-return-with-required-field", + "method": "POST", + "identifierOverride": "endpoint_endpoints/object.getAndReturnWithRequiredField" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.object.get_and_return_with_required_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.object.get_and_return_with_required_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/object/get-and-return-with-map-of-map", + "method": "POST", + "identifierOverride": "endpoint_endpoints/object.getAndReturnWithMapOfMap" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.object.get_and_return_with_map_of_map(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "containerTemplateString": "{\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "RELATIVE", + "path": null + }, + "type": "dict" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "map" + }, + "type": "dict" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.object.get_and_return_with_map_of_map(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t$FERN_INPUT\n\t}", + "delimiter": ",\n\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "containerTemplateString": "{\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "RELATIVE", + "path": null + }, + "type": "dict" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "map" + }, + "type": "dict" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/object/get-and-return-nested-with-optional-field", + "method": "POST", + "identifierOverride": "endpoint_endpoints/object.getAndReturnNestedWithOptionalField" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.object.get_and_return_nested_with_optional_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t$FERN_INPUT\n\t\t]", + "delimiter": ",\n\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.object.get_and_return_nested_with_optional_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t$FERN_INPUT\n\t\t]", + "delimiter": ",\n\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/object/get-and-return-nested-with-required-field/{string}", + "method": "POST", + "identifierOverride": "endpoint_endpoints/object.getAndReturnNestedWithRequiredField" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.object.get_and_return_nested_with_required_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t$FERN_INPUT\n\t\t]", + "delimiter": ",\n\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.object.get_and_return_nested_with_required_field(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t$FERN_INPUT\n\t\t]", + "delimiter": ",\n\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/object/get-and-return-nested-with-required-field-list", + "method": "POST", + "identifierOverride": "endpoint_endpoints/object.getAndReturnNestedWithRequiredFieldAsList" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.object.get_and_return_nested_with_required_field_as_list(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [ + "from seed.types.object import NestedObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "NestedObjectWithRequiredField(\n\t\t\t$FERN_INPUT\n\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t\t\t$FERN_INPUT\n\t\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t\t\t$FERN_INPUT\n\t\t\t\t]", + "delimiter": ",\n\t\t\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "RELATIVE", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t\t\t$FERN_INPUT\n\t\t\t\t}", + "delimiter": ",\n\t\t\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "RELATIVE", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t", + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "iterable" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.object.get_and_return_nested_with_required_field_as_list(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "request=[\n\t\t$FERN_INPUT\n\t]", + "delimiter": ",\n\t\t", + "innerTemplate": { + "imports": [ + "from seed.types.object import NestedObjectWithRequiredField" + ], + "isOptional": true, + "templateString": "NestedObjectWithRequiredField(\n\t\t\t$FERN_INPUT\n\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t\t\t$FERN_INPUT\n\t\t\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t\t\t$FERN_INPUT\n\t\t\t\t]", + "delimiter": ",\n\t\t\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "RELATIVE", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t\t\t$FERN_INPUT\n\t\t\t\t}", + "delimiter": ",\n\t\t\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "RELATIVE", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t\t", + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": null + }, + "type": "iterable" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/params/path/{param}", + "method": "GET", + "identifierOverride": "endpoint_endpoints/params.getWithPath" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.params.get_with_path(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "param=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "param", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.params.get_with_path(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "param=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "param", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/params", + "method": "GET", + "identifierOverride": "endpoint_endpoints/params.getWithQuery" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.params.get_with_query(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "query=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "query", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "number=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "number", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.params.get_with_query(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "query=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "query", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "number=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "number", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/params", + "method": "GET", + "identifierOverride": "endpoint_endpoints/params.getWithAllowMultipleQuery" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.params.get_with_allow_multiple_query(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "query=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "query", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "numer=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "numer", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.params.get_with_allow_multiple_query(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "query=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "query", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "numer=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "numer", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/params/path-query/{param}", + "method": "GET", + "identifierOverride": "endpoint_endpoints/params.getWithPathAndQuery" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.params.get_with_path_and_query(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "param=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "param", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "query=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "query", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.params.get_with_path_and_query(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "param=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "param", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "query=$FERN_INPUT", + "templateInputs": [ + { + "location": "QUERY", + "path": "query", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/params/path/{param}", + "method": "PUT", + "identifierOverride": "endpoint_endpoints/params.modifyWithPath" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.params.modify_with_path(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "param=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "param", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.params.modify_with_path(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "param=$FERN_INPUT", + "templateInputs": [ + { + "location": "PATH", + "path": "param", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/string", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnString" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_string(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_string(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/integer", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnInt" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_int(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_int(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/long", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnLong" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_long(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_long(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/double", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnDouble" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_double(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_double(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/boolean", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnBool" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_bool(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_bool(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/datetime", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnDatetime" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_datetime(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_datetime(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/date", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnDate" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_date(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_date(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/uuid", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnUUID" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_uuid(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_uuid(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/primitive/base64", + "method": "POST", + "identifierOverride": "endpoint_endpoints/primitive.getAndReturnBase64" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.primitive.get_and_return_base_64(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.primitive.get_and_return_base_64(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/union", + "method": "POST", + "identifierOverride": "endpoint_endpoints/union.getAndReturnUnion" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.endpoints.union.get_and_return_union(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "discriminantField": "animal", + "members": { + "dog": { + "imports": [ + "from seed.types.union import Animal_Dog" + ], + "isOptional": true, + "templateString": "request=Animal_Dog($FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "name=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "name", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "likes_to_woof=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "likesToWoof", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "type": "generic" + }, + "cat": { + "imports": [ + "from seed.types.union import Animal_Cat" + ], + "isOptional": true, + "templateString": "request=Animal_Cat($FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "name=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "name", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "likes_to_meow=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "likesToMeow", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "type": "generic" + } + }, + "templateInput": { + "location": "RELATIVE" + }, + "type": "discriminatedUnion" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.endpoints.union.get_and_return_union(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "discriminantField": "animal", + "members": { + "dog": { + "imports": [ + "from seed.types.union import Animal_Dog" + ], + "isOptional": true, + "templateString": "request=Animal_Dog($FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "name=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "name", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "likes_to_woof=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "likesToWoof", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "type": "generic" + }, + "cat": { + "imports": [ + "from seed.types.union import Animal_Cat" + ], + "isOptional": true, + "templateString": "request=Animal_Cat($FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "name=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "name", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "likes_to_meow=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "likesToMeow", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "type": "generic" + } + }, + "templateInput": { + "location": "RELATIVE" + }, + "type": "discriminatedUnion" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/req-bodies/object", + "method": "POST", + "identifierOverride": "endpoint_inlined-requests.postWithObjectBodyandResponse" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.inlined_requests.post_with_object_bodyand_response(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t$FERN_INPUT\n\t\t]", + "delimiter": ",\n\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.inlined_requests.post_with_object_bodyand_response(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [ + "from seed.types.object import ObjectWithOptionalField" + ], + "isOptional": true, + "templateString": "nested_object=ObjectWithOptionalField(\n\t\t$FERN_INPUT\n\t)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "string=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.string", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "integer=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.integer", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "long_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.long", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "double=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.double", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bool_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bool", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "datetime=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.datetime", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "date=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.date", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "uuid_=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.uuid", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "base_64=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.base64", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "list_=[\n\t\t\t$FERN_INPUT\n\t\t]", + "delimiter": ",\n\t\t\t", + "innerTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "templateInput": { + "location": "BODY", + "path": "NestedObject.list" + }, + "type": "iterable" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "containerTemplateString": "map_={\n\t\t\t$FERN_INPUT\n\t\t}", + "delimiter": ",\n\t\t\t", + "keyTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "valueTemplate": { + "imports": [], + "isOptional": true, + "templateString": "$FERN_INPUT", + "templateInputs": [ + { + "location": "RELATIVE", + "path": null, + "type": "payload" + } + ], + "type": "generic" + }, + "keyValueSeparator": ": ", + "templateInput": { + "location": "BODY", + "path": "NestedObject.map" + }, + "type": "dict" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "bigint=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": "NestedObject.bigint", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t\t", + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/no-auth", + "method": "POST", + "identifierOverride": "endpoint_no-auth.postWithNoAuth" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.no_auth.post_with_no_auth(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.no_auth.post_with_no_auth(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/no-req-body", + "method": "GET", + "identifierOverride": "endpoint_no-req-body.getWithNoRequestBody" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.no_req_body.get_with_no_request_body(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.no_req_body.get_with_no_request_body(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/no-req-body", + "method": "POST", + "identifierOverride": "endpoint_no-req-body.postWithNoRequestBody" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.no_req_body.post_with_no_request_body(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.no_req_body.post_with_no_request_body(\n\t$FERN_INPUT\n)", + "templateInputs": [], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + }, + { + "sdk": { + "package": "fern_exhaustive", + "version": "0.0.1", + "type": "python" + }, + "endpointId": { + "path": "/test-headers/custom-header", + "method": "POST", + "identifierOverride": "endpoint_req-with-headers.getWithCustomHeader" + }, + "snippetTemplate": { + "clientInstantiation": { + "imports": [ + "from seed import SeedExhaustive" + ], + "isOptional": true, + "templateString": "client = SeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "client.req_with_headers.get_with_custom_header(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "x_test_endpoint_header=$FERN_INPUT", + "templateInputs": [ + { + "location": "HEADERS", + "path": "X-TEST-ENDPOINT-HEADER", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + }, + "additionalTemplates": { + "async": { + "clientInstantiation": { + "imports": [ + "from seed import AsyncSeedExhaustive" + ], + "isOptional": true, + "templateString": "client = AsyncSeedExhaustive(base_url=\"https://yourhost.com/path/to/api\", $FERN_INPUT, )", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": false, + "templateString": "token=$FERN_INPUT", + "templateInputs": [ + { + "location": "AUTH", + "path": "token", + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",", + "type": "generic" + }, + "functionInvocation": { + "imports": [], + "isOptional": true, + "templateString": "await client.req_with_headers.get_with_custom_header(\n\t$FERN_INPUT\n)", + "templateInputs": [ + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "x_test_endpoint_header=$FERN_INPUT", + "templateInputs": [ + { + "location": "HEADERS", + "path": "X-TEST-ENDPOINT-HEADER", + "type": "payload" + } + ], + "type": "generic" + } + }, + { + "type": "template", + "value": { + "imports": [], + "isOptional": true, + "templateString": "request=$FERN_INPUT", + "templateInputs": [ + { + "location": "BODY", + "path": null, + "type": "payload" + } + ], + "type": "generic" + } + } + ], + "inputDelimiter": ",\n\t", + "type": "generic" + }, + "type": "v1" + } + } + } +] \ No newline at end of file diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json new file mode 100644 index 00000000000..62ecc67b879 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json @@ -0,0 +1,512 @@ +{ + "types": {}, + "endpoints": [ + { + "example_identifier": "default", + "id": { + "path": "/container/list-of-primitives", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnListOfPrimitives" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_list_of_primitives(\n request=[\"string\", \"string\"],\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_list_of_primitives(\n request=[\"string\", \"string\"],\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/container/list-of-objects", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnListOfObjects" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_list_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ],\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_list_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ],\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/container/set-of-primitives", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnSetOfPrimitives" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_set_of_primitives(\n request={\"string\"},\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_set_of_primitives(\n request={\"string\"},\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/container/set-of-objects", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnSetOfObjects" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_set_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n )\n ],\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_set_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/container/map-prim-to-prim", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnMapPrimToPrim" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_map_prim_to_prim(\n request={\"string\": \"string\"},\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_map_prim_to_prim(\n request={\"string\": \"string\"},\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/container/map-prim-to-object", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnMapOfPrimToObject" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_map_of_prim_to_object(\n request={\n \"string\": ObjectWithRequiredField(\n string=\"string\",\n )\n },\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_map_of_prim_to_object(\n request={\n \"string\": ObjectWithRequiredField(\n string=\"string\",\n )\n },\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/container/opt-objects", + "method": "POST", + "identifier_override": "endpoint_endpoints/container.getAndReturnOptional" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_optional(\n request=ObjectWithRequiredField(\n string=\"string\",\n ),\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_optional(\n request=ObjectWithRequiredField(\n string=\"string\",\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/enum", + "method": "POST", + "identifier_override": "endpoint_endpoints/enum.getAndReturnEnum" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.enum.get_and_return_enum(\n request=\"SUNNY\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.enum.get_and_return_enum(\n request=\"SUNNY\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/http-methods/{id}", + "method": "GET", + "identifier_override": "endpoint_endpoints/http-methods.testGet" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_get(\n id=\"id\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_get(\n id=\"id\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/http-methods", + "method": "POST", + "identifier_override": "endpoint_endpoints/http-methods.testPost" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_post(\n string=\"string\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_post(\n string=\"string\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/http-methods/{id}", + "method": "PUT", + "identifier_override": "endpoint_endpoints/http-methods.testPut" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_put(\n id=\"id\",\n string=\"string\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_put(\n id=\"id\",\n string=\"string\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/http-methods/{id}", + "method": "PATCH", + "identifier_override": "endpoint_endpoints/http-methods.testPatch" + }, + "snippet": { + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_patch(\n id=\"id\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_patch(\n id=\"id\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/http-methods/{id}", + "method": "DELETE", + "identifier_override": "endpoint_endpoints/http-methods.testDelete" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_delete(\n id=\"id\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_delete(\n id=\"id\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/object/get-and-return-with-optional-field", + "method": "POST", + "identifier_override": "endpoint_endpoints/object.getAndReturnWithOptionalField" + }, + "snippet": { + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_optional_field(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_optional_field(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/object/get-and-return-with-required-field", + "method": "POST", + "identifier_override": "endpoint_endpoints/object.getAndReturnWithRequiredField" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_required_field(\n string=\"string\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_required_field(\n string=\"string\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/object/get-and-return-with-map-of-map", + "method": "POST", + "identifier_override": "endpoint_endpoints/object.getAndReturnWithMapOfMap" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_map_of_map(\n map_={\"map\": {\"map\": \"map\"}},\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_map_of_map(\n map_={\"map\": {\"map\": \"map\"}},\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/object/get-and-return-nested-with-optional-field", + "method": "POST", + "identifier_override": "endpoint_endpoints/object.getAndReturnNestedWithOptionalField" + }, + "snippet": { + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_nested_with_optional_field(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_nested_with_optional_field(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/object/get-and-return-nested-with-required-field/{string}", + "method": "POST", + "identifier_override": "endpoint_endpoints/object.getAndReturnNestedWithRequiredField" + }, + "snippet": { + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_nested_with_required_field(\n string_=\"string\",\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_nested_with_required_field(\n string_=\"string\",\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/object/get-and-return-nested-with-required-field-list", + "method": "POST", + "identifier_override": "endpoint_endpoints/object.getAndReturnNestedWithRequiredFieldAsList" + }, + "snippet": { + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import (\n NestedObjectWithRequiredField,\n ObjectWithOptionalField,\n)\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_nested_with_required_field_as_list(\n request=[\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n ],\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import (\n NestedObjectWithRequiredField,\n ObjectWithOptionalField,\n)\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_nested_with_required_field_as_list(\n request=[\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n ],\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/params/path/{param}", + "method": "GET", + "identifier_override": "endpoint_endpoints/params.getWithPath" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_path(\n param=\"param\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_path(\n param=\"param\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/params", + "method": "GET", + "identifier_override": "endpoint_endpoints/params.getWithQuery" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_query(\n query=\"query\",\n number=1,\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_query(\n query=\"query\",\n number=1,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/params", + "method": "GET", + "identifier_override": "endpoint_endpoints/params.getWithAllowMultipleQuery" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_allow_multiple_query(\n query=\"query\",\n numer=1,\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_allow_multiple_query(\n query=\"query\",\n numer=1,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/params/path-query/{param}", + "method": "GET", + "identifier_override": "endpoint_endpoints/params.getWithPathAndQuery" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_path_and_query(\n param=\"param\",\n query=\"query\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_path_and_query(\n param=\"param\",\n query=\"query\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/params/path/{param}", + "method": "PUT", + "identifier_override": "endpoint_endpoints/params.modifyWithPath" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.modify_with_path(\n param=\"param\",\n request=\"string\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.modify_with_path(\n param=\"param\",\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/string", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnString" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_string(\n request=\"string\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_string(\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/integer", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnInt" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_int(\n request=1,\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_int(\n request=1,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/long", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnLong" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_long(\n request=1000000,\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_long(\n request=1000000,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/double", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnDouble" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_double(\n request=1.1,\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_double(\n request=1.1,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/boolean", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnBool" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_bool(\n request=True,\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_bool(\n request=True,\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/datetime", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnDatetime" + }, + "snippet": { + "sync_client": "import datetime\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_datetime(\n request=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n)\n", + "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_datetime(\n request=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/date", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnDate" + }, + "snippet": { + "sync_client": "import datetime\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_date(\n request=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n)\n", + "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_date(\n request=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/uuid", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnUUID" + }, + "snippet": { + "sync_client": "import uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_uuid(\n request=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n)\n", + "async_client": "import asyncio\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_uuid(\n request=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/primitive/base64", + "method": "POST", + "identifier_override": "endpoint_endpoints/primitive.getAndReturnBase64" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_base_64(\n request=\"SGVsbG8gd29ybGQh\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_base_64(\n request=\"SGVsbG8gd29ybGQh\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/union", + "method": "POST", + "identifier_override": "endpoint_endpoints/union.getAndReturnUnion" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\nfrom seed.types.union import Animal_Dog\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.union.get_and_return_union(\n request=Animal_Dog(\n name=\"name\",\n likes_to_woof=True,\n ),\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.union import Animal_Dog\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.union.get_and_return_union(\n request=Animal_Dog(\n name=\"name\",\n likes_to_woof=True,\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/req-bodies/object", + "method": "POST", + "identifier_override": "endpoint_inlined-requests.postWithObjectBodyandResponse" + }, + "snippet": { + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.inlined_requests.post_with_object_bodyand_response(\n string=\"string\",\n integer=1,\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.inlined_requests.post_with_object_bodyand_response(\n string=\"string\",\n integer=1,\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base_64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/no-auth", + "method": "POST", + "identifier_override": "endpoint_no-auth.postWithNoAuth" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.no_auth.post_with_no_auth(\n request={\"key\": \"value\"},\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.no_auth.post_with_no_auth(\n request={\"key\": \"value\"},\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/no-req-body", + "method": "GET", + "identifier_override": "endpoint_no-req-body.getWithNoRequestBody" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.no_req_body.get_with_no_request_body()\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.no_req_body.get_with_no_request_body()\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/no-req-body", + "method": "POST", + "identifier_override": "endpoint_no-req-body.postWithNoRequestBody" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.no_req_body.post_with_no_request_body()\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.no_req_body.post_with_no_request_body()\n\n\nasyncio.run(main())\n", + "type": "python" + } + }, + { + "example_identifier": "default", + "id": { + "path": "/test-headers/custom-header", + "method": "POST", + "identifier_override": "endpoint_req-with-headers.getWithCustomHeader" + }, + "snippet": { + "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.req_with_headers.get_with_custom_header(\n x_test_service_header=\"X-TEST-SERVICE-HEADER\",\n x_test_endpoint_header=\"X-TEST-ENDPOINT-HEADER\",\n request=\"string\",\n)\n", + "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.req_with_headers.get_with_custom_header(\n x_test_service_header=\"X-TEST-SERVICE-HEADER\",\n x_test_endpoint_header=\"X-TEST-ENDPOINT-HEADER\",\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", + "type": "python" + } + } + ] +} \ No newline at end of file diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/__init__.py new file mode 100644 index 00000000000..eb56b0ce275 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/__init__.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import endpoints, general_errors, inlined_requests, no_auth, no_req_body, req_with_headers, types +from .client import AsyncSeedExhaustive, SeedExhaustive +from .general_errors import BadObjectRequestInfo, BadRequestBody +from .version import __version__ + +__all__ = [ + "AsyncSeedExhaustive", + "BadObjectRequestInfo", + "BadRequestBody", + "SeedExhaustive", + "__version__", + "endpoints", + "general_errors", + "inlined_requests", + "no_auth", + "no_req_body", + "req_with_headers", + "types", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/client.py new file mode 100644 index 00000000000..ab22df2044f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/client.py @@ -0,0 +1,128 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import httpx +from .core.client_wrapper import SyncClientWrapper +from .endpoints.client import EndpointsClient +from .inlined_requests.client import InlinedRequestsClient +from .no_auth.client import NoAuthClient +from .no_req_body.client import NoReqBodyClient +from .req_with_headers.client import ReqWithHeadersClient +from .core.client_wrapper import AsyncClientWrapper +from .endpoints.client import AsyncEndpointsClient +from .inlined_requests.client import AsyncInlinedRequestsClient +from .no_auth.client import AsyncNoAuthClient +from .no_req_body.client import AsyncNoReqBodyClient +from .req_with_headers.client import AsyncReqWithHeadersClient + + +class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : str + The base url to use for requests from the client. + + token : typing.Optional[typing.Union[str, typing.Callable[[], str]]] + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.Client] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.Client] = None, + ): + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + self._client_wrapper = SyncClientWrapper( + base_url=base_url, + token=token, + httpx_client=httpx_client + if httpx_client is not None + else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.Client(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) + self.endpoints = EndpointsClient(client_wrapper=self._client_wrapper) + self.inlined_requests = InlinedRequestsClient(client_wrapper=self._client_wrapper) + self.no_auth = NoAuthClient(client_wrapper=self._client_wrapper) + self.no_req_body = NoReqBodyClient(client_wrapper=self._client_wrapper) + self.req_with_headers = ReqWithHeadersClient(client_wrapper=self._client_wrapper) + + +class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. + + Parameters + ---------- + base_url : str + The base url to use for requests from the client. + + token : typing.Optional[typing.Union[str, typing.Callable[[], str]]] + timeout : typing.Optional[float] + The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. + + follow_redirects : typing.Optional[bool] + Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. + + httpx_client : typing.Optional[httpx.AsyncClient] + The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + + Examples + -------- + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + timeout: typing.Optional[float] = None, + follow_redirects: typing.Optional[bool] = True, + httpx_client: typing.Optional[httpx.AsyncClient] = None, + ): + _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None + self._client_wrapper = AsyncClientWrapper( + base_url=base_url, + token=token, + httpx_client=httpx_client + if httpx_client is not None + else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) + if follow_redirects is not None + else httpx.AsyncClient(timeout=_defaulted_timeout), + timeout=_defaulted_timeout, + ) + self.endpoints = AsyncEndpointsClient(client_wrapper=self._client_wrapper) + self.inlined_requests = AsyncInlinedRequestsClient(client_wrapper=self._client_wrapper) + self.no_auth = AsyncNoAuthClient(client_wrapper=self._client_wrapper) + self.no_req_body = AsyncNoReqBodyClient(client_wrapper=self._client_wrapper) + self.req_with_headers = AsyncReqWithHeadersClient(client_wrapper=self._client_wrapper) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/__init__.py new file mode 100644 index 00000000000..f03aecbfe18 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/__init__.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from .api_error import ApiError +from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper +from .datetime_utils import serialize_datetime +from .file import File, convert_file_dict_to_httpx_tuples, with_content_type +from .http_client import AsyncHttpClient, HttpClient +from .jsonable_encoder import jsonable_encoder +from .pydantic_utilities import ( + IS_PYDANTIC_V2, + UniversalBaseModel, + UniversalRootModel, + parse_obj_as, + universal_field_validator, + universal_root_validator, + update_forward_refs, +) +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions +from .serialization import FieldMetadata, convert_and_respect_annotation_metadata + +__all__ = [ + "ApiError", + "AsyncClientWrapper", + "AsyncHttpClient", + "BaseClientWrapper", + "FieldMetadata", + "File", + "HttpClient", + "IS_PYDANTIC_V2", + "RequestOptions", + "SyncClientWrapper", + "UniversalBaseModel", + "UniversalRootModel", + "convert_and_respect_annotation_metadata", + "convert_file_dict_to_httpx_tuples", + "encode_query", + "jsonable_encoder", + "parse_obj_as", + "remove_none_from_dict", + "serialize_datetime", + "universal_field_validator", + "universal_root_validator", + "update_forward_refs", + "with_content_type", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/api_error.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/api_error.py new file mode 100644 index 00000000000..2e9fc5431cd --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/api_error.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + + +class ApiError(Exception): + status_code: typing.Optional[int] + body: typing.Any + + def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None): + self.status_code = status_code + self.body = body + + def __str__(self) -> str: + return f"status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/client_wrapper.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/client_wrapper.py new file mode 100644 index 00000000000..010885d377e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/client_wrapper.py @@ -0,0 +1,78 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import httpx +from .http_client import HttpClient +from .http_client import AsyncHttpClient + + +class BaseClientWrapper: + def __init__( + self, + *, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + ): + self._token = token + self._base_url = base_url + self._timeout = timeout + + def get_headers(self) -> typing.Dict[str, str]: + headers: typing.Dict[str, str] = { + "X-Fern-Language": "Python", + "X-Fern-SDK-Name": "fern_exhaustive", + "X-Fern-SDK-Version": "0.0.1", + } + token = self._get_token() + if token is not None: + headers["Authorization"] = f"Bearer {token}" + return headers + + def _get_token(self) -> typing.Optional[str]: + if isinstance(self._token, str) or self._token is None: + return self._token + else: + return self._token() + + def get_base_url(self) -> str: + return self._base_url + + def get_timeout(self) -> typing.Optional[float]: + return self._timeout + + +class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.Client, + ): + super().__init__(token=token, base_url=base_url, timeout=timeout) + self.httpx_client = HttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + ) + + +class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + base_url: str, + timeout: typing.Optional[float] = None, + httpx_client: httpx.AsyncClient, + ): + super().__init__(token=token, base_url=base_url, timeout=timeout) + self.httpx_client = AsyncHttpClient( + httpx_client=httpx_client, + base_headers=self.get_headers, + base_timeout=self.get_timeout, + base_url=self.get_base_url, + ) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/datetime_utils.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/datetime_utils.py new file mode 100644 index 00000000000..7c9864a944c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/datetime_utils.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + + +def serialize_datetime(v: dt.datetime) -> str: + """ + Serialize a datetime including timezone info. + + Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. + + UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. + """ + + def _serialize_zoned_datetime(v: dt.datetime) -> str: + if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): + # UTC is a special case where we use "Z" at the end instead of "+00:00" + return v.isoformat().replace("+00:00", "Z") + else: + # Delegate to the typical +/- offset format + return v.isoformat() + + if v.tzinfo is not None: + return _serialize_zoned_datetime(v) + else: + local_tz = dt.datetime.now().astimezone().tzinfo + localized_dt = v.replace(tzinfo=local_tz) + return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/file.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/file.py new file mode 100644 index 00000000000..b4cbba30f73 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/file.py @@ -0,0 +1,62 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast + +# File typing inspired by the flexibility of types within the httpx library +# https://github.com/encode/httpx/blob/master/httpx/_types.py +FileContent = Union[IO[bytes], bytes, str] +File = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[ + Optional[str], + FileContent, + Optional[str], + Mapping[str, str], + ], +] + + +def convert_file_dict_to_httpx_tuples( + d: Dict[str, Union[File, List[File]]], +) -> List[Tuple[str, File]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples + + +def with_content_type(*, file: File, content_type: str) -> File: + """ """ + if isinstance(file, tuple): + if len(file) == 2: + filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore + return (filename, content, content_type) + elif len(file) == 3: + filename, content, _ = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore + return (filename, content, content_type) + elif len(file) == 4: + filename, content, _, headers = cast( # type: ignore + Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file + ) + return (filename, content, content_type, headers) + else: + raise ValueError(f"Unexpected tuple length: {len(file)}") + return (None, file, content_type) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/http_client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/http_client.py new file mode 100644 index 00000000000..eb4e8943cec --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/http_client.py @@ -0,0 +1,487 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import json +import re +import time +import typing +import urllib.parse +from contextlib import asynccontextmanager, contextmanager +from random import random + +import httpx + +from .file import File, convert_file_dict_to_httpx_tuples +from .jsonable_encoder import jsonable_encoder +from .query_encoder import encode_query +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retriable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retriable_400s + + +def remove_omit_from_dict( + original: typing.Dict[str, typing.Optional[typing.Any]], + omit: typing.Optional[typing.Any], +) -> typing.Dict[str, typing.Any]: + if omit is None: + return original + new: typing.Dict[str, typing.Any] = {} + for key, value in original.items(): + if value is not omit: + new[key] = value + return new + + +def maybe_filter_request_body( + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Optional[typing.Any]: + if data is None: + return ( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else None + ) + elif not isinstance(data, typing.Mapping): + data_content = jsonable_encoder(data) + else: + data_content = { + **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore + **( + jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} + if request_options is not None + else {} + ), + } + return data_content + + +# Abstracted out for testing purposes +def get_request_body( + *, + json: typing.Optional[typing.Any], + data: typing.Optional[typing.Any], + request_options: typing.Optional[RequestOptions], + omit: typing.Optional[typing.Any], +) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: + json_body = None + data_body = None + if data is not None: + data_body = maybe_filter_request_body(data, request_options, omit) + else: + # If both data and json are None, we send json data in the event extra properties are specified + json_body = maybe_filter_request_body(json, request_options, omit) + + # If you have an empty JSON body, you should just send None + return (json_body if json_body != {} else None), data_body if data_body != {} else None + + +class HttpClient: + def __init__( + self, + *, + httpx_client: httpx.Client, + base_timeout: typing.Callable[[], typing.Optional[float]], + base_headers: typing.Callable[[], typing.Dict[str, str]], + base_url: typing.Optional[typing.Callable[[], str]] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = maybe_base_url + if self.base_url is not None and base_url is None: + base_url = self.base_url() + + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + response = self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) + if (files is not None and files is not omit) + else None, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + + return response + + @contextmanager + def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> typing.Iterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) + if (files is not None and files is not omit) + else None, + timeout=timeout, + ) as stream: + yield stream + + +class AsyncHttpClient: + def __init__( + self, + *, + httpx_client: httpx.AsyncClient, + base_timeout: typing.Callable[[], typing.Optional[float]], + base_headers: typing.Callable[[], typing.Dict[str, str]], + base_url: typing.Optional[typing.Callable[[], str]] = None, + ): + self.base_url = base_url + self.base_timeout = base_timeout + self.base_headers = base_headers + self.httpx_client = httpx_client + + def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: + base_url = maybe_base_url + if self.base_url is not None and base_url is None: + base_url = self.base_url() + + if base_url is None: + raise ValueError("A base_url is required to make this request, please provide one and try again.") + return base_url + + async def request( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> httpx.Response: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + # Add the input to each of these and do None-safety checks + response = await self.httpx_client.request( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) or {} + if request_options is not None + else {} + ), + }, + omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None, + timeout=timeout, + ) + + max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request( + path=path, + method=method, + base_url=base_url, + params=params, + json=json, + content=content, + files=files, + headers=headers, + request_options=request_options, + retries=retries + 1, + omit=omit, + ) + return response + + @asynccontextmanager + async def stream( + self, + path: typing.Optional[str] = None, + *, + method: str, + base_url: typing.Optional[str] = None, + params: typing.Optional[typing.Dict[str, typing.Any]] = None, + json: typing.Optional[typing.Any] = None, + data: typing.Optional[typing.Any] = None, + content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, + files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None, + headers: typing.Optional[typing.Dict[str, typing.Any]] = None, + request_options: typing.Optional[RequestOptions] = None, + retries: int = 0, + omit: typing.Optional[typing.Any] = None, + ) -> typing.AsyncIterator[httpx.Response]: + base_url = self.get_base_url(base_url) + timeout = ( + request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else self.base_timeout() + ) + + json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) + + async with self.httpx_client.stream( + method=method, + url=urllib.parse.urljoin(f"{base_url}/", path), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self.base_headers(), + **(headers if headers is not None else {}), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + params=encode_query( + jsonable_encoder( + remove_none_from_dict( + remove_omit_from_dict( + { + **(params if params is not None else {}), + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + }, + omit=omit, + ) + ) + ) + ), + json=json_body, + data=data_body, + content=content, + files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None, + timeout=timeout, + ) as stream: + yield stream diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/jsonable_encoder.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/jsonable_encoder.py new file mode 100644 index 00000000000..1b631e9017c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/jsonable_encoder.py @@ -0,0 +1,101 @@ +# This file was auto-generated by Fern from our API Definition. + +""" +jsonable_encoder converts a Python object to a JSON-friendly dict +(e.g. datetimes to strings, Pydantic models to dicts). + +Taken from FastAPI, and made a bit simpler +https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py +""" + +import base64 +import dataclasses +import datetime as dt +from enum import Enum +from pathlib import PurePath +from types import GeneratorType +from typing import Any, Callable, Dict, List, Optional, Set, Union + +import pydantic + +from .datetime_utils import serialize_datetime +from .pydantic_utilities import ( + IS_PYDANTIC_V2, + encode_by_type, + to_jsonable_with_fallback, +) + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] + + +def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: + custom_encoder = custom_encoder or {} + if custom_encoder: + if type(obj) in custom_encoder: + return custom_encoder[type(obj)](obj) + else: + for encoder_type, encoder_instance in custom_encoder.items(): + if isinstance(obj, encoder_type): + return encoder_instance(obj) + if isinstance(obj, pydantic.BaseModel): + if IS_PYDANTIC_V2: + encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 + else: + encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 + if custom_encoder: + encoder.update(custom_encoder) + obj_dict = obj.dict(by_alias=True) + if "__root__" in obj_dict: + obj_dict = obj_dict["__root__"] + if "root" in obj_dict: + obj_dict = obj_dict["root"] + return jsonable_encoder(obj_dict, custom_encoder=encoder) + if dataclasses.is_dataclass(obj): + obj_dict = dataclasses.asdict(obj) # type: ignore + return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) + if isinstance(obj, bytes): + return base64.b64encode(obj).decode("utf-8") + if isinstance(obj, Enum): + return obj.value + if isinstance(obj, PurePath): + return str(obj) + if isinstance(obj, (str, int, float, type(None))): + return obj + if isinstance(obj, dt.datetime): + return serialize_datetime(obj) + if isinstance(obj, dt.date): + return str(obj) + if isinstance(obj, dict): + encoded_dict = {} + allowed_keys = set(obj.keys()) + for key, value in obj.items(): + if key in allowed_keys: + encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) + encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) + encoded_dict[encoded_key] = encoded_value + return encoded_dict + if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): + encoded_list = [] + for item in obj: + encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) + return encoded_list + + def fallback_serializer(o: Any) -> Any: + attempt_encode = encode_by_type(o) + if attempt_encode is not None: + return attempt_encode + + try: + data = dict(o) + except Exception as e: + errors: List[Exception] = [] + errors.append(e) + try: + data = vars(o) + except Exception as e: + errors.append(e) + raise ValueError(errors) from e + return jsonable_encoder(data, custom_encoder=custom_encoder) + + return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/pydantic_utilities.py new file mode 100644 index 00000000000..ee8f0e4105f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/pydantic_utilities.py @@ -0,0 +1,296 @@ +# This file was auto-generated by Fern from our API Definition. + +# nopycln: file +import datetime as dt +import typing +from collections import defaultdict + +import typing_extensions + +import pydantic + +from .datetime_utils import serialize_datetime +from .serialization import convert_and_respect_annotation_metadata + +IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +if IS_PYDANTIC_V2: + # isort will try to reformat the comments on these imports, which breaks mypy + # isort: off + from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + parse_date as parse_date, + ) + from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + parse_datetime as parse_datetime, + ) + from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + ENCODERS_BY_TYPE as encoders_by_type, + ) + from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 + get_args as get_args, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + get_origin as get_origin, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + is_literal_type as is_literal_type, + ) + from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2 + is_union as is_union, + ) + from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2 +else: + from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1 + from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1 + from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1 + from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1 + from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1 + from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1 + from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1 + from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1 + + # isort: on + + +T = typing.TypeVar("T") +Model = typing.TypeVar("Model", bound=pydantic.BaseModel) + + +def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T: + dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") + if IS_PYDANTIC_V2: + adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2 + return adapter.validate_python(dealiased_object) + else: + return pydantic.parse_obj_as(type_, dealiased_object) + + +def to_jsonable_with_fallback( + obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any] +) -> typing.Any: + if IS_PYDANTIC_V2: + from pydantic_core import to_jsonable_python + + return to_jsonable_python(obj, fallback=fallback_serializer) + else: + return fallback_serializer(obj) + + +class UniversalBaseModel(pydantic.BaseModel): + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( + # Allow fields begining with `model_` to be used in the model + protected_namespaces=(), + ) # type: ignore # Pydantic v2 + + @pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2 + def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2 + serialized = handler(self) + data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} + return data + + else: + + class Config: + smart_union = True + json_encoders = {dt.datetime: serialize_datetime} + + @classmethod + def model_construct( + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any + ) -> "Model": + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + return cls.construct(_fields_set, **dealiased_object) + + @classmethod + def construct( + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any + ) -> "Model": + dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") + if IS_PYDANTIC_V2: + return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2 + else: + return super().construct(_fields_set, **dealiased_object) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = { + "by_alias": True, + "exclude_unset": True, + **kwargs, + } + if IS_PYDANTIC_V2: + return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2 + else: + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + """ + Override the default dict method to `exclude_unset` by default. This function patches + `exclude_unset` to work include fields within non-None default values. + """ + # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2 + # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. + # + # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models + # that we have less control over, and this is less intrusive than custom serializers for now. + if IS_PYDANTIC_V2: + kwargs_with_defaults_exclude_unset: typing.Any = { + **kwargs, + "by_alias": True, + "exclude_unset": True, + "exclude_none": False, + } + kwargs_with_defaults_exclude_none: typing.Any = { + **kwargs, + "by_alias": True, + "exclude_none": True, + "exclude_unset": False, + } + dict_dump = deep_union_pydantic_dicts( + super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2 + super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 + ) + + else: + _fields_set = self.__fields_set__.copy() + + fields = _get_model_fields(self.__class__) + for name, field in fields.items(): + if name not in _fields_set: + default = _get_field_default(field) + + # If the default values are non-null act like they've been set + # This effectively allows exclude_unset to work like exclude_none where + # the latter passes through intentionally set none values. + if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): + _fields_set.add(name) + + if default is not None: + self.__fields_set__.add(name) + + kwargs_with_defaults_exclude_unset_include_fields: typing.Any = { + "by_alias": True, + "exclude_unset": True, + "include": _fields_set, + **kwargs, + } + + dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) + + return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write") + + +def _union_list_of_pydantic_dicts( + source: typing.List[typing.Any], destination: typing.List[typing.Any] +) -> typing.List[typing.Any]: + converted_list: typing.List[typing.Any] = [] + for i, item in enumerate(source): + destination_value = destination[i] # type: ignore + if isinstance(item, dict): + converted_list.append(deep_union_pydantic_dicts(item, destination_value)) + elif isinstance(item, list): + converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) + else: + converted_list.append(item) + return converted_list + + +def deep_union_pydantic_dicts( + source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any] +) -> typing.Dict[str, typing.Any]: + for key, value in source.items(): + node = destination.setdefault(key, {}) + if isinstance(value, dict): + deep_union_pydantic_dicts(value, node) + # Note: we do not do this same processing for sets given we do not have sets of models + # and given the sets are unordered, the processing of the set and matching objects would + # be non-trivial. + elif isinstance(value, list): + destination[key] = _union_list_of_pydantic_dicts(value, node) + else: + destination[key] = value + + return destination + + +if IS_PYDANTIC_V2: + + class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2 + pass + + UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore +else: + UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore + + +def encode_by_type(o: typing.Any) -> typing.Any: + encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = ( + defaultdict(tuple) + ) + for type_, encoder in encoders_by_type.items(): + encoders_by_class_tuples[encoder] += (type_,) + + if type(o) in encoders_by_type: + return encoders_by_type[type(o)](o) + for encoder, classes_tuple in encoders_by_class_tuples.items(): + if isinstance(o, classes_tuple): + return encoder(o) + + +def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None: + if IS_PYDANTIC_V2: + model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2 + else: + model.update_forward_refs(**localns) + + +# Mirrors Pydantic's internal typing +AnyCallable = typing.Callable[..., typing.Any] + + +def universal_root_validator( + pre: bool = False, +) -> typing.Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 + else: + return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1 + + return decorator + + +def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]: + def decorator(func: AnyCallable) -> AnyCallable: + if IS_PYDANTIC_V2: + return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2 + else: + return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1 + + return decorator + + +PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo] + + +def _get_model_fields( + model: typing.Type["Model"], +) -> typing.Mapping[str, PydanticField]: + if IS_PYDANTIC_V2: + return model.model_fields # type: ignore # Pydantic v2 + else: + return model.__fields__ # type: ignore # Pydantic v1 + + +def _get_field_default(field: PydanticField) -> typing.Any: + try: + value = field.get_default() # type: ignore # Pydantic < v1.10.15 + except: + value = field.default + if IS_PYDANTIC_V2: + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None + return value + return value diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/query_encoder.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/query_encoder.py new file mode 100644 index 00000000000..3183001d404 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/query_encoder.py @@ -0,0 +1,58 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, List, Optional, Tuple + +import pydantic + + +# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict +def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: + result = [] + for k, v in dict_flat.items(): + key = f"{key_prefix}[{k}]" if key_prefix is not None else k + if isinstance(v, dict): + result.extend(traverse_query_dict(v, key)) + elif isinstance(v, list): + for arr_v in v: + if isinstance(arr_v, dict): + result.extend(traverse_query_dict(arr_v, key)) + else: + result.append((key, arr_v)) + else: + result.append((key, v)) + return result + + +def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: + if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): + if isinstance(query_value, pydantic.BaseModel): + obj_dict = query_value.dict(by_alias=True) + else: + obj_dict = query_value + return traverse_query_dict(obj_dict, query_key) + elif isinstance(query_value, list): + encoded_values: List[Tuple[str, Any]] = [] + for value in query_value: + if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): + if isinstance(value, pydantic.BaseModel): + obj_dict = value.dict(by_alias=True) + elif isinstance(value, dict): + obj_dict = value + + encoded_values.extend(single_query_encoder(query_key, obj_dict)) + else: + encoded_values.append((query_key, value)) + + return encoded_values + + return [(query_key, query_value)] + + +def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: + if query is None: + return None + + encoded_query = [] + for k, v in query.items(): + encoded_query.extend(single_query_encoder(k, v)) + return encoded_query diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/remove_none_from_dict.py new file mode 100644 index 00000000000..c2298143f14 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/remove_none_from_dict.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Mapping, Optional + + +def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: + new: Dict[str, Any] = {} + for key, value in original.items(): + if value is not None: + new[key] = value + return new diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/request_options.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/request_options.py new file mode 100644 index 00000000000..1b38804432b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/request_options.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired + + +class RequestOptions(typing.TypedDict, total=False): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + + - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] + chunk_size: NotRequired[int] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/serialization.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/serialization.py new file mode 100644 index 00000000000..cb5dcbf93a9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/core/serialization.py @@ -0,0 +1,272 @@ +# This file was auto-generated by Fern from our API Definition. + +import collections +import inspect +import typing + +import typing_extensions + +import pydantic + + +class FieldMetadata: + """ + Metadata class used to annotate fields to provide additional information. + + Example: + class MyDict(TypedDict): + field: typing.Annotated[str, FieldMetadata(alias="field_name")] + + Will serialize: `{"field": "value"}` + To: `{"field_name": "value"}` + """ + + alias: str + + def __init__(self, *, alias: str) -> None: + self.alias = alias + + +def convert_and_respect_annotation_metadata( + *, + object_: typing.Any, + annotation: typing.Any, + inner_type: typing.Optional[typing.Any] = None, + direction: typing.Literal["read", "write"], +) -> typing.Any: + """ + Respect the metadata annotations on a field, such as aliasing. This function effectively + manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for + TypedDicts, which cannot support aliasing out of the box, and can be extended for additional + utilities, such as defaults. + + Parameters + ---------- + object_ : typing.Any + + annotation : type + The type we're looking to apply typing annotations from + + inner_type : typing.Optional[type] + + Returns + ------- + typing.Any + """ + + if object_ is None: + return None + if inner_type is None: + inner_type = annotation + + clean_type = _remove_annotations(inner_type) + # Pydantic models + if ( + inspect.isclass(clean_type) + and issubclass(clean_type, pydantic.BaseModel) + and isinstance(object_, typing.Mapping) + ): + return _convert_mapping(object_, clean_type, direction) + # TypedDicts + if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): + return _convert_mapping(object_, clean_type, direction) + + if ( + typing_extensions.get_origin(clean_type) == typing.Dict + or typing_extensions.get_origin(clean_type) == dict + or clean_type == typing.Dict + ) and isinstance(object_, typing.Dict): + key_type = typing_extensions.get_args(clean_type)[0] + value_type = typing_extensions.get_args(clean_type)[1] + + return { + key: convert_and_respect_annotation_metadata( + object_=value, + annotation=annotation, + inner_type=value_type, + direction=direction, + ) + for key, value in object_.items() + } + + # If you're iterating on a string, do not bother to coerce it to a sequence. + if not isinstance(object_, str): + if ( + typing_extensions.get_origin(clean_type) == typing.Set + or typing_extensions.get_origin(clean_type) == set + or clean_type == typing.Set + ) and isinstance(object_, typing.Set): + inner_type = typing_extensions.get_args(clean_type)[0] + return { + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + } + elif ( + ( + typing_extensions.get_origin(clean_type) == typing.List + or typing_extensions.get_origin(clean_type) == list + or clean_type == typing.List + ) + and isinstance(object_, typing.List) + ) or ( + ( + typing_extensions.get_origin(clean_type) == typing.Sequence + or typing_extensions.get_origin(clean_type) == collections.abc.Sequence + or clean_type == typing.Sequence + ) + and isinstance(object_, typing.Sequence) + ): + inner_type = typing_extensions.get_args(clean_type)[0] + return [ + convert_and_respect_annotation_metadata( + object_=item, + annotation=annotation, + inner_type=inner_type, + direction=direction, + ) + for item in object_ + ] + + if typing_extensions.get_origin(clean_type) == typing.Union: + # We should be able to ~relatively~ safely try to convert keys against all + # member types in the union, the edge case here is if one member aliases a field + # of the same name to a different name from another member + # Or if another member aliases a field of the same name that another member does not. + for member in typing_extensions.get_args(clean_type): + object_ = convert_and_respect_annotation_metadata( + object_=object_, + annotation=annotation, + inner_type=member, + direction=direction, + ) + return object_ + + annotated_type = _get_annotation(annotation) + if annotated_type is None: + return object_ + + # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) + # Then we can safely call it on the recursive conversion. + return object_ + + +def _convert_mapping( + object_: typing.Mapping[str, object], + expected_type: typing.Any, + direction: typing.Literal["read", "write"], +) -> typing.Mapping[str, object]: + converted_object: typing.Dict[str, object] = {} + annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) + aliases_to_field_names = _get_alias_to_field_name(annotations) + for key, value in object_.items(): + if direction == "read" and key in aliases_to_field_names: + dealiased_key = aliases_to_field_names.get(key) + if dealiased_key is not None: + type_ = annotations.get(dealiased_key) + else: + type_ = annotations.get(key) + # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map + # + # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias + # then we can just pass the value through as is + if type_ is None: + converted_object[key] = value + elif direction == "read" and key not in aliases_to_field_names: + converted_object[key] = convert_and_respect_annotation_metadata( + object_=value, annotation=type_, direction=direction + ) + else: + converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( + convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) + ) + return converted_object + + +def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return None + + if maybe_annotated_type == typing_extensions.NotRequired: + type_ = typing_extensions.get_args(type_)[0] + maybe_annotated_type = typing_extensions.get_origin(type_) + + if maybe_annotated_type == typing_extensions.Annotated: + return type_ + + return None + + +def _remove_annotations(type_: typing.Any) -> typing.Any: + maybe_annotated_type = typing_extensions.get_origin(type_) + if maybe_annotated_type is None: + return type_ + + if maybe_annotated_type == typing_extensions.NotRequired: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + if maybe_annotated_type == typing_extensions.Annotated: + return _remove_annotations(typing_extensions.get_args(type_)[0]) + + return type_ + + +def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_alias_to_field_name(annotations) + + +def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: + annotations = typing_extensions.get_type_hints(type_, include_extras=True) + return _get_field_to_alias_name(annotations) + + +def _get_alias_to_field_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[maybe_alias] = field + return aliases + + +def _get_field_to_alias_name( + field_to_hint: typing.Dict[str, typing.Any], +) -> typing.Dict[str, str]: + aliases = {} + for field, hint in field_to_hint.items(): + maybe_alias = _get_alias_from_type(hint) + if maybe_alias is not None: + aliases[field] = maybe_alias + return aliases + + +def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: + maybe_annotated_type = _get_annotation(type_) + + if maybe_annotated_type is not None: + # The actual annotations are 1 onward, the first is the annotated type + annotations = typing_extensions.get_args(maybe_annotated_type)[1:] + + for annotation in annotations: + if isinstance(annotation, FieldMetadata) and annotation.alias is not None: + return annotation.alias + return None + + +def _alias_key( + key: str, + type_: typing.Any, + direction: typing.Literal["read", "write"], + aliases_to_field_names: typing.Dict[str, str], +) -> str: + if direction == "read": + return aliases_to_field_names.get(key, key) + return _get_alias_from_type(type_=type_) or key diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/__init__.py new file mode 100644 index 00000000000..92307cab7fe --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import container, enum, http_methods, object, params, primitive, union + +__all__ = ["container", "enum", "http_methods", "object", "params", "primitive", "union"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/client.py new file mode 100644 index 00000000000..69930de54d7 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/client.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.client_wrapper import SyncClientWrapper +from .container.client import ContainerClient +from .enum.client import EnumClient +from .http_methods.client import HttpMethodsClient +from .object.client import ObjectClient +from .params.client import ParamsClient +from .primitive.client import PrimitiveClient +from .union.client import UnionClient +from ..core.client_wrapper import AsyncClientWrapper +from .container.client import AsyncContainerClient +from .enum.client import AsyncEnumClient +from .http_methods.client import AsyncHttpMethodsClient +from .object.client import AsyncObjectClient +from .params.client import AsyncParamsClient +from .primitive.client import AsyncPrimitiveClient +from .union.client import AsyncUnionClient + + +class EndpointsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.container = ContainerClient(client_wrapper=self._client_wrapper) + self.enum = EnumClient(client_wrapper=self._client_wrapper) + self.http_methods = HttpMethodsClient(client_wrapper=self._client_wrapper) + self.object = ObjectClient(client_wrapper=self._client_wrapper) + self.params = ParamsClient(client_wrapper=self._client_wrapper) + self.primitive = PrimitiveClient(client_wrapper=self._client_wrapper) + self.union = UnionClient(client_wrapper=self._client_wrapper) + + +class AsyncEndpointsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.container = AsyncContainerClient(client_wrapper=self._client_wrapper) + self.enum = AsyncEnumClient(client_wrapper=self._client_wrapper) + self.http_methods = AsyncHttpMethodsClient(client_wrapper=self._client_wrapper) + self.object = AsyncObjectClient(client_wrapper=self._client_wrapper) + self.params = AsyncParamsClient(client_wrapper=self._client_wrapper) + self.primitive = AsyncPrimitiveClient(client_wrapper=self._client_wrapper) + self.union = AsyncUnionClient(client_wrapper=self._client_wrapper) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/client.py new file mode 100644 index 00000000000..e9a91f68d59 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/container/client.py @@ -0,0 +1,834 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...core.request_options import RequestOptions +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.object.types.object_with_required_field import ObjectWithRequiredField +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ContainerClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_list_of_primitives( + self, *, request: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[str]: + """ + Parameters + ---------- + request : typing.Sequence[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[str] + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_list_of_primitives( + request=["string", "string"], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/list-of-primitives", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[str], + parse_obj_as( + type_=typing.List[str], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_list_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Sequence[ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ObjectWithRequiredField] + + Examples + -------- + from seed import SeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_list_of_objects( + request=[ + ObjectWithRequiredField( + string="string", + ), + ObjectWithRequiredField( + string="string", + ), + ], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/list-of-objects", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Sequence[ObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[ObjectWithRequiredField], + parse_obj_as( + type_=typing.List[ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_set_of_primitives( + self, *, request: typing.Set[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Set[str]: + """ + Parameters + ---------- + request : typing.Set[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Set[str] + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_set_of_primitives( + request={"string"}, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/set-of-primitives", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Set[str], + parse_obj_as( + type_=typing.Set[str], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_set_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Sequence[ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ObjectWithRequiredField] + + Examples + -------- + from seed import SeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_set_of_objects( + request=[ + ObjectWithRequiredField( + string="string", + ) + ], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/set-of-objects", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Sequence[ObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[ObjectWithRequiredField], + parse_obj_as( + type_=typing.List[ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_map_prim_to_prim( + self, *, request: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Dict[str, str]: + """ + Parameters + ---------- + request : typing.Dict[str, str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Dict[str, str] + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_map_prim_to_prim( + request={"string": "string"}, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/map-prim-to-prim", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Dict[str, str], + parse_obj_as( + type_=typing.Dict[str, str], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_map_of_prim_to_object( + self, + *, + request: typing.Dict[str, ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Dict[str, ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Dict[str, ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Dict[str, ObjectWithRequiredField] + + Examples + -------- + from seed import SeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_map_of_prim_to_object( + request={ + "string": ObjectWithRequiredField( + string="string", + ) + }, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/map-prim-to-object", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Dict[str, ObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Dict[str, ObjectWithRequiredField], + parse_obj_as( + type_=typing.Dict[str, ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_optional( + self, + *, + request: typing.Optional[ObjectWithRequiredField] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Optional[ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Optional[ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[ObjectWithRequiredField] + + Examples + -------- + from seed import SeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.container.get_and_return_optional( + request=ObjectWithRequiredField( + string="string", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "container/opt-objects", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=ObjectWithRequiredField, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Optional[ObjectWithRequiredField], + parse_obj_as( + type_=typing.Optional[ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncContainerClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_list_of_primitives( + self, *, request: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[str]: + """ + Parameters + ---------- + request : typing.Sequence[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[str] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_list_of_primitives( + request=["string", "string"], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/list-of-primitives", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[str], + parse_obj_as( + type_=typing.List[str], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_list_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Sequence[ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ObjectWithRequiredField] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_list_of_objects( + request=[ + ObjectWithRequiredField( + string="string", + ), + ObjectWithRequiredField( + string="string", + ), + ], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/list-of-objects", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Sequence[ObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[ObjectWithRequiredField], + parse_obj_as( + type_=typing.List[ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_set_of_primitives( + self, *, request: typing.Set[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Set[str]: + """ + Parameters + ---------- + request : typing.Set[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Set[str] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_set_of_primitives( + request={"string"}, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/set-of-primitives", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Set[str], + parse_obj_as( + type_=typing.Set[str], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_set_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Sequence[ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[ObjectWithRequiredField] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_set_of_objects( + request=[ + ObjectWithRequiredField( + string="string", + ) + ], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/set-of-objects", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Sequence[ObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.List[ObjectWithRequiredField], + parse_obj_as( + type_=typing.List[ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_map_prim_to_prim( + self, *, request: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Dict[str, str]: + """ + Parameters + ---------- + request : typing.Dict[str, str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Dict[str, str] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_map_prim_to_prim( + request={"string": "string"}, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/map-prim-to-prim", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Dict[str, str], + parse_obj_as( + type_=typing.Dict[str, str], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_map_of_prim_to_object( + self, + *, + request: typing.Dict[str, ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Dict[str, ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Dict[str, ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Dict[str, ObjectWithRequiredField] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_map_of_prim_to_object( + request={ + "string": ObjectWithRequiredField( + string="string", + ) + }, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/map-prim-to-object", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Dict[str, ObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Dict[str, ObjectWithRequiredField], + parse_obj_as( + type_=typing.Dict[str, ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_optional( + self, + *, + request: typing.Optional[ObjectWithRequiredField] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Optional[ObjectWithRequiredField]: + """ + Parameters + ---------- + request : typing.Optional[ObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.Optional[ObjectWithRequiredField] + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithRequiredField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.container.get_and_return_optional( + request=ObjectWithRequiredField( + string="string", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "container/opt-objects", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=ObjectWithRequiredField, direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + typing.Optional[ObjectWithRequiredField], + parse_obj_as( + type_=typing.Optional[ObjectWithRequiredField], # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/client.py new file mode 100644 index 00000000000..50e6ca5530f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/enum/client.py @@ -0,0 +1,127 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...types.enum.types.weather_report import WeatherReport +from ...core.request_options import RequestOptions +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class EnumClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_enum( + self, *, request: WeatherReport, request_options: typing.Optional[RequestOptions] = None + ) -> WeatherReport: + """ + Parameters + ---------- + request : WeatherReport + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + WeatherReport + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.enum.get_and_return_enum( + request="SUNNY", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "enum", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + WeatherReport, + parse_obj_as( + type_=WeatherReport, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncEnumClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_enum( + self, *, request: WeatherReport, request_options: typing.Optional[RequestOptions] = None + ) -> WeatherReport: + """ + Parameters + ---------- + request : WeatherReport + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + WeatherReport + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.enum.get_and_return_enum( + request="SUNNY", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "enum", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + WeatherReport, + parse_obj_as( + type_=WeatherReport, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/client.py new file mode 100644 index 00000000000..8cf8adae3b8 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/http_methods/client.py @@ -0,0 +1,701 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...core.request_options import RequestOptions +from ...core.jsonable_encoder import jsonable_encoder +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.object.types.object_with_optional_field import ObjectWithOptionalField +import datetime as dt +import uuid +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class HttpMethodsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def test_get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.http_methods.test_get( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_post( + self, *, string: str, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + string : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.http_methods.test_post( + string="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "http-methods", + method="POST", + json={ + "string": string, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_put( + self, id: str, *, string: str, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + id : str + + string : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.http_methods.test_put( + id="id", + string="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="PUT", + json={ + "string": string, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_patch( + self, + id: str, + *, + string: typing.Optional[str] = OMIT, + integer: typing.Optional[int] = OMIT, + long_: typing.Optional[int] = OMIT, + double: typing.Optional[float] = OMIT, + bool_: typing.Optional[bool] = OMIT, + datetime: typing.Optional[dt.datetime] = OMIT, + date: typing.Optional[dt.date] = OMIT, + uuid_: typing.Optional[uuid.UUID] = OMIT, + base_64: typing.Optional[str] = OMIT, + list_: typing.Optional[typing.Sequence[str]] = OMIT, + set_: typing.Optional[typing.Set[str]] = OMIT, + map_: typing.Optional[typing.Dict[int, str]] = OMIT, + bigint: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + id : str + + string : typing.Optional[str] + This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + + integer : typing.Optional[int] + + long_ : typing.Optional[int] + + double : typing.Optional[float] + + bool_ : typing.Optional[bool] + + datetime : typing.Optional[dt.datetime] + + date : typing.Optional[dt.date] + + uuid_ : typing.Optional[uuid.UUID] + + base_64 : typing.Optional[str] + + list_ : typing.Optional[typing.Sequence[str]] + + set_ : typing.Optional[typing.Set[str]] + + map_ : typing.Optional[typing.Dict[int, str]] + + bigint : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import datetime + import uuid + + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.http_methods.test_patch( + id="id", + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="PATCH", + json={ + "string": string, + "integer": integer, + "long": long_, + "double": double, + "bool": bool_, + "datetime": datetime, + "date": date, + "uuid": uuid_, + "base64": base_64, + "list": list_, + "set": set_, + "map": map_, + "bigint": bigint, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> bool: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + bool + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.http_methods.test_delete( + id="id", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + bool, + parse_obj_as( + type_=bool, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncHttpMethodsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def test_get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.http_methods.test_get( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_post( + self, *, string: str, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + string : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.http_methods.test_post( + string="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "http-methods", + method="POST", + json={ + "string": string, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_put( + self, id: str, *, string: str, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + id : str + + string : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.http_methods.test_put( + id="id", + string="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="PUT", + json={ + "string": string, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_patch( + self, + id: str, + *, + string: typing.Optional[str] = OMIT, + integer: typing.Optional[int] = OMIT, + long_: typing.Optional[int] = OMIT, + double: typing.Optional[float] = OMIT, + bool_: typing.Optional[bool] = OMIT, + datetime: typing.Optional[dt.datetime] = OMIT, + date: typing.Optional[dt.date] = OMIT, + uuid_: typing.Optional[uuid.UUID] = OMIT, + base_64: typing.Optional[str] = OMIT, + list_: typing.Optional[typing.Sequence[str]] = OMIT, + set_: typing.Optional[typing.Set[str]] = OMIT, + map_: typing.Optional[typing.Dict[int, str]] = OMIT, + bigint: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + id : str + + string : typing.Optional[str] + This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + + integer : typing.Optional[int] + + long_ : typing.Optional[int] + + double : typing.Optional[float] + + bool_ : typing.Optional[bool] + + datetime : typing.Optional[dt.datetime] + + date : typing.Optional[dt.date] + + uuid_ : typing.Optional[uuid.UUID] + + base_64 : typing.Optional[str] + + list_ : typing.Optional[typing.Sequence[str]] + + set_ : typing.Optional[typing.Set[str]] + + map_ : typing.Optional[typing.Dict[int, str]] + + bigint : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import asyncio + import datetime + import uuid + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.http_methods.test_patch( + id="id", + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="PATCH", + json={ + "string": string, + "integer": integer, + "long": long_, + "double": double, + "bool": bool_, + "datetime": datetime, + "date": date, + "uuid": uuid_, + "base64": base_64, + "list": list_, + "set": set_, + "map": map_, + "bigint": bigint, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> bool: + """ + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + bool + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.http_methods.test_delete( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"http-methods/{jsonable_encoder(id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + bool, + parse_obj_as( + type_=bool, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/client.py new file mode 100644 index 00000000000..53ac56a9f1e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/object/client.py @@ -0,0 +1,1083 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +import datetime as dt +import uuid +from ...core.request_options import RequestOptions +from ...types.object.types.object_with_optional_field import ObjectWithOptionalField +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...types.object.types.object_with_required_field import ObjectWithRequiredField +from ...types.object.types.object_with_map_of_map import ObjectWithMapOfMap +from ...types.object.types.nested_object_with_optional_field import NestedObjectWithOptionalField +from ...core.serialization import convert_and_respect_annotation_metadata +from ...types.object.types.nested_object_with_required_field import NestedObjectWithRequiredField +from ...core.jsonable_encoder import jsonable_encoder +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ObjectClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_with_optional_field( + self, + *, + string: typing.Optional[str] = OMIT, + integer: typing.Optional[int] = OMIT, + long_: typing.Optional[int] = OMIT, + double: typing.Optional[float] = OMIT, + bool_: typing.Optional[bool] = OMIT, + datetime: typing.Optional[dt.datetime] = OMIT, + date: typing.Optional[dt.date] = OMIT, + uuid_: typing.Optional[uuid.UUID] = OMIT, + base_64: typing.Optional[str] = OMIT, + list_: typing.Optional[typing.Sequence[str]] = OMIT, + set_: typing.Optional[typing.Set[str]] = OMIT, + map_: typing.Optional[typing.Dict[int, str]] = OMIT, + bigint: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + string : typing.Optional[str] + This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + + integer : typing.Optional[int] + + long_ : typing.Optional[int] + + double : typing.Optional[float] + + bool_ : typing.Optional[bool] + + datetime : typing.Optional[dt.datetime] + + date : typing.Optional[dt.date] + + uuid_ : typing.Optional[uuid.UUID] + + base_64 : typing.Optional[str] + + list_ : typing.Optional[typing.Sequence[str]] + + set_ : typing.Optional[typing.Set[str]] + + map_ : typing.Optional[typing.Dict[int, str]] + + bigint : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import datetime + import uuid + + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.object.get_and_return_with_optional_field( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "object/get-and-return-with-optional-field", + method="POST", + json={ + "string": string, + "integer": integer, + "long": long_, + "double": double, + "bool": bool_, + "datetime": datetime, + "date": date, + "uuid": uuid_, + "base64": base_64, + "list": list_, + "set": set_, + "map": map_, + "bigint": bigint, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_with_required_field( + self, *, string: str, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithRequiredField: + """ + Parameters + ---------- + string : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithRequiredField + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.object.get_and_return_with_required_field( + string="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "object/get-and-return-with-required-field", + method="POST", + json={ + "string": string, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithRequiredField, + parse_obj_as( + type_=ObjectWithRequiredField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_with_map_of_map( + self, *, map_: typing.Dict[str, typing.Dict[str, str]], request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithMapOfMap: + """ + Parameters + ---------- + map_ : typing.Dict[str, typing.Dict[str, str]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithMapOfMap + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.object.get_and_return_with_map_of_map( + map_={"map": {"map": "map"}}, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "object/get-and-return-with-map-of-map", + method="POST", + json={ + "map": map_, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithMapOfMap, + parse_obj_as( + type_=ObjectWithMapOfMap, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_nested_with_optional_field( + self, + *, + string: typing.Optional[str] = OMIT, + nested_object: typing.Optional[ObjectWithOptionalField] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithOptionalField: + """ + Parameters + ---------- + string : typing.Optional[str] + + nested_object : typing.Optional[ObjectWithOptionalField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + NestedObjectWithOptionalField + + Examples + -------- + import datetime + import uuid + + from seed import SeedExhaustive + from seed.types.object import ObjectWithOptionalField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.object.get_and_return_nested_with_optional_field( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "object/get-and-return-nested-with-optional-field", + method="POST", + json={ + "string": string, + "NestedObject": convert_and_respect_annotation_metadata( + object_=nested_object, annotation=ObjectWithOptionalField, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + NestedObjectWithOptionalField, + parse_obj_as( + type_=NestedObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_nested_with_required_field( + self, + string_: str, + *, + string: str, + nested_object: ObjectWithOptionalField, + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithRequiredField: + """ + Parameters + ---------- + string_ : str + + string : str + + nested_object : ObjectWithOptionalField + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + NestedObjectWithRequiredField + + Examples + -------- + import datetime + import uuid + + from seed import SeedExhaustive + from seed.types.object import ObjectWithOptionalField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.object.get_and_return_nested_with_required_field( + string_="string", + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"object/get-and-return-nested-with-required-field/{jsonable_encoder(string_)}", + method="POST", + json={ + "string": string, + "NestedObject": convert_and_respect_annotation_metadata( + object_=nested_object, annotation=ObjectWithOptionalField, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + NestedObjectWithRequiredField, + parse_obj_as( + type_=NestedObjectWithRequiredField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_nested_with_required_field_as_list( + self, + *, + request: typing.Sequence[NestedObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithRequiredField: + """ + Parameters + ---------- + request : typing.Sequence[NestedObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + NestedObjectWithRequiredField + + Examples + -------- + import datetime + import uuid + + from seed import SeedExhaustive + from seed.types.object import ( + NestedObjectWithRequiredField, + ObjectWithOptionalField, + ) + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.object.get_and_return_nested_with_required_field_as_list( + request=[ + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + ], + ) + """ + _response = self._client_wrapper.httpx_client.request( + "object/get-and-return-nested-with-required-field-list", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Sequence[NestedObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + NestedObjectWithRequiredField, + parse_obj_as( + type_=NestedObjectWithRequiredField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncObjectClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_with_optional_field( + self, + *, + string: typing.Optional[str] = OMIT, + integer: typing.Optional[int] = OMIT, + long_: typing.Optional[int] = OMIT, + double: typing.Optional[float] = OMIT, + bool_: typing.Optional[bool] = OMIT, + datetime: typing.Optional[dt.datetime] = OMIT, + date: typing.Optional[dt.date] = OMIT, + uuid_: typing.Optional[uuid.UUID] = OMIT, + base_64: typing.Optional[str] = OMIT, + list_: typing.Optional[typing.Sequence[str]] = OMIT, + set_: typing.Optional[typing.Set[str]] = OMIT, + map_: typing.Optional[typing.Dict[int, str]] = OMIT, + bigint: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + string : typing.Optional[str] + This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + + integer : typing.Optional[int] + + long_ : typing.Optional[int] + + double : typing.Optional[float] + + bool_ : typing.Optional[bool] + + datetime : typing.Optional[dt.datetime] + + date : typing.Optional[dt.date] + + uuid_ : typing.Optional[uuid.UUID] + + base_64 : typing.Optional[str] + + list_ : typing.Optional[typing.Sequence[str]] + + set_ : typing.Optional[typing.Set[str]] + + map_ : typing.Optional[typing.Dict[int, str]] + + bigint : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import asyncio + import datetime + import uuid + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.object.get_and_return_with_optional_field( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "object/get-and-return-with-optional-field", + method="POST", + json={ + "string": string, + "integer": integer, + "long": long_, + "double": double, + "bool": bool_, + "datetime": datetime, + "date": date, + "uuid": uuid_, + "base64": base_64, + "list": list_, + "set": set_, + "map": map_, + "bigint": bigint, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_with_required_field( + self, *, string: str, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithRequiredField: + """ + Parameters + ---------- + string : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithRequiredField + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.object.get_and_return_with_required_field( + string="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "object/get-and-return-with-required-field", + method="POST", + json={ + "string": string, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithRequiredField, + parse_obj_as( + type_=ObjectWithRequiredField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_with_map_of_map( + self, *, map_: typing.Dict[str, typing.Dict[str, str]], request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithMapOfMap: + """ + Parameters + ---------- + map_ : typing.Dict[str, typing.Dict[str, str]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithMapOfMap + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.object.get_and_return_with_map_of_map( + map_={"map": {"map": "map"}}, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "object/get-and-return-with-map-of-map", + method="POST", + json={ + "map": map_, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithMapOfMap, + parse_obj_as( + type_=ObjectWithMapOfMap, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_nested_with_optional_field( + self, + *, + string: typing.Optional[str] = OMIT, + nested_object: typing.Optional[ObjectWithOptionalField] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithOptionalField: + """ + Parameters + ---------- + string : typing.Optional[str] + + nested_object : typing.Optional[ObjectWithOptionalField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + NestedObjectWithOptionalField + + Examples + -------- + import asyncio + import datetime + import uuid + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithOptionalField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.object.get_and_return_nested_with_optional_field( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "object/get-and-return-nested-with-optional-field", + method="POST", + json={ + "string": string, + "NestedObject": convert_and_respect_annotation_metadata( + object_=nested_object, annotation=ObjectWithOptionalField, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + NestedObjectWithOptionalField, + parse_obj_as( + type_=NestedObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_nested_with_required_field( + self, + string_: str, + *, + string: str, + nested_object: ObjectWithOptionalField, + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithRequiredField: + """ + Parameters + ---------- + string_ : str + + string : str + + nested_object : ObjectWithOptionalField + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + NestedObjectWithRequiredField + + Examples + -------- + import asyncio + import datetime + import uuid + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithOptionalField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.object.get_and_return_nested_with_required_field( + string_="string", + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"object/get-and-return-nested-with-required-field/{jsonable_encoder(string_)}", + method="POST", + json={ + "string": string, + "NestedObject": convert_and_respect_annotation_metadata( + object_=nested_object, annotation=ObjectWithOptionalField, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + NestedObjectWithRequiredField, + parse_obj_as( + type_=NestedObjectWithRequiredField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_nested_with_required_field_as_list( + self, + *, + request: typing.Sequence[NestedObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithRequiredField: + """ + Parameters + ---------- + request : typing.Sequence[NestedObjectWithRequiredField] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + NestedObjectWithRequiredField + + Examples + -------- + import asyncio + import datetime + import uuid + + from seed import AsyncSeedExhaustive + from seed.types.object import ( + NestedObjectWithRequiredField, + ObjectWithOptionalField, + ) + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.object.get_and_return_nested_with_required_field_as_list( + request=[ + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + ], + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "object/get-and-return-nested-with-required-field-list", + method="POST", + json=convert_and_respect_annotation_metadata( + object_=request, annotation=typing.Sequence[NestedObjectWithRequiredField], direction="write" + ), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + NestedObjectWithRequiredField, + parse_obj_as( + type_=NestedObjectWithRequiredField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/client.py new file mode 100644 index 00000000000..677c2c61aee --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/params/client.py @@ -0,0 +1,561 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...core.request_options import RequestOptions +from ...core.jsonable_encoder import jsonable_encoder +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ParamsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_with_path(self, param: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + GET with path param + + Parameters + ---------- + param : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.params.get_with_path( + param="param", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"params/path/{jsonable_encoder(param)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_with_query( + self, *, query: str, number: int, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with query param + + Parameters + ---------- + query : str + + number : int + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.params.get_with_query( + query="query", + number=1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "params", + method="GET", + params={ + "query": query, + "number": number, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_with_allow_multiple_query( + self, + *, + query: typing.Union[str, typing.Sequence[str]], + numer: typing.Union[int, typing.Sequence[int]], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + GET with multiple of same query param + + Parameters + ---------- + query : typing.Union[str, typing.Sequence[str]] + + numer : typing.Union[int, typing.Sequence[int]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.params.get_with_allow_multiple_query( + query="query", + numer=1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "params", + method="GET", + params={ + "query": query, + "numer": numer, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_with_path_and_query( + self, param: str, *, query: str, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with path and query params + + Parameters + ---------- + param : str + + query : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.params.get_with_path_and_query( + param="param", + query="query", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"params/path-query/{jsonable_encoder(param)}", + method="GET", + params={ + "query": query, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def modify_with_path( + self, param: str, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + PUT to update with path param + + Parameters + ---------- + param : str + + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.params.modify_with_path( + param="param", + request="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + f"params/path/{jsonable_encoder(param)}", + method="PUT", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncParamsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_with_path(self, param: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + GET with path param + + Parameters + ---------- + param : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.params.get_with_path( + param="param", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"params/path/{jsonable_encoder(param)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_with_query( + self, *, query: str, number: int, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with query param + + Parameters + ---------- + query : str + + number : int + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.params.get_with_query( + query="query", + number=1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "params", + method="GET", + params={ + "query": query, + "number": number, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_with_allow_multiple_query( + self, + *, + query: typing.Union[str, typing.Sequence[str]], + numer: typing.Union[int, typing.Sequence[int]], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + GET with multiple of same query param + + Parameters + ---------- + query : typing.Union[str, typing.Sequence[str]] + + numer : typing.Union[int, typing.Sequence[int]] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.params.get_with_allow_multiple_query( + query="query", + numer=1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "params", + method="GET", + params={ + "query": query, + "numer": numer, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_with_path_and_query( + self, param: str, *, query: str, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with path and query params + + Parameters + ---------- + param : str + + query : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.params.get_with_path_and_query( + param="param", + query="query", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"params/path-query/{jsonable_encoder(param)}", + method="GET", + params={ + "query": query, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def modify_with_path( + self, param: str, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + PUT to update with path param + + Parameters + ---------- + param : str + + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.params.modify_with_path( + param="param", + request="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + f"params/path/{jsonable_encoder(param)}", + method="PUT", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/client.py new file mode 100644 index 00000000000..5e18f184482 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/primitive/client.py @@ -0,0 +1,969 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...core.request_options import RequestOptions +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +import datetime as dt +import uuid +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class PrimitiveClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_string(self, *, request: str, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters + ---------- + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_string( + request="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/string", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_int(self, *, request: int, request_options: typing.Optional[RequestOptions] = None) -> int: + """ + Parameters + ---------- + request : int + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + int + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_int( + request=1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/integer", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + int, + parse_obj_as( + type_=int, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_long(self, *, request: int, request_options: typing.Optional[RequestOptions] = None) -> int: + """ + Parameters + ---------- + request : int + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + int + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_long( + request=1000000, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/long", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + int, + parse_obj_as( + type_=int, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_double( + self, *, request: float, request_options: typing.Optional[RequestOptions] = None + ) -> float: + """ + Parameters + ---------- + request : float + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + float + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_double( + request=1.1, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/double", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + float, + parse_obj_as( + type_=float, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_bool(self, *, request: bool, request_options: typing.Optional[RequestOptions] = None) -> bool: + """ + Parameters + ---------- + request : bool + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + bool + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_bool( + request=True, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/boolean", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + bool, + parse_obj_as( + type_=bool, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_datetime( + self, *, request: dt.datetime, request_options: typing.Optional[RequestOptions] = None + ) -> dt.datetime: + """ + Parameters + ---------- + request : dt.datetime + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + dt.datetime + + Examples + -------- + import datetime + + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_datetime( + request=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/datetime", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + dt.datetime, + parse_obj_as( + type_=dt.datetime, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_date( + self, *, request: dt.date, request_options: typing.Optional[RequestOptions] = None + ) -> dt.date: + """ + Parameters + ---------- + request : dt.date + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + dt.date + + Examples + -------- + import datetime + + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_date( + request=datetime.date.fromisoformat( + "2023-01-15", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/date", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + dt.date, + parse_obj_as( + type_=dt.date, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_uuid( + self, *, request: uuid.UUID, request_options: typing.Optional[RequestOptions] = None + ) -> uuid.UUID: + """ + Parameters + ---------- + request : uuid.UUID + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + uuid.UUID + + Examples + -------- + import uuid + + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_uuid( + request=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/uuid", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + uuid.UUID, + parse_obj_as( + type_=uuid.UUID, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_base_64(self, *, request: str, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters + ---------- + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.primitive.get_and_return_base_64( + request="SGVsbG8gd29ybGQh", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "primitive/base64", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncPrimitiveClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_string( + self, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + Parameters + ---------- + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_string( + request="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/string", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_int(self, *, request: int, request_options: typing.Optional[RequestOptions] = None) -> int: + """ + Parameters + ---------- + request : int + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + int + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_int( + request=1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/integer", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + int, + parse_obj_as( + type_=int, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_long( + self, *, request: int, request_options: typing.Optional[RequestOptions] = None + ) -> int: + """ + Parameters + ---------- + request : int + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + int + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_long( + request=1000000, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/long", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + int, + parse_obj_as( + type_=int, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_double( + self, *, request: float, request_options: typing.Optional[RequestOptions] = None + ) -> float: + """ + Parameters + ---------- + request : float + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + float + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_double( + request=1.1, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/double", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + float, + parse_obj_as( + type_=float, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_bool( + self, *, request: bool, request_options: typing.Optional[RequestOptions] = None + ) -> bool: + """ + Parameters + ---------- + request : bool + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + bool + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_bool( + request=True, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/boolean", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + bool, + parse_obj_as( + type_=bool, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_datetime( + self, *, request: dt.datetime, request_options: typing.Optional[RequestOptions] = None + ) -> dt.datetime: + """ + Parameters + ---------- + request : dt.datetime + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + dt.datetime + + Examples + -------- + import asyncio + import datetime + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_datetime( + request=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/datetime", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + dt.datetime, + parse_obj_as( + type_=dt.datetime, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_date( + self, *, request: dt.date, request_options: typing.Optional[RequestOptions] = None + ) -> dt.date: + """ + Parameters + ---------- + request : dt.date + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + dt.date + + Examples + -------- + import asyncio + import datetime + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_date( + request=datetime.date.fromisoformat( + "2023-01-15", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/date", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + dt.date, + parse_obj_as( + type_=dt.date, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_uuid( + self, *, request: uuid.UUID, request_options: typing.Optional[RequestOptions] = None + ) -> uuid.UUID: + """ + Parameters + ---------- + request : uuid.UUID + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + uuid.UUID + + Examples + -------- + import asyncio + import uuid + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_uuid( + request=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/uuid", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + uuid.UUID, + parse_obj_as( + type_=uuid.UUID, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_base_64( + self, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + Parameters + ---------- + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.primitive.get_and_return_base_64( + request="SGVsbG8gd29ybGQh", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "primitive/base64", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/client.py new file mode 100644 index 00000000000..f469c0814a8 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/endpoints/union/client.py @@ -0,0 +1,136 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ...core.client_wrapper import SyncClientWrapper +from ...types.union.types.animal import Animal +from ...core.request_options import RequestOptions +from ...core.serialization import convert_and_respect_annotation_metadata +from ...core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class UnionClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_union( + self, *, request: Animal, request_options: typing.Optional[RequestOptions] = None + ) -> Animal: + """ + Parameters + ---------- + request : Animal + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Animal + + Examples + -------- + from seed import SeedExhaustive + from seed.types.union import Animal_Dog + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.endpoints.union.get_and_return_union( + request=Animal_Dog( + name="name", + likes_to_woof=True, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "union", + method="POST", + json=convert_and_respect_annotation_metadata(object_=request, annotation=Animal, direction="write"), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Animal, + parse_obj_as( + type_=Animal, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncUnionClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_union( + self, *, request: Animal, request_options: typing.Optional[RequestOptions] = None + ) -> Animal: + """ + Parameters + ---------- + request : Animal + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Animal + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + from seed.types.union import Animal_Dog + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.endpoints.union.get_and_return_union( + request=Animal_Dog( + name="name", + likes_to_woof=True, + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "union", + method="POST", + json=convert_and_respect_annotation_metadata(object_=request, annotation=Animal, direction="write"), + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + Animal, + parse_obj_as( + type_=Animal, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/__init__.py new file mode 100644 index 00000000000..57de0a862e9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import BadObjectRequestInfo +from .errors import BadRequestBody + +__all__ = ["BadObjectRequestInfo", "BadRequestBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/__init__.py new file mode 100644 index 00000000000..04eaf8e383b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .bad_request_body import BadRequestBody + +__all__ = ["BadRequestBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/bad_request_body.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/bad_request_body.py new file mode 100644 index 00000000000..f8518e355d0 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/errors/bad_request_body.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.api_error import ApiError +from ..types.bad_object_request_info import BadObjectRequestInfo + + +class BadRequestBody(ApiError): + def __init__(self, body: BadObjectRequestInfo): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/__init__.py new file mode 100644 index 00000000000..b6788a57056 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .bad_object_request_info import BadObjectRequestInfo + +__all__ = ["BadObjectRequestInfo"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/bad_object_request_info.py new file mode 100644 index 00000000000..edcb3da4b0d --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/general_errors/types/bad_object_request_info.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic + + +class BadObjectRequestInfo(UniversalBaseModel): + message: str + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/client.py new file mode 100644 index 00000000000..096f1dc8f93 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/inlined_requests/client.py @@ -0,0 +1,235 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +from ..types.object.types.object_with_optional_field import ObjectWithOptionalField +from ..core.request_options import RequestOptions +from ..core.serialization import convert_and_respect_annotation_metadata +from ..core.pydantic_utilities import parse_obj_as +from ..general_errors.errors.bad_request_body import BadRequestBody +from ..general_errors.types.bad_object_request_info import BadObjectRequestInfo +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class InlinedRequestsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def post_with_object_bodyand_response( + self, + *, + string: str, + integer: int, + nested_object: ObjectWithOptionalField, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + POST with custom object in request body, response is an object + + Parameters + ---------- + string : str + + integer : int + + nested_object : ObjectWithOptionalField + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import datetime + import uuid + + from seed import SeedExhaustive + from seed.types.object import ObjectWithOptionalField + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.inlined_requests.post_with_object_bodyand_response( + string="string", + integer=1, + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + """ + _response = self._client_wrapper.httpx_client.request( + "req-bodies/object", + method="POST", + json={ + "string": string, + "integer": integer, + "NestedObject": convert_and_respect_annotation_metadata( + object_=nested_object, annotation=ObjectWithOptionalField, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestBody( + typing.cast( + BadObjectRequestInfo, + parse_obj_as( + type_=BadObjectRequestInfo, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncInlinedRequestsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def post_with_object_bodyand_response( + self, + *, + string: str, + integer: int, + nested_object: ObjectWithOptionalField, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + POST with custom object in request body, response is an object + + Parameters + ---------- + string : str + + integer : int + + nested_object : ObjectWithOptionalField + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import asyncio + import datetime + import uuid + + from seed import AsyncSeedExhaustive + from seed.types.object import ObjectWithOptionalField + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.inlined_requests.post_with_object_bodyand_response( + string="string", + integer=1, + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat( + "2024-01-15 09:30:00+00:00", + ), + date=datetime.date.fromisoformat( + "2023-01-15", + ), + uuid_=uuid.UUID( + "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + ), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "req-bodies/object", + method="POST", + json={ + "string": string, + "integer": integer, + "NestedObject": convert_and_respect_annotation_metadata( + object_=nested_object, annotation=ObjectWithOptionalField, direction="write" + ), + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestBody( + typing.cast( + BadObjectRequestInfo, + parse_obj_as( + type_=BadObjectRequestInfo, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/client.py new file mode 100644 index 00000000000..886ef5803e9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_auth/client.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +from ..core.request_options import RequestOptions +from ..core.pydantic_utilities import parse_obj_as +from ..general_errors.errors.bad_request_body import BadRequestBody +from ..general_errors.types.bad_object_request_info import BadObjectRequestInfo +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class NoAuthClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def post_with_no_auth( + self, *, request: typing.Optional[typing.Any] = None, request_options: typing.Optional[RequestOptions] = None + ) -> bool: + """ + POST request with no auth + + Parameters + ---------- + request : typing.Optional[typing.Any] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + bool + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.no_auth.post_with_no_auth( + request={"key": "value"}, + ) + """ + _response = self._client_wrapper.httpx_client.request( + "no-auth", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + bool, + parse_obj_as( + type_=bool, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestBody( + typing.cast( + BadObjectRequestInfo, + parse_obj_as( + type_=BadObjectRequestInfo, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncNoAuthClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def post_with_no_auth( + self, *, request: typing.Optional[typing.Any] = None, request_options: typing.Optional[RequestOptions] = None + ) -> bool: + """ + POST request with no auth + + Parameters + ---------- + request : typing.Optional[typing.Any] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + bool + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.no_auth.post_with_no_auth( + request={"key": "value"}, + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "no-auth", + method="POST", + json=request, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + bool, + parse_obj_as( + type_=bool, # type: ignore + object_=_response.json(), + ), + ) + if _response.status_code == 400: + raise BadRequestBody( + typing.cast( + BadObjectRequestInfo, + parse_obj_as( + type_=BadObjectRequestInfo, # type: ignore + object_=_response.json(), + ), + ) + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/client.py new file mode 100644 index 00000000000..f6408c8c391 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/no_req_body/client.py @@ -0,0 +1,200 @@ +# This file was auto-generated by Fern from our API Definition. + +from ..core.client_wrapper import SyncClientWrapper +import typing +from ..core.request_options import RequestOptions +from ..types.object.types.object_with_optional_field import ObjectWithOptionalField +from ..core.pydantic_utilities import parse_obj_as +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + + +class NoReqBodyClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_with_no_request_body( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.no_req_body.get_with_no_request_body() + """ + _response = self._client_wrapper.httpx_client.request( + "no-req-body", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def post_with_no_request_body(self, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.no_req_body.post_with_no_request_body() + """ + _response = self._client_wrapper.httpx_client.request( + "no-req-body", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncNoReqBodyClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_with_no_request_body( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ObjectWithOptionalField + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.no_req_body.get_with_no_request_body() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "no-req-body", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + ObjectWithOptionalField, + parse_obj_as( + type_=ObjectWithOptionalField, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def post_with_no_request_body(self, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + str + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.no_req_body.post_with_no_request_body() + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "no-req-body", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return typing.cast( + str, + parse_obj_as( + type_=str, # type: ignore + object_=_response.json(), + ), + ) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/py.typed b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/py.typed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/client.py new file mode 100644 index 00000000000..98e03a9b5fe --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/req_with_headers/client.py @@ -0,0 +1,143 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from ..core.client_wrapper import SyncClientWrapper +from ..core.request_options import RequestOptions +from json.decoder import JSONDecodeError +from ..core.api_error import ApiError +from ..core.client_wrapper import AsyncClientWrapper + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ReqWithHeadersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_with_custom_header( + self, + *, + x_test_service_header: str, + x_test_endpoint_header: str, + request: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Parameters + ---------- + x_test_service_header : str + + x_test_endpoint_header : str + + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from seed import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + client.req_with_headers.get_with_custom_header( + x_test_service_header="X-TEST-SERVICE-HEADER", + x_test_endpoint_header="X-TEST-ENDPOINT-HEADER", + request="string", + ) + """ + _response = self._client_wrapper.httpx_client.request( + "test-headers/custom-header", + method="POST", + json=request, + headers={ + "X-TEST-SERVICE-HEADER": str(x_test_service_header) if x_test_service_header is not None else None, + "X-TEST-ENDPOINT-HEADER": str(x_test_endpoint_header) if x_test_endpoint_header is not None else None, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncReqWithHeadersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_with_custom_header( + self, + *, + x_test_service_header: str, + x_test_endpoint_header: str, + request: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Parameters + ---------- + x_test_service_header : str + + x_test_endpoint_header : str + + request : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + import asyncio + + from seed import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + + + async def main() -> None: + await client.req_with_headers.get_with_custom_header( + x_test_service_header="X-TEST-SERVICE-HEADER", + x_test_endpoint_header="X-TEST-ENDPOINT-HEADER", + request="string", + ) + + + asyncio.run(main()) + """ + _response = await self._client_wrapper.httpx_client.request( + "test-headers/custom-header", + method="POST", + json=request, + headers={ + "X-TEST-SERVICE-HEADER": str(x_test_service_header) if x_test_service_header is not None else None, + "X-TEST-ENDPOINT-HEADER": str(x_test_endpoint_header) if x_test_endpoint_header is not None else None, + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + return + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/__init__.py new file mode 100644 index 00000000000..e7a49db5142 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/__init__.py @@ -0,0 +1,43 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import enum, object, union +from .enum import ErrorWithEnumBody, WeatherReport +from .object import ( + DoubleOptional, + NestedObjectWithOptionalField, + NestedObjectWithOptionalFieldError, + NestedObjectWithRequiredField, + NestedObjectWithRequiredFieldError, + ObjectWithMapOfMap, + ObjectWithOptionalField, + ObjectWithOptionalFieldError, + ObjectWithRequiredField, + ObjectWithRequiredFieldError, + OptionalAlias, +) +from .union import Animal, Animal_Cat, Animal_Dog, Cat, Dog, ErrorWithUnionBody + +__all__ = [ + "Animal", + "Animal_Cat", + "Animal_Dog", + "Cat", + "Dog", + "DoubleOptional", + "ErrorWithEnumBody", + "ErrorWithUnionBody", + "NestedObjectWithOptionalField", + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredField", + "NestedObjectWithRequiredFieldError", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredField", + "ObjectWithRequiredFieldError", + "OptionalAlias", + "WeatherReport", + "enum", + "object", + "union", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/__init__.py new file mode 100644 index 00000000000..b1c48999a72 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import WeatherReport +from .errors import ErrorWithEnumBody + +__all__ = ["ErrorWithEnumBody", "WeatherReport"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/__init__.py new file mode 100644 index 00000000000..f5945e36d9d --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .error_with_enum_body import ErrorWithEnumBody + +__all__ = ["ErrorWithEnumBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/error_with_enum_body.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/error_with_enum_body.py new file mode 100644 index 00000000000..dfdc65ac0a2 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/errors/error_with_enum_body.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.weather_report import WeatherReport + + +class ErrorWithEnumBody(ApiError): + def __init__(self, body: WeatherReport): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/__init__.py new file mode 100644 index 00000000000..7a47d1fefc6 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .weather_report import WeatherReport + +__all__ = ["WeatherReport"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/weather_report.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/weather_report.py new file mode 100644 index 00000000000..2d54965dc22 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/enum/types/weather_report.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +WeatherReport = typing.Union[typing.Literal["SUNNY", "CLOUDY", "RAINING", "SNOWING"], typing.Any] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/__init__.py new file mode 100644 index 00000000000..e3a774b5a05 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/__init__.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + DoubleOptional, + NestedObjectWithOptionalField, + NestedObjectWithRequiredField, + ObjectWithMapOfMap, + ObjectWithOptionalField, + ObjectWithRequiredField, + OptionalAlias, +) +from .errors import ( + NestedObjectWithOptionalFieldError, + NestedObjectWithRequiredFieldError, + ObjectWithOptionalFieldError, + ObjectWithRequiredFieldError, +) + +__all__ = [ + "DoubleOptional", + "NestedObjectWithOptionalField", + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredField", + "NestedObjectWithRequiredFieldError", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredField", + "ObjectWithRequiredFieldError", + "OptionalAlias", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/__init__.py new file mode 100644 index 00000000000..7e7e4c63aa8 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/__init__.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from .nested_object_with_optional_field_error import NestedObjectWithOptionalFieldError +from .nested_object_with_required_field_error import NestedObjectWithRequiredFieldError +from .object_with_optional_field_error import ObjectWithOptionalFieldError +from .object_with_required_field_error import ObjectWithRequiredFieldError + +__all__ = [ + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredFieldError", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredFieldError", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_optional_field_error.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_optional_field_error.py new file mode 100644 index 00000000000..a3886c45b34 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_optional_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.nested_object_with_optional_field import NestedObjectWithOptionalField + + +class NestedObjectWithOptionalFieldError(ApiError): + def __init__(self, body: NestedObjectWithOptionalField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_required_field_error.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_required_field_error.py new file mode 100644 index 00000000000..3b6b788d492 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/nested_object_with_required_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.nested_object_with_required_field import NestedObjectWithRequiredField + + +class NestedObjectWithRequiredFieldError(ApiError): + def __init__(self, body: NestedObjectWithRequiredField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_optional_field_error.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_optional_field_error.py new file mode 100644 index 00000000000..3652a448b6e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_optional_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.object_with_optional_field import ObjectWithOptionalField + + +class ObjectWithOptionalFieldError(ApiError): + def __init__(self, body: ObjectWithOptionalField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_required_field_error.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_required_field_error.py new file mode 100644 index 00000000000..ee17778fd26 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/errors/object_with_required_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.object_with_required_field import ObjectWithRequiredField + + +class ObjectWithRequiredFieldError(ApiError): + def __init__(self, body: ObjectWithRequiredField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/__init__.py new file mode 100644 index 00000000000..2620e6eea12 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/__init__.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from .double_optional import DoubleOptional +from .nested_object_with_optional_field import NestedObjectWithOptionalField +from .nested_object_with_required_field import NestedObjectWithRequiredField +from .object_with_map_of_map import ObjectWithMapOfMap +from .object_with_optional_field import ObjectWithOptionalField +from .object_with_required_field import ObjectWithRequiredField +from .optional_alias import OptionalAlias + +__all__ = [ + "DoubleOptional", + "NestedObjectWithOptionalField", + "NestedObjectWithRequiredField", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithRequiredField", + "OptionalAlias", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/double_optional.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/double_optional.py new file mode 100644 index 00000000000..35b10659d34 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/double_optional.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from .optional_alias import OptionalAlias +from ....core.serialization import FieldMetadata +import pydantic + + +class DoubleOptional(UniversalBaseModel): + optional_alias: typing_extensions.Annotated[ + typing.Optional[OptionalAlias], FieldMetadata(alias="optionalAlias") + ] = None + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_optional_field.py new file mode 100644 index 00000000000..52522d1c370 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_optional_field.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from .object_with_optional_field import ObjectWithOptionalField +from ....core.serialization import FieldMetadata +import pydantic + + +class NestedObjectWithOptionalField(UniversalBaseModel): + string: typing.Optional[str] = None + nested_object: typing_extensions.Annotated[ + typing.Optional[ObjectWithOptionalField], FieldMetadata(alias="NestedObject") + ] = None + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_required_field.py new file mode 100644 index 00000000000..aa8dde2fc07 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/nested_object_with_required_field.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from .object_with_optional_field import ObjectWithOptionalField +from ....core.serialization import FieldMetadata +import typing +import pydantic + + +class NestedObjectWithRequiredField(UniversalBaseModel): + string: str + nested_object: typing_extensions.Annotated[ObjectWithOptionalField, FieldMetadata(alias="NestedObject")] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_map_of_map.py new file mode 100644 index 00000000000..8af294cf5fa --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_map_of_map.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing_extensions +import typing +from ....core.serialization import FieldMetadata +import pydantic + + +class ObjectWithMapOfMap(UniversalBaseModel): + map_: typing_extensions.Annotated[typing.Dict[str, typing.Dict[str, str]], FieldMetadata(alias="map")] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_optional_field.py new file mode 100644 index 00000000000..ef8b66a7040 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_optional_field.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic +import typing_extensions +from ....core.serialization import FieldMetadata +import datetime as dt +import uuid + + +class ObjectWithOptionalField(UniversalBaseModel): + string: typing.Optional[str] = pydantic.Field(default=None) + """ + This is a rather long descriptor of this single field in a more complex type. If you ask me I think this is a pretty good description for this field all things considered. + """ + + integer: typing.Optional[int] = None + long_: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="long")] = None + double: typing.Optional[float] = None + bool_: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="bool")] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid_: typing_extensions.Annotated[typing.Optional[uuid.UUID], FieldMetadata(alias="uuid")] = None + base_64: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="base64")] = None + list_: typing_extensions.Annotated[typing.Optional[typing.List[str]], FieldMetadata(alias="list")] = None + set_: typing_extensions.Annotated[typing.Optional[typing.Set[str]], FieldMetadata(alias="set")] = None + map_: typing_extensions.Annotated[typing.Optional[typing.Dict[int, str]], FieldMetadata(alias="map")] = None + bigint: typing.Optional[str] = None + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_required_field.py new file mode 100644 index 00000000000..debc61252d2 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/object_with_required_field.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic + + +class ObjectWithRequiredField(UniversalBaseModel): + string: str + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/optional_alias.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/optional_alias.py new file mode 100644 index 00000000000..dcb27974e08 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/object/types/optional_alias.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ....core.pydantic_utilities import UniversalBaseModel +import typing +import pydantic + + +class OptionalAlias(UniversalBaseModel): + root: typing.Optional[str] + + def get_as_str(self) -> typing.Optional[str]: + return self.__root__ + + @staticmethod + def from_str(value: typing.Optional[str]) -> OptionalAlias: + return OptionalAlias(__root__=value) + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/__init__.py new file mode 100644 index 00000000000..30187ae029e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import Animal, Animal_Cat, Animal_Dog, Cat, Dog +from .errors import ErrorWithUnionBody + +__all__ = ["Animal", "Animal_Cat", "Animal_Dog", "Cat", "Dog", "ErrorWithUnionBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/__init__.py new file mode 100644 index 00000000000..568a71fa3c4 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .error_with_union_body import ErrorWithUnionBody + +__all__ = ["ErrorWithUnionBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/error_with_union_body.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/error_with_union_body.py new file mode 100644 index 00000000000..3ead0383351 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/errors/error_with_union_body.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.animal import Animal + + +class ErrorWithUnionBody(ApiError): + def __init__(self, body: Animal): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/__init__.py new file mode 100644 index 00000000000..44ff66be5d9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/__init__.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +from .animal import Animal, Animal_Cat, Animal_Dog +from .cat import Cat +from .dog import Dog + +__all__ = ["Animal", "Animal_Cat", "Animal_Dog", "Cat", "Dog"] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/animal.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/animal.py new file mode 100644 index 00000000000..38fbcb28d56 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/animal.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +from ....core.pydantic_utilities import UniversalBaseModel +import typing +import typing_extensions +from ....core.serialization import FieldMetadata +import pydantic + + +class Animal_Dog(UniversalBaseModel): + animal: typing.Literal["dog"] = "dog" + name: str + likes_to_woof: typing_extensions.Annotated[bool, FieldMetadata(alias="likesToWoof")] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +class Animal_Cat(UniversalBaseModel): + animal: typing.Literal["cat"] = "cat" + name: str + likes_to_meow: typing_extensions.Annotated[bool, FieldMetadata(alias="likesToMeow")] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + + +Animal = typing.Union[Animal_Dog, Animal_Cat] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/cat.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/cat.py new file mode 100644 index 00000000000..be4bac8b5be --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/cat.py @@ -0,0 +1,14 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ....core.serialization import FieldMetadata +import typing +import pydantic + + +class Cat(UniversalBaseModel): + name: str + likes_to_meow: typing_extensions.Annotated[bool, FieldMetadata(alias="likesToMeow")] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/dog.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/dog.py new file mode 100644 index 00000000000..432acbaa09b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/types/union/types/dog.py @@ -0,0 +1,14 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.pydantic_utilities import UniversalBaseModel +import typing_extensions +from ....core.serialization import FieldMetadata +import typing +import pydantic + + +class Dog(UniversalBaseModel): + name: str + likes_to_woof: typing_extensions.Annotated[bool, FieldMetadata(alias="likesToWoof")] + + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/version.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/version.py new file mode 100644 index 00000000000..ac44536abdb --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/src/seed/version.py @@ -0,0 +1,3 @@ +from importlib import metadata + +__version__ = metadata.version("fern_exhaustive") diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/conftest.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/conftest.py new file mode 100644 index 00000000000..54c31d3dab5 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/conftest.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +import os +import pytest +from seed import AsyncSeedExhaustive + + +@pytest.fixture +def client() -> SeedExhaustive: + return SeedExhaustive(token=os.getenv("ENV_TOKEN", "token"), base_url=os.getenv("TESTS_BASE_URL", "base_url")) + + +@pytest.fixture +def async_client() -> AsyncSeedExhaustive: + return AsyncSeedExhaustive(token=os.getenv("ENV_TOKEN", "token"), base_url=os.getenv("TESTS_BASE_URL", "base_url")) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py new file mode 100644 index 00000000000..73f811f5ede --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py @@ -0,0 +1,7 @@ +import pytest + + +# Get started with writing tests with pytest at https://docs.pytest.org +@pytest.mark.skip(reason="Unimplemented") +def test_client() -> None: + assert True == True diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_container.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_container.py new file mode 100644 index 00000000000..bbd90d449bc --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_container.py @@ -0,0 +1,95 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from ..utilities import validate_response +from seed.types.object import ObjectWithRequiredField + + +async def test_get_and_return_list_of_primitives(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = ["string", "string"] + expected_types: typing.Tuple[typing.Any, typing.Any] = ("list", {0: None, 1: None}) + response = client.endpoints.container.get_and_return_list_of_primitives(request=["string", "string"]) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_list_of_primitives( + request=["string", "string"] + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_list_of_objects(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = [{"string": "string"}, {"string": "string"}] + expected_types: typing.Tuple[typing.Any, typing.Any] = ("list", {0: {"string": None}, 1: {"string": None}}) + response = client.endpoints.container.get_and_return_list_of_objects( + request=[ObjectWithRequiredField(string="string"), ObjectWithRequiredField(string="string")] + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_list_of_objects( + request=[ObjectWithRequiredField(string="string"), ObjectWithRequiredField(string="string")] + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_set_of_primitives(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = ["string"] + expected_types: typing.Tuple[typing.Any, typing.Any] = ("set", {0: None}) + response = client.endpoints.container.get_and_return_set_of_primitives(request={"string"}) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_set_of_primitives(request={"string"}) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_set_of_objects(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = [{"string": "string"}] + expected_types: typing.Tuple[typing.Any, typing.Any] = ("set", {0: {"string": None}}) + response = client.endpoints.container.get_and_return_set_of_objects( + request=[ObjectWithRequiredField(string="string")] + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_set_of_objects( + request=[ObjectWithRequiredField(string="string")] + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_map_prim_to_prim(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = {"string": "string"} + expected_types: typing.Tuple[typing.Any, typing.Any] = ("dict", {0: (None, None)}) + response = client.endpoints.container.get_and_return_map_prim_to_prim(request={"string": "string"}) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_map_prim_to_prim( + request={"string": "string"} + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_map_of_prim_to_object(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = {"string": {"string": "string"}} + expected_types: typing.Tuple[typing.Any, typing.Any] = ("dict", {0: (None, {"string": None})}) + response = client.endpoints.container.get_and_return_map_of_prim_to_object( + request={"string": ObjectWithRequiredField(string="string")} + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_map_of_prim_to_object( + request={"string": ObjectWithRequiredField(string="string")} + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_optional(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = {"string": "string"} + expected_types: typing.Any = {"string": None} + response = client.endpoints.container.get_and_return_optional(request=ObjectWithRequiredField(string="string")) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.container.get_and_return_optional( + request=ObjectWithRequiredField(string="string") + ) + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_enum.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_enum.py new file mode 100644 index 00000000000..9e65f445a59 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_enum.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from ..utilities import validate_response + + +async def test_get_and_return_enum(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "SUNNY" + expected_types: typing.Any = None + response = client.endpoints.enum.get_and_return_enum(request="SUNNY") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.enum.get_and_return_enum(request="SUNNY") + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_http_methods.py new file mode 100644 index 00000000000..537a9114284 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_http_methods.py @@ -0,0 +1,172 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from ..utilities import validate_response +import datetime +import uuid + + +async def test_test_get(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "string" + expected_types: typing.Any = None + response = client.endpoints.http_methods.test_get(id="id") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.http_methods.test_get(id="id") + validate_response(async_response, expected_response, expected_types) + + +async def test_test_post(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + } + expected_types: typing.Any = { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + } + response = client.endpoints.http_methods.test_post(string="string") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.http_methods.test_post(string="string") + validate_response(async_response, expected_response, expected_types) + + +async def test_test_put(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + } + expected_types: typing.Any = { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + } + response = client.endpoints.http_methods.test_put(id="id", string="string") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.http_methods.test_put(id="id", string="string") + validate_response(async_response, expected_response, expected_types) + + +async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + } + expected_types: typing.Any = { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + } + response = client.endpoints.http_methods.test_patch( + id="id", + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.http_methods.test_patch( + id="id", + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_test_delete(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = True + expected_types: typing.Any = None + response = client.endpoints.http_methods.test_delete(id="id") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.http_methods.test_delete(id="id") + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_object.py new file mode 100644 index 00000000000..91f189d3598 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_object.py @@ -0,0 +1,382 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +import datetime +import uuid +from ..utilities import validate_response +from seed.types.object import ObjectWithOptionalField +from seed.types.object import NestedObjectWithRequiredField + + +async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + } + expected_types: typing.Any = { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + } + response = client.endpoints.object.get_and_return_with_optional_field( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.object.get_and_return_with_optional_field( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_with_required_field(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = {"string": "string"} + expected_types: typing.Any = {"string": None} + response = client.endpoints.object.get_and_return_with_required_field(string="string") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.object.get_and_return_with_required_field(string="string") + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_with_map_of_map(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = {"map": {"map": {"map": "map"}}} + expected_types: typing.Any = {"map": ("dict", {0: (None, ("dict", {0: (None, None)}))})} + response = client.endpoints.object.get_and_return_with_map_of_map(map_={"map": {"map": "map"}}) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.object.get_and_return_with_map_of_map(map_={"map": {"map": "map"}}) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_nested_with_optional_field( + client: SeedExhaustive, async_client: AsyncSeedExhaustive +) -> None: + expected_response: typing.Any = { + "string": "string", + "NestedObject": { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + }, + } + expected_types: typing.Any = { + "string": None, + "NestedObject": { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + }, + } + response = client.endpoints.object.get_and_return_nested_with_optional_field( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.object.get_and_return_nested_with_optional_field( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_nested_with_required_field( + client: SeedExhaustive, async_client: AsyncSeedExhaustive +) -> None: + expected_response: typing.Any = { + "string": "string", + "NestedObject": { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + }, + } + expected_types: typing.Any = { + "string": None, + "NestedObject": { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + }, + } + response = client.endpoints.object.get_and_return_nested_with_required_field( + string_="string", + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.object.get_and_return_nested_with_required_field( + string_="string", + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_nested_with_required_field_as_list( + client: SeedExhaustive, async_client: AsyncSeedExhaustive +) -> None: + expected_response: typing.Any = { + "string": "string", + "NestedObject": { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + }, + } + expected_types: typing.Any = { + "string": None, + "NestedObject": { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + }, + } + response = client.endpoints.object.get_and_return_nested_with_required_field_as_list( + request=[ + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + ] + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.object.get_and_return_nested_with_required_field_as_list( + request=[ + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + NestedObjectWithRequiredField( + string="string", + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ), + ] + ) + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_params.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_params.py new file mode 100644 index 00000000000..de637feba72 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_params.py @@ -0,0 +1,65 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from ..utilities import validate_response + + +async def test_get_with_path(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "string" + expected_types: typing.Any = None + response = client.endpoints.params.get_with_path(param="param") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.params.get_with_path(param="param") + validate_response(async_response, expected_response, expected_types) + + +async def test_get_with_query(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + # Type ignore to avoid mypy complaining about the function not being meant to return a value + assert ( + client.endpoints.params.get_with_query(query="query", number=1) # type: ignore[func-returns-value] + is None + ) + + assert ( + await async_client.endpoints.params.get_with_query(query="query", number=1) # type: ignore[func-returns-value] + is None + ) + + +async def test_get_with_allow_multiple_query(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + # Type ignore to avoid mypy complaining about the function not being meant to return a value + assert ( + client.endpoints.params.get_with_allow_multiple_query(query="query", numer=1) # type: ignore[func-returns-value] + is None + ) + + assert ( + await async_client.endpoints.params.get_with_allow_multiple_query(query="query", numer=1) # type: ignore[func-returns-value] + is None + ) + + +async def test_get_with_path_and_query(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + # Type ignore to avoid mypy complaining about the function not being meant to return a value + assert ( + client.endpoints.params.get_with_path_and_query(param="param", query="query") # type: ignore[func-returns-value] + is None + ) + + assert ( + await async_client.endpoints.params.get_with_path_and_query(param="param", query="query") # type: ignore[func-returns-value] + is None + ) + + +async def test_modify_with_path(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "string" + expected_types: typing.Any = None + response = client.endpoints.params.modify_with_path(param="param", request="string") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.params.modify_with_path(param="param", request="string") + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_primitive.py new file mode 100644 index 00000000000..ad943784420 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_primitive.py @@ -0,0 +1,106 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from ..utilities import validate_response +import datetime +import uuid + + +async def test_get_and_return_string(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "string" + expected_types: typing.Any = None + response = client.endpoints.primitive.get_and_return_string(request="string") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_string(request="string") + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_int(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = 1 + expected_types: typing.Any = "integer" + response = client.endpoints.primitive.get_and_return_int(request=1) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_int(request=1) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_long(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = 1000000 + expected_types: typing.Any = None + response = client.endpoints.primitive.get_and_return_long(request=1000000) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_long(request=1000000) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_double(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = 1.1 + expected_types: typing.Any = None + response = client.endpoints.primitive.get_and_return_double(request=1.1) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_double(request=1.1) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_bool(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = True + expected_types: typing.Any = None + response = client.endpoints.primitive.get_and_return_bool(request=True) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_bool(request=True) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_datetime(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "2024-01-15T09:30:00Z" + expected_types: typing.Any = "datetime" + response = client.endpoints.primitive.get_and_return_datetime( + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_datetime( + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_date(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "2023-01-15" + expected_types: typing.Any = "date" + response = client.endpoints.primitive.get_and_return_date(request=datetime.date.fromisoformat("2023-01-15")) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_date( + request=datetime.date.fromisoformat("2023-01-15") + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_uuid(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32" + expected_types: typing.Any = "uuid" + response = client.endpoints.primitive.get_and_return_uuid(request=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_uuid( + request=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32") + ) + validate_response(async_response, expected_response, expected_types) + + +async def test_get_and_return_base_64(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "SGVsbG8gd29ybGQh" + expected_types: typing.Any = None + response = client.endpoints.primitive.get_and_return_base_64(request="SGVsbG8gd29ybGQh") + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.primitive.get_and_return_base_64(request="SGVsbG8gd29ybGQh") + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_union.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_union.py new file mode 100644 index 00000000000..47567726350 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/endpoints/test_union.py @@ -0,0 +1,19 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from seed.types.union import Animal_Dog +from ..utilities import validate_response + + +async def test_get_and_return_union(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = {"animal": "dog", "name": "name", "likesToWoof": True} + expected_types: typing.Any = "no_validate" + response = client.endpoints.union.get_and_return_union(request=Animal_Dog(name="name", likes_to_woof=True)) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.endpoints.union.get_and_return_union( + request=Animal_Dog(name="name", likes_to_woof=True) + ) + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_inlined_requests.py new file mode 100644 index 00000000000..9668eb1aac9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_inlined_requests.py @@ -0,0 +1,83 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from seed.types.object import ObjectWithOptionalField +import datetime +import uuid +from .utilities import validate_response + + +async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + } + expected_types: typing.Any = { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + } + response = client.inlined_requests.post_with_object_bodyand_response( + string="string", + integer=1, + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.inlined_requests.post_with_object_bodyand_response( + string="string", + integer=1, + nested_object=ObjectWithOptionalField( + string="string", + integer=1, + long_=1000000, + double=1.1, + bool_=True, + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + date=datetime.date.fromisoformat("2023-01-15"), + uuid_=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), + base_64="SGVsbG8gd29ybGQh", + list_=["list", "list"], + set_={"set"}, + map_={1: "map"}, + bigint=1000000, + ), + ) + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_auth.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_auth.py new file mode 100644 index 00000000000..667b7545590 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_auth.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from .utilities import validate_response + + +async def test_post_with_no_auth(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = True + expected_types: typing.Any = None + response = client.no_auth.post_with_no_auth(request={"key": "value"}) + validate_response(response, expected_response, expected_types) + + async_response = await async_client.no_auth.post_with_no_auth(request={"key": "value"}) + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_req_body.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_req_body.py new file mode 100644 index 00000000000..d0f467bb431 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_no_req_body.py @@ -0,0 +1,54 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive +import typing +from .utilities import validate_response + + +async def test_get_with_no_request_body(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = { + "string": "string", + "integer": 1, + "long": 1000000, + "double": 1.1, + "bool": True, + "datetime": "2024-01-15T09:30:00Z", + "date": "2023-01-15", + "uuid": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + "base64": "SGVsbG8gd29ybGQh", + "list": ["list", "list"], + "set": ["set"], + "map": {"1": "map"}, + "bigint": "1000000", + } + expected_types: typing.Any = { + "string": None, + "integer": "integer", + "long": None, + "double": None, + "bool": None, + "datetime": "datetime", + "date": "date", + "uuid": "uuid", + "base64": None, + "list": ("list", {0: None, 1: None}), + "set": ("set", {0: None}), + "map": ("dict", {0: ("integer", None)}), + "bigint": None, + } + response = client.no_req_body.get_with_no_request_body() + validate_response(response, expected_response, expected_types) + + async_response = await async_client.no_req_body.get_with_no_request_body() + validate_response(async_response, expected_response, expected_types) + + +async def test_post_with_no_request_body(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + expected_response: typing.Any = "string" + expected_types: typing.Any = None + response = client.no_req_body.post_with_no_request_body() + validate_response(response, expected_response, expected_types) + + async_response = await async_client.no_req_body.post_with_no_request_body() + validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_req_with_headers.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_req_with_headers.py new file mode 100644 index 00000000000..4105ce39190 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_req_with_headers.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed import SeedExhaustive +from seed import AsyncSeedExhaustive + + +async def test_get_with_custom_header(client: SeedExhaustive, async_client: AsyncSeedExhaustive) -> None: + # Type ignore to avoid mypy complaining about the function not being meant to return a value + assert ( + client.req_with_headers.get_with_custom_header( + x_test_service_header="X-TEST-SERVICE-HEADER", + x_test_endpoint_header="X-TEST-ENDPOINT-HEADER", + request="string", + ) # type: ignore[func-returns-value] + is None + ) + + assert ( + await async_client.req_with_headers.get_with_custom_header( + x_test_service_header="X-TEST-SERVICE-HEADER", + x_test_endpoint_header="X-TEST-ENDPOINT-HEADER", + request="string", + ) # type: ignore[func-returns-value] + is None + ) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utilities.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utilities.py new file mode 100644 index 00000000000..3d228806a9c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utilities.py @@ -0,0 +1,162 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import uuid + +from dateutil import parser + +import pydantic + + +def cast_field(json_expectation: typing.Any, type_expectation: typing.Any) -> typing.Any: + # Cast these specific types which come through as string and expect our + # models to cast to the correct type. + if type_expectation == "uuid": + return uuid.UUID(json_expectation) + elif type_expectation == "date": + return parser.parse(json_expectation).date() + elif type_expectation == "datetime": + return parser.parse(json_expectation) + elif type_expectation == "set": + return set(json_expectation) + elif type_expectation == "integer": + # Necessary as we allow numeric keys, but JSON makes them strings + return int(json_expectation) + + return json_expectation + + +def validate_field(response: typing.Any, json_expectation: typing.Any, type_expectation: typing.Any) -> None: + # Allow for an escape hatch if the object cannot be validated + if type_expectation == "no_validate": + return + + is_container_of_complex_type = False + # Parse types in containers, note that dicts are handled within `validate_response` + if isinstance(json_expectation, list): + if isinstance(type_expectation, tuple): + container_expectation = type_expectation[0] + contents_expectation = type_expectation[1] + + cast_json_expectation = [] + for idx, ex in enumerate(json_expectation): + if isinstance(contents_expectation, dict): + entry_expectation = contents_expectation.get(idx) + if isinstance(entry_expectation, dict): + is_container_of_complex_type = True + validate_response( + response=response[idx], + json_expectation=ex, + type_expectations=entry_expectation, + ) + else: + cast_json_expectation.append(cast_field(ex, entry_expectation)) + else: + cast_json_expectation.append(ex) + json_expectation = cast_json_expectation + + # Note that we explicitly do not allow for sets of pydantic models as they are not hashable, so + # if any of the values of the set have a type_expectation of a dict, we're assuming it's a pydantic + # model and keeping it a list. + if container_expectation != "set" or not any( + map( + lambda value: isinstance(value, dict), + list(contents_expectation.values()), + ) + ): + json_expectation = cast_field(json_expectation, container_expectation) + elif isinstance(type_expectation, tuple): + container_expectation = type_expectation[0] + contents_expectation = type_expectation[1] + if isinstance(contents_expectation, dict): + json_expectation = { + cast_field( + key, + contents_expectation.get(idx)[0] # type: ignore + if contents_expectation.get(idx) is not None + else None, + ): cast_field( + value, + contents_expectation.get(idx)[1] # type: ignore + if contents_expectation.get(idx) is not None + else None, + ) + for idx, (key, value) in enumerate(json_expectation.items()) + } + else: + json_expectation = cast_field(json_expectation, container_expectation) + elif type_expectation is not None: + json_expectation = cast_field(json_expectation, type_expectation) + + # When dealing with containers of models, etc. we're validating them implicitly, so no need to check the resultant list + if not is_container_of_complex_type: + assert ( + json_expectation == response + ), "Primitives found, expected: {0} (type: {1}), Actual: {2} (type: {3})".format( + json_expectation, type(json_expectation), response, type(response) + ) + + +# Arg type_expectations is a deeply nested structure that matches the response, but with the values replaced with the expected types +def validate_response(response: typing.Any, json_expectation: typing.Any, type_expectations: typing.Any) -> None: + # Allow for an escape hatch if the object cannot be validated + if type_expectations == "no_validate": + return + + if ( + not isinstance(response, list) + and not isinstance(response, dict) + and not issubclass(type(response), pydantic.BaseModel) + ): + validate_field( + response=response, + json_expectation=json_expectation, + type_expectation=type_expectations, + ) + return + + if isinstance(response, list): + assert len(response) == len(json_expectation), "Length mismatch, expected: {0}, Actual: {1}".format( + len(response), len(json_expectation) + ) + content_expectation = type_expectations + if isinstance(type_expectations, tuple): + content_expectation = type_expectations[1] + for idx, item in enumerate(response): + validate_response( + response=item, + json_expectation=json_expectation[idx], + type_expectations=content_expectation[idx], + ) + else: + response_json = response + if issubclass(type(response), pydantic.BaseModel): + response_json = response.dict(by_alias=True) + + for key, value in json_expectation.items(): + assert key in response_json, "Field {0} not found within the response object: {1}".format( + key, response_json + ) + + type_expectation = None + if type_expectations is not None and isinstance(type_expectations, dict): + type_expectation = type_expectations.get(key) + + # If your type_expectation is a tuple then you have a container field, process it as such + # Otherwise, we're just validating a single field that's a pydantic model. + if isinstance(value, dict) and not isinstance(type_expectation, tuple): + validate_response( + response=response_json[key], + json_expectation=value, + type_expectations=type_expectation, + ) + else: + validate_field( + response=response_json[key], + json_expectation=value, + type_expectation=type_expectation, + ) + + # Ensure there are no additional fields here either + del response_json[key] + assert len(response_json) == 0, "Additional fields found, expected None: {0}".format(response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/__init__.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/__init__.py new file mode 100644 index 00000000000..3a1c852e71e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/__init__.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from .circle import CircleParams +from .object_with_defaults import ObjectWithDefaultsParams +from .object_with_optional_field import ObjectWithOptionalFieldParams +from .shape import ShapeParams, Shape_CircleParams, Shape_SquareParams +from .square import SquareParams +from .undiscriminated_shape import UndiscriminatedShapeParams + +__all__ = [ + "CircleParams", + "ObjectWithDefaultsParams", + "ObjectWithOptionalFieldParams", + "ShapeParams", + "Shape_CircleParams", + "Shape_SquareParams", + "SquareParams", + "UndiscriminatedShapeParams", +] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/circle.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/circle.py new file mode 100644 index 00000000000..6522dc58c5a --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/circle.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions +from seed.core.serialization import FieldMetadata + + +class CircleParams(typing_extensions.TypedDict): + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/color.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/color.py new file mode 100644 index 00000000000..2aa2c4c52f0 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/color.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing + +Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_defaults.py new file mode 100644 index 00000000000..ef14f7b2c9d --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_defaults.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions + + +class ObjectWithDefaultsParams(typing_extensions.TypedDict): + """ + Defines properties with default values and validation rules. + """ + + decimal: typing_extensions.NotRequired[float] + string: typing_extensions.NotRequired[str] + required_string: str diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_optional_field.py new file mode 100644 index 00000000000..fc5a379b967 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/object_with_optional_field.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing +import typing_extensions +from seed.core.serialization import FieldMetadata +import datetime as dt +import uuid +from .color import Color +from .shape import ShapeParams +from .undiscriminated_shape import UndiscriminatedShapeParams + + +class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): + literal: typing.Literal["lit_one"] + string: typing_extensions.NotRequired[str] + integer: typing_extensions.NotRequired[int] + long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] + double: typing_extensions.NotRequired[float] + bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] + datetime: typing_extensions.NotRequired[dt.datetime] + date: typing_extensions.NotRequired[dt.date] + uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] + base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] + list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] + set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] + map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] + enum: typing_extensions.NotRequired[Color] + union: typing_extensions.NotRequired[ShapeParams] + second_union: typing_extensions.NotRequired[ShapeParams] + undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] + any: typing.Optional[typing.Any] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/shape.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/shape.py new file mode 100644 index 00000000000..ae113ae0609 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/shape.py @@ -0,0 +1,26 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations +import typing_extensions +import typing_extensions +import typing +from seed.core.serialization import FieldMetadata + + +class Base(typing_extensions.TypedDict): + id: str + + +class Shape_CircleParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] + radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] + + +class Shape_SquareParams(Base): + shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] + + +ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/square.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/square.py new file mode 100644 index 00000000000..7f6f79a3ddc --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/square.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing_extensions +import typing_extensions +from seed.core.serialization import FieldMetadata + + +class SquareParams(typing_extensions.TypedDict): + length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/undiscriminated_shape.py new file mode 100644 index 00000000000..68876a23c38 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/assets/models/undiscriminated_shape.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +# This file was auto-generated by Fern from our API Definition. + +import typing +from .circle import CircleParams +from .square import SquareParams + +UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_http_client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_http_client.py new file mode 100644 index 00000000000..a541bae6531 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_http_client.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from seed.core.http_client import get_request_body +from seed.core.request_options import RequestOptions + + +def get_request_options() -> RequestOptions: + return {"additional_body_parameters": {"see you": "later"}} + + +def test_get_json_request_body() -> None: + json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) + assert json_body == {"hello": "world"} + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"goodbye": "world", "see you": "later"} + assert data_body_extras is None + + +def test_get_files_request_body() -> None: + json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) + assert data_body == {"hello": "world"} + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None + ) + + assert data_body_extras == {"goodbye": "world", "see you": "later"} + assert json_body_extras is None + + +def test_get_none_request_body() -> None: + json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) + assert data_body is None + assert json_body is None + + json_body_extras, data_body_extras = get_request_body( + json=None, data=None, request_options=get_request_options(), omit=None + ) + + assert json_body_extras == {"see you": "later"} + assert data_body_extras is None + + +def test_get_empty_json_request_body() -> None: + unrelated_request_options: RequestOptions = {"max_retries": 3} + json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) + assert json_body is None + assert data_body is None + + json_body_extras, data_body_extras = get_request_body( + json={}, data=None, request_options=unrelated_request_options, omit=None + ) + + assert json_body_extras is None + assert data_body_extras is None diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_query_encoding.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_query_encoding.py new file mode 100644 index 00000000000..e075394a502 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_query_encoding.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + + +from seed.core.query_encoder import encode_query + + +def test_query_encoding_deep_objects() -> None: + assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] + assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] + assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ + ("hello_world[hello][world]", "today"), + ("hello_world[test]", "this"), + ("hi", "there"), + ] + + +def test_query_encoding_deep_object_arrays() -> None: + assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ + ("objects[key]", "hello"), + ("objects[value]", "world"), + ("objects[key]", "foo"), + ("objects[value]", "bar"), + ] + assert encode_query( + {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} + ) == [ + ("users[name]", "string"), + ("users[tags]", "string"), + ("users[name]", "string2"), + ("users[tags]", "string2"), + ("users[tags]", "string3"), + ] + + +def test_encode_query_with_none() -> None: + encoded = encode_query(None) + assert encoded == None diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_serialization.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_serialization.py new file mode 100644 index 00000000000..dd74836366c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/utils/test_serialization.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import List, Any + +from seed.core.serialization import convert_and_respect_annotation_metadata +from .assets.models import ShapeParams, ObjectWithOptionalFieldParams + + +UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} +UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} + + +def test_convert_and_respect_annotation_metadata() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "bool_": True, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} + + +def test_convert_and_respect_annotation_metadata_in_list() -> None: + data: List[ObjectWithOptionalFieldParams] = [ + {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, + ] + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" + ) + + assert converted == [ + {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, + {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, + ] + + +def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: + data: ObjectWithOptionalFieldParams = { + "string": "string", + "long_": 12345, + "union": UNION_TEST, + "literal": "lit_one", + "any": "any", + } + converted = convert_and_respect_annotation_metadata( + object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" + ) + + assert converted == { + "string": "string", + "long": 12345, + "union": UNION_TEST_CONVERTED, + "literal": "lit_one", + "any": "any", + } + + +def test_convert_and_respect_annotation_metadata_in_union() -> None: + converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") + + assert converted == UNION_TEST_CONVERTED + + +def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: + data: Any = {} + converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") + assert converted == data diff --git a/seed/python-sdk/seed.yml b/seed/python-sdk/seed.yml index bc917ac1789..7bb9b8ad14f 100644 --- a/seed/python-sdk/seed.yml +++ b/seed/python-sdk/seed.yml @@ -115,6 +115,11 @@ fixtures: version: v1 wrapped_aliases: True outputFolder: pydantic-v1-wrapped + - customConfig: + pydantic_config: + version: v2 + wrapped_aliases: True + outputFolder: pydantic-v2-wrapped - customConfig: pydantic_config: version: v1