From 9ddf4832c18f927c2a88b153cc0856dc2f5b9808 Mon Sep 17 00:00:00 2001 From: Armando Belardo <11140328+armandobelardo@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:42:08 -0400 Subject: [PATCH] fix(python): run tests in python 3.8 and fix mypy errors (#4670) --- .github/workflows/python-generator.yml | 8 +- docker/seed/Dockerfile.python | 2 +- .../shared/pydantic_utilities.py | 12 +- generators/python/sdk/Dockerfile | 3 +- generators/python/sdk/versions.yml | 8 ++ .../src/fern_python/snippet/snippet_writer.py | 2 +- .../tests/ir/fixtures/fern/fern.config.json | 2 +- .../example_models/fern/fern.config.json | 2 +- .../types/core/pydantic_utilities.py | 50 ++++++++- .../types/object_with_optional_field.py | 36 ++---- .../typeddict_models/fern/fern.config.json | 2 +- .../types/core/pydantic_utilities.py | 50 ++++++++- .../types/resources/types/circle.py | 8 +- .../types/object_with_optional_field.py | 36 ++---- .../types/resources/types/shape.py | 21 ++-- .../types/resources/types/square.py | 8 +- .../unaliased_models/fern/fern.config.json | 2 +- .../types/core/pydantic_utilities.py | 50 ++++++++- .../utils/union_utils/fern/fern.config.json | 2 +- .../types/core/pydantic_utilities.py | 46 +++++++- pnpm-lock.yaml | 2 +- .../alias-extends/core/pydantic_utilities.py | 8 +- seed/fastapi/alias/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../audiences/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../basic-auth/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../code-samples/core/pydantic_utilities.py | 11 +- .../core/pydantic_utilities.py | 8 +- .../custom-auth/core/pydantic_utilities.py | 8 +- .../error-property/core/pydantic_utilities.py | 8 +- .../examples/core/pydantic_utilities.py | 8 +- .../examples/resources/types/types/moment.py | 2 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../pydantic-v1/core/pydantic_utilities.py | 8 +- .../pydantic-v2/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../extends/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../folders/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../proto/google/api/field_behavior.proto | 104 ++++++++++++++++++ .../grpc-proto/core/pydantic_utilities.py | 8 +- seed/fastapi/grpc/core/pydantic_utilities.py | 11 +- .../core/pydantic_utilities.py | 8 +- .../async-handlers/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../mixed-case/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../no-environment/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../fastapi/object/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../optional/core/pydantic_utilities.py | 8 +- .../package-yml/core/pydantic_utilities.py | 8 +- .../pagination/core/pydantic_utilities.py | 8 +- .../plain-text/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../simple-fhir/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- seed/fastapi/trace/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../fastapi/unions/core/pydantic_utilities.py | 8 +- .../unknown/core/pydantic_utilities.py | 8 +- .../validation/core/pydantic_utilities.py | 8 +- .../variables/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../version/core/pydantic_utilities.py | 8 +- .../websocket/core/pydantic_utilities.py | 8 +- .../alias_extends/core/pydantic_utilities.py | 8 +- .../src/seed/alias/core/pydantic_utilities.py | 8 +- .../seed/any_auth/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../seed/audiences/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../basic_auth/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../src/seed/bytes/core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 8 +- .../code_samples/core/pydantic_utilities.py | 11 +- .../core/pydantic_utilities.py | 8 +- .../custom_auth/core/pydantic_utilities.py | 8 +- .../src/seed/enum/core/pydantic_utilities.py | 8 +- .../error_property/core/pydantic_utilities.py | 8 +- .../seed/examples/core/pydantic_utilities.py | 8 +- .../seed/examples/resources/types/moment.py | 2 +- .../exhaustive/core/pydantic_utilities.py | 8 +- .../exhaustive/core/pydantic_utilities.py | 8 +- .../seed/extends/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../file_download/core/pydantic_utilities.py | 8 +- .../file_upload/core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 8 +- .../proto/google/api/field_behavior.proto | 104 ++++++++++++++++++ .../src/seed/api/core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 11 +- .../core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 8 +- .../seed/literal/core/pydantic_utilities.py | 8 +- .../mixed_case/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../no_environment/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../seed/object/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../package_yml/core/pydantic_utilities.py | 8 +- .../pagination/core/pydantic_utilities.py | 8 +- .../plain_text/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../nursery_api/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../src/seed/api/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../seed/streaming/core/pydantic_utilities.py | 8 +- .../seed/streaming/core/pydantic_utilities.py | 8 +- .../src/seed/trace/core/pydantic_utilities.py | 8 +- .../core/pydantic_utilities.py | 8 +- .../seed/unions/core/pydantic_utilities.py | 8 +- .../unknown_as_any/core/pydantic_utilities.py | 8 +- .../validation/core/pydantic_utilities.py | 8 +- .../seed/variables/core/pydantic_utilities.py | 8 +- .../seed/version/core/pydantic_utilities.py | 8 +- .../seed/version/core/pydantic_utilities.py | 8 +- .../seed/websocket/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../alias/src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../bytes/src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../resolved-snippet-templates.md | 22 ++++ .../code-samples/src/seed/core/__init__.py | 3 +- .../code-samples/src/seed/core/file.py | 41 +++++-- .../src/seed/core/pydantic_utilities.py | 11 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../examples/client-filename/snippet.json | 2 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/types/types/moment.py | 2 +- .../examples/no-custom-config/snippet.json | 2 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/types/types/moment.py | 2 +- seed/python-sdk/examples/readme/snippet.json | 2 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../readme/src/seed/types/types/moment.py | 2 +- .../aliases_with_validation/reference.md | 14 +-- .../aliases_with_validation/snippet.json | 28 ++--- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../aliases_without_validation/reference.md | 14 +-- .../aliases_without_validation/snippet.json | 28 ++--- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../deps_with_min_python_version/reference.md | 14 +-- .../deps_with_min_python_version/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../extra_dependencies/reference.md | 14 +-- .../extra_dependencies/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../extra_dev_dependencies/reference.md | 14 +-- .../extra_dev_dependencies/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../five-second-timeout/reference.md | 14 +-- .../five-second-timeout/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../follow_redirects_by_default/reference.md | 14 +-- .../follow_redirects_by_default/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../exhaustive/improved_imports/reference.md | 14 +-- .../exhaustive/improved_imports/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../exhaustive/infinite-timeout/reference.md | 14 +-- .../exhaustive/infinite-timeout/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../inline_request_params/reference.md | 14 +-- .../inline_request_params/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../exhaustive/no-custom-config/reference.md | 14 +-- .../exhaustive/no-custom-config/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../pydantic-extra-fields/reference.md | 14 +-- .../pydantic-extra-fields/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../pydantic-v1-wrapped/reference.md | 14 +-- .../pydantic-v1-wrapped/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../exhaustive/pydantic-v1/reference.md | 14 +-- .../exhaustive/pydantic-v1/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../exhaustive/pyproject_extras/reference.md | 14 +-- .../exhaustive/pyproject_extras/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../skip-pydantic-validation/reference.md | 14 +-- .../skip-pydantic-validation/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../exhaustive/union-utils/reference.md | 14 +-- .../exhaustive/union-utils/snippet.json | 28 ++--- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/endpoints/http_methods/client.py | 4 +- .../src/seed/endpoints/object/client.py | 16 +-- .../src/seed/endpoints/primitive/client.py | 4 +- .../src/seed/inlined_requests/client.py | 4 +- .../tests/endpoints/test_http_methods.py | 8 +- .../tests/endpoints/test_object.py | 32 ++---- .../tests/endpoints/test_primitive.py | 8 +- .../tests/test_inlined_requests.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../proto/google/api/field_behavior.proto | 104 ++++++++++++++++++ .../src/seed/core/pydantic_utilities.py | 8 +- .../grpc/resolved-snippet-templates.md | 27 +++++ .../python-sdk/grpc/src/seed/core/__init__.py | 3 +- seed/python-sdk/grpc/src/seed/core/file.py | 41 +++++-- .../grpc/src/seed/core/pydantic_utilities.py | 11 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../imdb/src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- seed/python-sdk/object/snippet.json | 2 +- .../src/seed/core/pydantic_utilities.py | 8 +- seed/python-sdk/object/src/seed/types/type.py | 2 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- seed/python-sdk/query-parameters/README.md | 8 +- seed/python-sdk/query-parameters/reference.md | 4 +- seed/python-sdk/query-parameters/snippet.json | 4 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../query-parameters/src/seed/user/client.py | 8 +- .../query-parameters/tests/test_user.py | 16 +-- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- seed/python-sdk/seed.yml | 12 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- seed/python-sdk/trace/reference.md | 8 +- seed/python-sdk/trace/snippet.json | 12 +- .../python-sdk/trace/src/seed/admin/client.py | 8 +- .../trace/src/seed/core/pydantic_utilities.py | 8 +- .../trace/src/seed/playlist/client.py | 8 +- seed/python-sdk/trace/tests/test_admin.py | 16 +-- seed/python-sdk/trace/tests/test_playlist.py | 16 +-- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- .../src/seed/core/pydantic_utilities.py | 8 +- 431 files changed, 2407 insertions(+), 2366 deletions(-) create mode 100644 seed/fastapi/grpc-proto/.mock/proto/google/api/field_behavior.proto create mode 100644 seed/pydantic/grpc-proto/.mock/proto/google/api/field_behavior.proto create mode 100644 seed/python-sdk/code-samples/resolved-snippet-templates.md create mode 100644 seed/python-sdk/grpc-proto/.mock/proto/google/api/field_behavior.proto create mode 100644 seed/python-sdk/grpc/resolved-snippet-templates.md diff --git a/.github/workflows/python-generator.yml b/.github/workflows/python-generator.yml index 7eab73b9d3e..106f8c50392 100644 --- a/.github/workflows/python-generator.yml +++ b/.github/workflows/python-generator.yml @@ -48,16 +48,16 @@ jobs: docker build -f ./pydantic/Dockerfile -t ferntest/fern-pydantic-model:0.0.0 . cd tests/utils/example_models - fern generate --group dummy_types --local + fern generate --group dummy_types --local || true cd ../typeddict_models - fern generate --group dummy_td_types --local + fern generate --group dummy_td_types --local || true cd ../union_utils - fern generate --group dummy_union_types --local + fern generate --group dummy_union_types --local || true cd ../unaliased_models - fern generate --group dummy_unaliased_types --local + fern generate --group dummy_unaliased_types --local || true - name: Install Dependencies - Pydantic V1 working-directory: ./generators/python diff --git a/docker/seed/Dockerfile.python b/docker/seed/Dockerfile.python index 690847e342d..84b0d3faadf 100644 --- a/docker/seed/Dockerfile.python +++ b/docker/seed/Dockerfile.python @@ -1,4 +1,4 @@ -FROM mwalbeck/python-poetry:1.7-3.11 +FROM mwalbeck/python-poetry:1.7-3.8 RUN apt update && apt upgrade -y RUN apt install nodejs npm -y diff --git a/generators/python/core_utilities/shared/pydantic_utilities.py b/generators/python/core_utilities/shared/pydantic_utilities.py index 50f99ea32a4..6c5be70f2c5 100644 --- a/generators/python/core_utilities/shared/pydantic_utilities.py +++ b/generators/python/core_utilities/shared/pydantic_utilities.py @@ -95,15 +95,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 @@ -238,9 +238,7 @@ def decorator(func: AnyCallable) -> AnyCallable: 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 + 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 diff --git a/generators/python/sdk/Dockerfile b/generators/python/sdk/Dockerfile index c34b7b885a8..f7bc715747d 100644 --- a/generators/python/sdk/Dockerfile +++ b/generators/python/sdk/Dockerfile @@ -1,10 +1,11 @@ FROM python:3.9.14 # Install node and npm. -ENV NODE_VERSION=18.20.0 +ENV NODE_VERSION=18.20.1 RUN apt install -y curl RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ENV NVM_DIR=/root/.nvm +RUN . "$NVM_DIR/nvm.sh" && nvm ls-remote RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} diff --git a/generators/python/sdk/versions.yml b/generators/python/sdk/versions.yml index 8ac617cf4af..d3b775d86c9 100644 --- a/generators/python/sdk/versions.yml +++ b/generators/python/sdk/versions.yml @@ -1,4 +1,12 @@ # For unreleased changes, use unreleased.yml +- version: 4.2.4 + irVersion: 53 + changelogEntry: + - type: fix + summary: | + Datetime examples are generated correctly once again. + The `pydantic_utilites` file is python 3.8 compatible. + - version: 4.2.3 irVersion: 53 changelogEntry: diff --git a/generators/python/src/fern_python/snippet/snippet_writer.py b/generators/python/src/fern_python/snippet/snippet_writer.py index f986b8dab55..11cf05cc568 100644 --- a/generators/python/src/fern_python/snippet/snippet_writer.py +++ b/generators/python/src/fern_python/snippet/snippet_writer.py @@ -170,7 +170,7 @@ def _get_snippet_for_primitive( "fromisoformat", ), ), - args=[AST.Expression(f'"{str(datetime)}"')], + args=[AST.Expression(f'"{str(datetime.datetime)}"')], ), ), date=lambda date: AST.Expression( diff --git a/generators/python/tests/ir/fixtures/fern/fern.config.json b/generators/python/tests/ir/fixtures/fern/fern.config.json index ad0ebdd7ed5..884cf847336 100644 --- a/generators/python/tests/ir/fixtures/fern/fern.config.json +++ b/generators/python/tests/ir/fixtures/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "examples", - "version": "0.37.4" + "version": "0.41.16" } \ No newline at end of file diff --git a/generators/python/tests/utils/example_models/fern/fern.config.json b/generators/python/tests/utils/example_models/fern/fern.config.json index b196a63aee5..965764ab254 100644 --- a/generators/python/tests/utils/example_models/fern/fern.config.json +++ b/generators/python/tests/utils/example_models/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "fern", - "version": "0.40.4" + "version": "0.41.16" } \ No newline at end of file diff --git a/generators/python/tests/utils/example_models/types/core/pydantic_utilities.py b/generators/python/tests/utils/example_models/types/core/pydantic_utilities.py index a445878af5b..e498bc763ab 100644 --- a/generators/python/tests/utils/example_models/types/core/pydantic_utilities.py +++ b/generators/python/tests/utils/example_models/types/core/pydantic_utilities.py @@ -81,15 +81,52 @@ def to_jsonable_with_fallback( 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=(), - json_encoders={dt.datetime: serialize_datetime}, ) # 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, @@ -113,19 +150,22 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: # 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, - **kwargs, + "exclude_none": False, } kwargs_with_defaults_exclude_none: typing.Any = { + **kwargs, "by_alias": True, "exclude_none": True, - **kwargs, + "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__ @@ -193,11 +233,11 @@ def encode_by_type(o: typing.Any) -> typing.Any: return encoder(o) -def update_forward_refs(model: typing.Type["Model"]) -> None: +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() + model.update_forward_refs(**localns) # Mirrors Pydantic's internal typing diff --git a/generators/python/tests/utils/example_models/types/resources/types/object_with_optional_field.py b/generators/python/tests/utils/example_models/types/resources/types/object_with_optional_field.py index 77c47d0c2e3..6c825671518 100644 --- a/generators/python/tests/utils/example_models/types/resources/types/object_with_optional_field.py +++ b/generators/python/tests/utils/example_models/types/resources/types/object_with_optional_field.py @@ -2,45 +2,33 @@ from ...core.unchecked_base_model import UncheckedBaseModel import typing -import typing_extensions -from ...core.serialization import FieldMetadata +import pydantic import datetime as dt import uuid from .color import Color from .shape import Shape from .undiscriminated_shape import UndiscriminatedShape from ...core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class ObjectWithOptionalField(UncheckedBaseModel): literal: typing.Literal["lit_one"] = "lit_one" string: typing.Optional[str] = None integer: typing.Optional[int] = None - long_: typing_extensions.Annotated[ - typing.Optional[int], FieldMetadata(alias="long") - ] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool_: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="bool") - ] = None + bool_: typing.Optional[bool] = pydantic.Field(alias="bool", default=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 + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="uuid", default=None) + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list_: typing.Optional[typing.List[str]] = pydantic.Field( + alias="list", default=None + ) + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set", default=None) + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field( + alias="map", default=None + ) enum: typing.Optional[Color] = None union: typing.Optional[Shape] = None second_union: typing.Optional[Shape] = None diff --git a/generators/python/tests/utils/typeddict_models/fern/fern.config.json b/generators/python/tests/utils/typeddict_models/fern/fern.config.json index b196a63aee5..965764ab254 100644 --- a/generators/python/tests/utils/typeddict_models/fern/fern.config.json +++ b/generators/python/tests/utils/typeddict_models/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "fern", - "version": "0.40.4" + "version": "0.41.16" } \ No newline at end of file diff --git a/generators/python/tests/utils/typeddict_models/types/core/pydantic_utilities.py b/generators/python/tests/utils/typeddict_models/types/core/pydantic_utilities.py index a445878af5b..e498bc763ab 100644 --- a/generators/python/tests/utils/typeddict_models/types/core/pydantic_utilities.py +++ b/generators/python/tests/utils/typeddict_models/types/core/pydantic_utilities.py @@ -81,15 +81,52 @@ def to_jsonable_with_fallback( 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=(), - json_encoders={dt.datetime: serialize_datetime}, ) # 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, @@ -113,19 +150,22 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: # 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, - **kwargs, + "exclude_none": False, } kwargs_with_defaults_exclude_none: typing.Any = { + **kwargs, "by_alias": True, "exclude_none": True, - **kwargs, + "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__ @@ -193,11 +233,11 @@ def encode_by_type(o: typing.Any) -> typing.Any: return encoder(o) -def update_forward_refs(model: typing.Type["Model"]) -> None: +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() + model.update_forward_refs(**localns) # Mirrors Pydantic's internal typing diff --git a/generators/python/tests/utils/typeddict_models/types/resources/types/circle.py b/generators/python/tests/utils/typeddict_models/types/resources/types/circle.py index 79c971fa360..cc0db0e4827 100644 --- a/generators/python/tests/utils/typeddict_models/types/resources/types/circle.py +++ b/generators/python/tests/utils/typeddict_models/types/resources/types/circle.py @@ -1,17 +1,13 @@ # This file was auto-generated by Fern from our API Definition. from ...core.unchecked_base_model import UncheckedBaseModel -import typing_extensions -from ...core.serialization import FieldMetadata +import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2 import typing -import pydantic class Circle(UncheckedBaseModel): - radius_measurement: typing_extensions.Annotated[ - float, FieldMetadata(alias="radiusMeasurement") - ] + radius_measurement: float = pydantic.Field(alias="radiusMeasurement") if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/generators/python/tests/utils/typeddict_models/types/resources/types/object_with_optional_field.py b/generators/python/tests/utils/typeddict_models/types/resources/types/object_with_optional_field.py index 77c47d0c2e3..6c825671518 100644 --- a/generators/python/tests/utils/typeddict_models/types/resources/types/object_with_optional_field.py +++ b/generators/python/tests/utils/typeddict_models/types/resources/types/object_with_optional_field.py @@ -2,45 +2,33 @@ from ...core.unchecked_base_model import UncheckedBaseModel import typing -import typing_extensions -from ...core.serialization import FieldMetadata +import pydantic import datetime as dt import uuid from .color import Color from .shape import Shape from .undiscriminated_shape import UndiscriminatedShape from ...core.pydantic_utilities import IS_PYDANTIC_V2 -import pydantic class ObjectWithOptionalField(UncheckedBaseModel): literal: typing.Literal["lit_one"] = "lit_one" string: typing.Optional[str] = None integer: typing.Optional[int] = None - long_: typing_extensions.Annotated[ - typing.Optional[int], FieldMetadata(alias="long") - ] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool_: typing_extensions.Annotated[ - typing.Optional[bool], FieldMetadata(alias="bool") - ] = None + bool_: typing.Optional[bool] = pydantic.Field(alias="bool", default=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 + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="uuid", default=None) + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list_: typing.Optional[typing.List[str]] = pydantic.Field( + alias="list", default=None + ) + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set", default=None) + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field( + alias="map", default=None + ) enum: typing.Optional[Color] = None union: typing.Optional[Shape] = None second_union: typing.Optional[Shape] = None diff --git a/generators/python/tests/utils/typeddict_models/types/resources/types/shape.py b/generators/python/tests/utils/typeddict_models/types/resources/types/shape.py index 99b0fb70b7d..9515f0a930a 100644 --- a/generators/python/tests/utils/typeddict_models/types/resources/types/shape.py +++ b/generators/python/tests/utils/typeddict_models/types/resources/types/shape.py @@ -6,7 +6,6 @@ import typing import pydantic import typing_extensions -from ...core.serialization import FieldMetadata from ...core.unchecked_base_model import UnionMetadata @@ -24,12 +23,10 @@ class Config: class Shape_Circle(Base): - shape_type: typing_extensions.Annotated[ - typing.Literal["circle"], FieldMetadata(alias="shapeType") - ] = "circle" - radius_measurement: typing_extensions.Annotated[ - float, FieldMetadata(alias="radiusMeasurement") - ] + shape_type: typing.Literal["circle"] = pydantic.Field( + alias="shapeType", default="circle" + ) + radius_measurement: float = pydantic.Field(alias="radiusMeasurement") if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( @@ -42,12 +39,10 @@ class Config: class Shape_Square(Base): - shape_type: typing_extensions.Annotated[ - typing.Literal["square"], FieldMetadata(alias="shapeType") - ] = "square" - length_measurement: typing_extensions.Annotated[ - float, FieldMetadata(alias="lengthMeasurement") - ] + shape_type: typing.Literal["square"] = pydantic.Field( + alias="shapeType", default="square" + ) + length_measurement: float = pydantic.Field(alias="lengthMeasurement") if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/generators/python/tests/utils/typeddict_models/types/resources/types/square.py b/generators/python/tests/utils/typeddict_models/types/resources/types/square.py index b20b84061ed..c6bd65544fd 100644 --- a/generators/python/tests/utils/typeddict_models/types/resources/types/square.py +++ b/generators/python/tests/utils/typeddict_models/types/resources/types/square.py @@ -1,17 +1,13 @@ # This file was auto-generated by Fern from our API Definition. from ...core.unchecked_base_model import UncheckedBaseModel -import typing_extensions -from ...core.serialization import FieldMetadata +import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2 import typing -import pydantic class Square(UncheckedBaseModel): - length_measurement: typing_extensions.Annotated[ - float, FieldMetadata(alias="lengthMeasurement") - ] + length_measurement: float = pydantic.Field(alias="lengthMeasurement") if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( diff --git a/generators/python/tests/utils/unaliased_models/fern/fern.config.json b/generators/python/tests/utils/unaliased_models/fern/fern.config.json index b196a63aee5..965764ab254 100644 --- a/generators/python/tests/utils/unaliased_models/fern/fern.config.json +++ b/generators/python/tests/utils/unaliased_models/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "fern", - "version": "0.40.4" + "version": "0.41.16" } \ No newline at end of file diff --git a/generators/python/tests/utils/unaliased_models/types/core/pydantic_utilities.py b/generators/python/tests/utils/unaliased_models/types/core/pydantic_utilities.py index a445878af5b..e498bc763ab 100644 --- a/generators/python/tests/utils/unaliased_models/types/core/pydantic_utilities.py +++ b/generators/python/tests/utils/unaliased_models/types/core/pydantic_utilities.py @@ -81,15 +81,52 @@ def to_jsonable_with_fallback( 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=(), - json_encoders={dt.datetime: serialize_datetime}, ) # 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, @@ -113,19 +150,22 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: # 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, - **kwargs, + "exclude_none": False, } kwargs_with_defaults_exclude_none: typing.Any = { + **kwargs, "by_alias": True, "exclude_none": True, - **kwargs, + "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__ @@ -193,11 +233,11 @@ def encode_by_type(o: typing.Any) -> typing.Any: return encoder(o) -def update_forward_refs(model: typing.Type["Model"]) -> None: +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() + model.update_forward_refs(**localns) # Mirrors Pydantic's internal typing diff --git a/generators/python/tests/utils/union_utils/fern/fern.config.json b/generators/python/tests/utils/union_utils/fern/fern.config.json index b196a63aee5..965764ab254 100644 --- a/generators/python/tests/utils/union_utils/fern/fern.config.json +++ b/generators/python/tests/utils/union_utils/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "fern", - "version": "0.40.4" + "version": "0.41.16" } \ No newline at end of file diff --git a/generators/python/tests/utils/union_utils/types/core/pydantic_utilities.py b/generators/python/tests/utils/union_utils/types/core/pydantic_utilities.py index 1248e039417..e498bc763ab 100644 --- a/generators/python/tests/utils/union_utils/types/core/pydantic_utilities.py +++ b/generators/python/tests/utils/union_utils/types/core/pydantic_utilities.py @@ -81,15 +81,52 @@ def to_jsonable_with_fallback( 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=(), - json_encoders={dt.datetime: serialize_datetime}, ) # 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, @@ -129,9 +166,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2 ) - print("dict_dump", dict_dump) - print("kwargs_with_defaults_exclude_unset", super().model_dump(**kwargs_with_defaults_exclude_unset)) - print("kwargs_with_defaults_exclude_none", super().model_dump(**kwargs_with_defaults_exclude_none)) else: _fields_set = self.__fields_set__ @@ -199,11 +233,11 @@ def encode_by_type(o: typing.Any) -> typing.Any: return encoder(o) -def update_forward_refs(model: typing.Type["Model"]) -> None: +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() + model.update_forward_refs(**localns) # Mirrors Pydantic's internal typing diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0812d0789b..699b8c3e891 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3322,7 +3322,7 @@ importers: specifier: ^2.0.5 version: 2.0.5(@types/node@18.7.18)(jsdom@20.0.3)(sass@1.72.0)(terser@5.31.5) - packages/cli/cli/dist/prod: {} + packages/cli/cli/dist/dev: {} packages/cli/configuration: dependencies: diff --git a/seed/fastapi/alias-extends/core/pydantic_utilities.py b/seed/fastapi/alias-extends/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/alias-extends/core/pydantic_utilities.py +++ b/seed/fastapi/alias-extends/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/alias/core/pydantic_utilities.py b/seed/fastapi/alias/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/alias/core/pydantic_utilities.py +++ b/seed/fastapi/alias/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/api-wide-base-path/core/pydantic_utilities.py b/seed/fastapi/api-wide-base-path/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/api-wide-base-path/core/pydantic_utilities.py +++ b/seed/fastapi/api-wide-base-path/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/audiences/core/pydantic_utilities.py b/seed/fastapi/audiences/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/audiences/core/pydantic_utilities.py +++ b/seed/fastapi/audiences/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/basic-auth-environment-variables/core/pydantic_utilities.py b/seed/fastapi/basic-auth-environment-variables/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/basic-auth-environment-variables/core/pydantic_utilities.py +++ b/seed/fastapi/basic-auth-environment-variables/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/basic-auth/core/pydantic_utilities.py b/seed/fastapi/basic-auth/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/basic-auth/core/pydantic_utilities.py +++ b/seed/fastapi/basic-auth/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/bearer-token-environment-variable/core/pydantic_utilities.py b/seed/fastapi/bearer-token-environment-variable/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/bearer-token-environment-variable/core/pydantic_utilities.py +++ b/seed/fastapi/bearer-token-environment-variable/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/circular-references-advanced/core/pydantic_utilities.py b/seed/fastapi/circular-references-advanced/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/circular-references-advanced/core/pydantic_utilities.py +++ b/seed/fastapi/circular-references-advanced/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/circular-references/core/pydantic_utilities.py b/seed/fastapi/circular-references/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/circular-references/core/pydantic_utilities.py +++ b/seed/fastapi/circular-references/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/code-samples/core/pydantic_utilities.py b/seed/fastapi/code-samples/core/pydantic_utilities.py index 291565a1595..e498bc763ab 100644 --- a/seed/fastapi/code-samples/core/pydantic_utilities.py +++ b/seed/fastapi/code-samples/core/pydantic_utilities.py @@ -85,7 +85,7 @@ class UniversalBaseModel(pydantic.BaseModel): protected_namespaces=(), ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="wrap") # 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 @@ -100,13 +100,14 @@ def serialize_model( class Config: smart_union = True + json_encoders = {dt.datetime: serialize_datetime} @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -114,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/cross-package-type-names/core/pydantic_utilities.py b/seed/fastapi/cross-package-type-names/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/cross-package-type-names/core/pydantic_utilities.py +++ b/seed/fastapi/cross-package-type-names/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/custom-auth/core/pydantic_utilities.py b/seed/fastapi/custom-auth/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/custom-auth/core/pydantic_utilities.py +++ b/seed/fastapi/custom-auth/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/error-property/core/pydantic_utilities.py b/seed/fastapi/error-property/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/error-property/core/pydantic_utilities.py +++ b/seed/fastapi/error-property/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/examples/core/pydantic_utilities.py b/seed/fastapi/examples/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/examples/core/pydantic_utilities.py +++ b/seed/fastapi/examples/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/examples/resources/types/types/moment.py b/seed/fastapi/examples/resources/types/types/moment.py index 6d1fe170402..f8d2aa482cb 100644 --- a/seed/fastapi/examples/resources/types/types/moment.py +++ b/seed/fastapi/examples/resources/types/types/moment.py @@ -25,7 +25,7 @@ class Moment(UniversalBaseModel): "1994-01-01", ), datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'", + "1994-01-01 01:01:01+00:00", ), ) """ diff --git a/seed/fastapi/exhaustive/include-validators/core/pydantic_utilities.py b/seed/fastapi/exhaustive/include-validators/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/exhaustive/include-validators/core/pydantic_utilities.py +++ b/seed/fastapi/exhaustive/include-validators/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/exhaustive/no-custom-config/core/pydantic_utilities.py b/seed/fastapi/exhaustive/no-custom-config/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/exhaustive/no-custom-config/core/pydantic_utilities.py +++ b/seed/fastapi/exhaustive/no-custom-config/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/exhaustive/pydantic-v1/core/pydantic_utilities.py b/seed/fastapi/exhaustive/pydantic-v1/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/exhaustive/pydantic-v1/core/pydantic_utilities.py +++ b/seed/fastapi/exhaustive/pydantic-v1/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/exhaustive/pydantic-v2/core/pydantic_utilities.py b/seed/fastapi/exhaustive/pydantic-v2/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/exhaustive/pydantic-v2/core/pydantic_utilities.py +++ b/seed/fastapi/exhaustive/pydantic-v2/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/exhaustive/skip-formatting/core/pydantic_utilities.py b/seed/fastapi/exhaustive/skip-formatting/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/exhaustive/skip-formatting/core/pydantic_utilities.py +++ b/seed/fastapi/exhaustive/skip-formatting/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/extends/core/pydantic_utilities.py b/seed/fastapi/extends/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/extends/core/pydantic_utilities.py +++ b/seed/fastapi/extends/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/extra-properties/core/pydantic_utilities.py b/seed/fastapi/extra-properties/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/extra-properties/core/pydantic_utilities.py +++ b/seed/fastapi/extra-properties/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/folders/core/pydantic_utilities.py b/seed/fastapi/folders/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/folders/core/pydantic_utilities.py +++ b/seed/fastapi/folders/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/grpc-proto-exhaustive/core/pydantic_utilities.py b/seed/fastapi/grpc-proto-exhaustive/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/grpc-proto-exhaustive/core/pydantic_utilities.py +++ b/seed/fastapi/grpc-proto-exhaustive/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/grpc-proto/.mock/proto/google/api/field_behavior.proto b/seed/fastapi/grpc-proto/.mock/proto/google/api/field_behavior.proto new file mode 100644 index 00000000000..128799c558d --- /dev/null +++ b/seed/fastapi/grpc-proto/.mock/proto/google/api/field_behavior.proto @@ -0,0 +1,104 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; + + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; + + // Denotes that this field returns a non-empty default value if not set. + // This indicates that if the user provides the empty value in a request, + // a non-empty value will be returned. The user will not be aware of what + // non-empty value to expect. + NON_EMPTY_DEFAULT = 7; + + // Denotes that the field in a resource (a message annotated with + // google.api.resource) is used in the resource name to uniquely identify the + // resource. For AIP-compliant APIs, this should only be applied to the + // `name` field on the resource. + // + // This behavior should not be applied to references to other resources within + // the message. + // + // The identifier field of resources often have different field behavior + // depending on the request it is embedded in (e.g. for Create methods name + // is optional and unused, while for Update methods it is required). Instead + // of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8; +} \ No newline at end of file diff --git a/seed/fastapi/grpc-proto/core/pydantic_utilities.py b/seed/fastapi/grpc-proto/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/grpc-proto/core/pydantic_utilities.py +++ b/seed/fastapi/grpc-proto/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/grpc/core/pydantic_utilities.py b/seed/fastapi/grpc/core/pydantic_utilities.py index 291565a1595..e498bc763ab 100644 --- a/seed/fastapi/grpc/core/pydantic_utilities.py +++ b/seed/fastapi/grpc/core/pydantic_utilities.py @@ -85,7 +85,7 @@ class UniversalBaseModel(pydantic.BaseModel): protected_namespaces=(), ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="wrap") # 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 @@ -100,13 +100,14 @@ def serialize_model( class Config: smart_union = True + json_encoders = {dt.datetime: serialize_datetime} @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -114,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/idempotency-headers/core/pydantic_utilities.py b/seed/fastapi/idempotency-headers/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/idempotency-headers/core/pydantic_utilities.py +++ b/seed/fastapi/idempotency-headers/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/imdb/async-handlers/core/pydantic_utilities.py b/seed/fastapi/imdb/async-handlers/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/imdb/async-handlers/core/pydantic_utilities.py +++ b/seed/fastapi/imdb/async-handlers/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/imdb/includes-extra-fields/core/pydantic_utilities.py b/seed/fastapi/imdb/includes-extra-fields/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/imdb/includes-extra-fields/core/pydantic_utilities.py +++ b/seed/fastapi/imdb/includes-extra-fields/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/imdb/no-custom-config/core/pydantic_utilities.py b/seed/fastapi/imdb/no-custom-config/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/imdb/no-custom-config/core/pydantic_utilities.py +++ b/seed/fastapi/imdb/no-custom-config/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/mixed-case/core/pydantic_utilities.py b/seed/fastapi/mixed-case/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/mixed-case/core/pydantic_utilities.py +++ b/seed/fastapi/mixed-case/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/mixed-file-directory/core/pydantic_utilities.py b/seed/fastapi/mixed-file-directory/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/mixed-file-directory/core/pydantic_utilities.py +++ b/seed/fastapi/mixed-file-directory/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/multi-line-docs/core/pydantic_utilities.py b/seed/fastapi/multi-line-docs/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/multi-line-docs/core/pydantic_utilities.py +++ b/seed/fastapi/multi-line-docs/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/multi-url-environment-no-default/core/pydantic_utilities.py b/seed/fastapi/multi-url-environment-no-default/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/multi-url-environment-no-default/core/pydantic_utilities.py +++ b/seed/fastapi/multi-url-environment-no-default/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/multi-url-environment/core/pydantic_utilities.py b/seed/fastapi/multi-url-environment/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/multi-url-environment/core/pydantic_utilities.py +++ b/seed/fastapi/multi-url-environment/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/no-environment/core/pydantic_utilities.py b/seed/fastapi/no-environment/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/no-environment/core/pydantic_utilities.py +++ b/seed/fastapi/no-environment/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/oauth-client-credentials-default/core/pydantic_utilities.py b/seed/fastapi/oauth-client-credentials-default/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/oauth-client-credentials-default/core/pydantic_utilities.py +++ b/seed/fastapi/oauth-client-credentials-default/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/oauth-client-credentials-environment-variables/core/pydantic_utilities.py b/seed/fastapi/oauth-client-credentials-environment-variables/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/oauth-client-credentials-environment-variables/core/pydantic_utilities.py +++ b/seed/fastapi/oauth-client-credentials-environment-variables/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/oauth-client-credentials-nested-root/core/pydantic_utilities.py b/seed/fastapi/oauth-client-credentials-nested-root/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/oauth-client-credentials-nested-root/core/pydantic_utilities.py +++ b/seed/fastapi/oauth-client-credentials-nested-root/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/oauth-client-credentials/core/pydantic_utilities.py b/seed/fastapi/oauth-client-credentials/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/oauth-client-credentials/core/pydantic_utilities.py +++ b/seed/fastapi/oauth-client-credentials/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/object/core/pydantic_utilities.py b/seed/fastapi/object/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/object/core/pydantic_utilities.py +++ b/seed/fastapi/object/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/objects-with-imports/core/pydantic_utilities.py b/seed/fastapi/objects-with-imports/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/objects-with-imports/core/pydantic_utilities.py +++ b/seed/fastapi/objects-with-imports/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/optional/core/pydantic_utilities.py b/seed/fastapi/optional/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/optional/core/pydantic_utilities.py +++ b/seed/fastapi/optional/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/package-yml/core/pydantic_utilities.py b/seed/fastapi/package-yml/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/package-yml/core/pydantic_utilities.py +++ b/seed/fastapi/package-yml/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/pagination/core/pydantic_utilities.py b/seed/fastapi/pagination/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/pagination/core/pydantic_utilities.py +++ b/seed/fastapi/pagination/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/plain-text/core/pydantic_utilities.py b/seed/fastapi/plain-text/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/plain-text/core/pydantic_utilities.py +++ b/seed/fastapi/plain-text/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/reserved-keywords/core/pydantic_utilities.py b/seed/fastapi/reserved-keywords/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/reserved-keywords/core/pydantic_utilities.py +++ b/seed/fastapi/reserved-keywords/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/simple-fhir/core/pydantic_utilities.py b/seed/fastapi/simple-fhir/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/simple-fhir/core/pydantic_utilities.py +++ b/seed/fastapi/simple-fhir/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/single-url-environment-default/core/pydantic_utilities.py b/seed/fastapi/single-url-environment-default/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/single-url-environment-default/core/pydantic_utilities.py +++ b/seed/fastapi/single-url-environment-default/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/single-url-environment-no-default/core/pydantic_utilities.py b/seed/fastapi/single-url-environment-no-default/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/single-url-environment-no-default/core/pydantic_utilities.py +++ b/seed/fastapi/single-url-environment-no-default/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/trace/core/pydantic_utilities.py b/seed/fastapi/trace/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/trace/core/pydantic_utilities.py +++ b/seed/fastapi/trace/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/undiscriminated-unions/core/pydantic_utilities.py b/seed/fastapi/undiscriminated-unions/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/undiscriminated-unions/core/pydantic_utilities.py +++ b/seed/fastapi/undiscriminated-unions/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/unions/core/pydantic_utilities.py b/seed/fastapi/unions/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/unions/core/pydantic_utilities.py +++ b/seed/fastapi/unions/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/unknown/core/pydantic_utilities.py b/seed/fastapi/unknown/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/unknown/core/pydantic_utilities.py +++ b/seed/fastapi/unknown/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/validation/core/pydantic_utilities.py b/seed/fastapi/validation/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/validation/core/pydantic_utilities.py +++ b/seed/fastapi/validation/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/variables/core/pydantic_utilities.py b/seed/fastapi/variables/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/variables/core/pydantic_utilities.py +++ b/seed/fastapi/variables/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/version-no-default/core/pydantic_utilities.py b/seed/fastapi/version-no-default/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/version-no-default/core/pydantic_utilities.py +++ b/seed/fastapi/version-no-default/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/version/core/pydantic_utilities.py b/seed/fastapi/version/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/version/core/pydantic_utilities.py +++ b/seed/fastapi/version/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/fastapi/websocket/core/pydantic_utilities.py b/seed/fastapi/websocket/core/pydantic_utilities.py index daa0f15a9f7..e498bc763ab 100644 --- a/seed/fastapi/websocket/core/pydantic_utilities.py +++ b/seed/fastapi/websocket/core/pydantic_utilities.py @@ -104,10 +104,10 @@ class Config: @classmethod def model_construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) @@ -115,10 +115,10 @@ def model_construct( @classmethod def construct( - cls: type[Model], + cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any, - ) -> Model: + ) -> "Model": dealiased_object = convert_and_respect_annotation_metadata( object_=values, annotation=cls, direction="read" ) diff --git a/seed/pydantic/alias-extends/src/seed/alias_extends/core/pydantic_utilities.py b/seed/pydantic/alias-extends/src/seed/alias_extends/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/alias-extends/src/seed/alias_extends/core/pydantic_utilities.py +++ b/seed/pydantic/alias-extends/src/seed/alias_extends/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/alias/src/seed/alias/core/pydantic_utilities.py b/seed/pydantic/alias/src/seed/alias/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/alias/src/seed/alias/core/pydantic_utilities.py +++ b/seed/pydantic/alias/src/seed/alias/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/any-auth/src/seed/any_auth/core/pydantic_utilities.py b/seed/pydantic/any-auth/src/seed/any_auth/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/any-auth/src/seed/any_auth/core/pydantic_utilities.py +++ b/seed/pydantic/any-auth/src/seed/any_auth/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/api-wide-base-path/src/seed/api_wide_base_path/core/pydantic_utilities.py b/seed/pydantic/api-wide-base-path/src/seed/api_wide_base_path/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/api-wide-base-path/src/seed/api_wide_base_path/core/pydantic_utilities.py +++ b/seed/pydantic/api-wide-base-path/src/seed/api_wide_base_path/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/audiences/src/seed/audiences/core/pydantic_utilities.py b/seed/pydantic/audiences/src/seed/audiences/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/audiences/src/seed/audiences/core/pydantic_utilities.py +++ b/seed/pydantic/audiences/src/seed/audiences/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/auth-environment-variables/src/seed/auth_environment_variables/core/pydantic_utilities.py b/seed/pydantic/auth-environment-variables/src/seed/auth_environment_variables/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/auth-environment-variables/src/seed/auth_environment_variables/core/pydantic_utilities.py +++ b/seed/pydantic/auth-environment-variables/src/seed/auth_environment_variables/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/basic-auth-environment-variables/src/seed/basic_auth_environment_variables/core/pydantic_utilities.py b/seed/pydantic/basic-auth-environment-variables/src/seed/basic_auth_environment_variables/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/basic-auth-environment-variables/src/seed/basic_auth_environment_variables/core/pydantic_utilities.py +++ b/seed/pydantic/basic-auth-environment-variables/src/seed/basic_auth_environment_variables/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/basic-auth/src/seed/basic_auth/core/pydantic_utilities.py b/seed/pydantic/basic-auth/src/seed/basic_auth/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/basic-auth/src/seed/basic_auth/core/pydantic_utilities.py +++ b/seed/pydantic/basic-auth/src/seed/basic_auth/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/bearer-token-environment-variable/src/seed/bearer_token_environment_variable/core/pydantic_utilities.py b/seed/pydantic/bearer-token-environment-variable/src/seed/bearer_token_environment_variable/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/bearer-token-environment-variable/src/seed/bearer_token_environment_variable/core/pydantic_utilities.py +++ b/seed/pydantic/bearer-token-environment-variable/src/seed/bearer_token_environment_variable/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/bytes/src/seed/bytes/core/pydantic_utilities.py b/seed/pydantic/bytes/src/seed/bytes/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/bytes/src/seed/bytes/core/pydantic_utilities.py +++ b/seed/pydantic/bytes/src/seed/bytes/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/circular-references-advanced/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/circular-references-advanced/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/circular-references-advanced/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/circular-references-advanced/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/circular-references/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/circular-references/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/circular-references/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/circular-references/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/code-samples/src/seed/code_samples/core/pydantic_utilities.py b/seed/pydantic/code-samples/src/seed/code_samples/core/pydantic_utilities.py index 58a7a0fcddf..c14b4828025 100644 --- a/seed/pydantic/code-samples/src/seed/code_samples/core/pydantic_utilities.py +++ b/seed/pydantic/code-samples/src/seed/code_samples/core/pydantic_utilities.py @@ -83,7 +83,7 @@ class UniversalBaseModel(pydantic.BaseModel): protected_namespaces=(), ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="wrap") # 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()} @@ -93,18 +93,19 @@ def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> ty class Config: smart_union = True + json_encoders = {dt.datetime: serialize_datetime} @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/cross-package-type-names/src/seed/cross_package_type_names/core/pydantic_utilities.py b/seed/pydantic/cross-package-type-names/src/seed/cross_package_type_names/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/cross-package-type-names/src/seed/cross_package_type_names/core/pydantic_utilities.py +++ b/seed/pydantic/cross-package-type-names/src/seed/cross_package_type_names/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/custom-auth/src/seed/custom_auth/core/pydantic_utilities.py b/seed/pydantic/custom-auth/src/seed/custom_auth/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/custom-auth/src/seed/custom_auth/core/pydantic_utilities.py +++ b/seed/pydantic/custom-auth/src/seed/custom_auth/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/enum/src/seed/enum/core/pydantic_utilities.py b/seed/pydantic/enum/src/seed/enum/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/enum/src/seed/enum/core/pydantic_utilities.py +++ b/seed/pydantic/enum/src/seed/enum/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/error-property/src/seed/error_property/core/pydantic_utilities.py b/seed/pydantic/error-property/src/seed/error_property/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/error-property/src/seed/error_property/core/pydantic_utilities.py +++ b/seed/pydantic/error-property/src/seed/error_property/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/examples/src/seed/examples/core/pydantic_utilities.py b/seed/pydantic/examples/src/seed/examples/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/examples/src/seed/examples/core/pydantic_utilities.py +++ b/seed/pydantic/examples/src/seed/examples/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/moment.py b/seed/pydantic/examples/src/seed/examples/resources/types/moment.py index 5d74c1d8beb..dd15ad4e7e8 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/moment.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/moment.py @@ -25,7 +25,7 @@ class Moment(UniversalBaseModel): "1994-01-01", ), datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'", + "1994-01-01 01:01:01+00:00", ), ) """ diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/core/pydantic_utilities.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/core/pydantic_utilities.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/core/pydantic_utilities.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/core/pydantic_utilities.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/extends/src/seed/extends/core/pydantic_utilities.py b/seed/pydantic/extends/src/seed/extends/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/extends/src/seed/extends/core/pydantic_utilities.py +++ b/seed/pydantic/extends/src/seed/extends/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/extra-properties/src/seed/extra_properties/core/pydantic_utilities.py b/seed/pydantic/extra-properties/src/seed/extra_properties/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/extra-properties/src/seed/extra_properties/core/pydantic_utilities.py +++ b/seed/pydantic/extra-properties/src/seed/extra_properties/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/file-download/src/seed/file_download/core/pydantic_utilities.py b/seed/pydantic/file-download/src/seed/file_download/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/file-download/src/seed/file_download/core/pydantic_utilities.py +++ b/seed/pydantic/file-download/src/seed/file_download/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/file-upload/src/seed/file_upload/core/pydantic_utilities.py b/seed/pydantic/file-upload/src/seed/file_upload/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/file-upload/src/seed/file_upload/core/pydantic_utilities.py +++ b/seed/pydantic/file-upload/src/seed/file_upload/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/folders/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/folders/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/folders/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/folders/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/grpc-proto-exhaustive/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/grpc-proto-exhaustive/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/grpc-proto-exhaustive/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/grpc-proto-exhaustive/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/grpc-proto/.mock/proto/google/api/field_behavior.proto b/seed/pydantic/grpc-proto/.mock/proto/google/api/field_behavior.proto new file mode 100644 index 00000000000..128799c558d --- /dev/null +++ b/seed/pydantic/grpc-proto/.mock/proto/google/api/field_behavior.proto @@ -0,0 +1,104 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; + + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; + + // Denotes that this field returns a non-empty default value if not set. + // This indicates that if the user provides the empty value in a request, + // a non-empty value will be returned. The user will not be aware of what + // non-empty value to expect. + NON_EMPTY_DEFAULT = 7; + + // Denotes that the field in a resource (a message annotated with + // google.api.resource) is used in the resource name to uniquely identify the + // resource. For AIP-compliant APIs, this should only be applied to the + // `name` field on the resource. + // + // This behavior should not be applied to references to other resources within + // the message. + // + // The identifier field of resources often have different field behavior + // depending on the request it is embedded in (e.g. for Create methods name + // is optional and unused, while for Update methods it is required). Instead + // of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8; +} \ No newline at end of file diff --git a/seed/pydantic/grpc-proto/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/grpc-proto/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/grpc-proto/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/grpc-proto/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/grpc/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/grpc/src/seed/api/core/pydantic_utilities.py index 58a7a0fcddf..c14b4828025 100644 --- a/seed/pydantic/grpc/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/grpc/src/seed/api/core/pydantic_utilities.py @@ -83,7 +83,7 @@ class UniversalBaseModel(pydantic.BaseModel): protected_namespaces=(), ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="wrap") # 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()} @@ -93,18 +93,19 @@ def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> ty class Config: smart_union = True + json_encoders = {dt.datetime: serialize_datetime} @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/idempotency-headers/src/seed/idempotency_headers/core/pydantic_utilities.py b/seed/pydantic/idempotency-headers/src/seed/idempotency_headers/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/idempotency-headers/src/seed/idempotency_headers/core/pydantic_utilities.py +++ b/seed/pydantic/idempotency-headers/src/seed/idempotency_headers/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/imdb/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/imdb/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/imdb/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/imdb/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/literal/src/seed/literal/core/pydantic_utilities.py b/seed/pydantic/literal/src/seed/literal/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/literal/src/seed/literal/core/pydantic_utilities.py +++ b/seed/pydantic/literal/src/seed/literal/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/mixed-case/src/seed/mixed_case/core/pydantic_utilities.py b/seed/pydantic/mixed-case/src/seed/mixed_case/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/mixed-case/src/seed/mixed_case/core/pydantic_utilities.py +++ b/seed/pydantic/mixed-case/src/seed/mixed_case/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/mixed-file-directory/src/seed/mixed_file_directory/core/pydantic_utilities.py b/seed/pydantic/mixed-file-directory/src/seed/mixed_file_directory/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/mixed-file-directory/src/seed/mixed_file_directory/core/pydantic_utilities.py +++ b/seed/pydantic/mixed-file-directory/src/seed/mixed_file_directory/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/multi-line-docs/src/seed/multi_line_docs/core/pydantic_utilities.py b/seed/pydantic/multi-line-docs/src/seed/multi_line_docs/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/multi-line-docs/src/seed/multi_line_docs/core/pydantic_utilities.py +++ b/seed/pydantic/multi-line-docs/src/seed/multi_line_docs/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/multi-url-environment-no-default/src/seed/multi_url_environment_no_default/core/pydantic_utilities.py b/seed/pydantic/multi-url-environment-no-default/src/seed/multi_url_environment_no_default/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/multi-url-environment-no-default/src/seed/multi_url_environment_no_default/core/pydantic_utilities.py +++ b/seed/pydantic/multi-url-environment-no-default/src/seed/multi_url_environment_no_default/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/multi-url-environment/src/seed/multi_url_environment/core/pydantic_utilities.py b/seed/pydantic/multi-url-environment/src/seed/multi_url_environment/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/multi-url-environment/src/seed/multi_url_environment/core/pydantic_utilities.py +++ b/seed/pydantic/multi-url-environment/src/seed/multi_url_environment/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/no-environment/src/seed/no_environment/core/pydantic_utilities.py b/seed/pydantic/no-environment/src/seed/no_environment/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/no-environment/src/seed/no_environment/core/pydantic_utilities.py +++ b/seed/pydantic/no-environment/src/seed/no_environment/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/oauth-client-credentials-default/src/seed/oauth_client_credentials_default/core/pydantic_utilities.py b/seed/pydantic/oauth-client-credentials-default/src/seed/oauth_client_credentials_default/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/oauth-client-credentials-default/src/seed/oauth_client_credentials_default/core/pydantic_utilities.py +++ b/seed/pydantic/oauth-client-credentials-default/src/seed/oauth_client_credentials_default/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/oauth-client-credentials-environment-variables/src/seed/oauth_client_credentials_environment_variables/core/pydantic_utilities.py b/seed/pydantic/oauth-client-credentials-environment-variables/src/seed/oauth_client_credentials_environment_variables/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/oauth-client-credentials-environment-variables/src/seed/oauth_client_credentials_environment_variables/core/pydantic_utilities.py +++ b/seed/pydantic/oauth-client-credentials-environment-variables/src/seed/oauth_client_credentials_environment_variables/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/oauth-client-credentials-nested-root/src/seed/oauth_client_credentials/core/pydantic_utilities.py b/seed/pydantic/oauth-client-credentials-nested-root/src/seed/oauth_client_credentials/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/oauth-client-credentials-nested-root/src/seed/oauth_client_credentials/core/pydantic_utilities.py +++ b/seed/pydantic/oauth-client-credentials-nested-root/src/seed/oauth_client_credentials/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/oauth-client-credentials/src/seed/oauth_client_credentials/core/pydantic_utilities.py b/seed/pydantic/oauth-client-credentials/src/seed/oauth_client_credentials/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/oauth-client-credentials/src/seed/oauth_client_credentials/core/pydantic_utilities.py +++ b/seed/pydantic/oauth-client-credentials/src/seed/oauth_client_credentials/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/object/src/seed/object/core/pydantic_utilities.py b/seed/pydantic/object/src/seed/object/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/object/src/seed/object/core/pydantic_utilities.py +++ b/seed/pydantic/object/src/seed/object/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/core/pydantic_utilities.py b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/core/pydantic_utilities.py +++ b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/optional/src/seed/objects_with_imports/core/pydantic_utilities.py b/seed/pydantic/optional/src/seed/objects_with_imports/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/optional/src/seed/objects_with_imports/core/pydantic_utilities.py +++ b/seed/pydantic/optional/src/seed/objects_with_imports/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/package-yml/src/seed/package_yml/core/pydantic_utilities.py b/seed/pydantic/package-yml/src/seed/package_yml/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/package-yml/src/seed/package_yml/core/pydantic_utilities.py +++ b/seed/pydantic/package-yml/src/seed/package_yml/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/pagination/src/seed/pagination/core/pydantic_utilities.py b/seed/pydantic/pagination/src/seed/pagination/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/pagination/src/seed/pagination/core/pydantic_utilities.py +++ b/seed/pydantic/pagination/src/seed/pagination/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/plain-text/src/seed/plain_text/core/pydantic_utilities.py b/seed/pydantic/plain-text/src/seed/plain_text/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/plain-text/src/seed/plain_text/core/pydantic_utilities.py +++ b/seed/pydantic/plain-text/src/seed/plain_text/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/query-parameters/src/seed/query_parameters/core/pydantic_utilities.py b/seed/pydantic/query-parameters/src/seed/query_parameters/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/query-parameters/src/seed/query_parameters/core/pydantic_utilities.py +++ b/seed/pydantic/query-parameters/src/seed/query_parameters/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/reserved-keywords/src/seed/nursery_api/core/pydantic_utilities.py b/seed/pydantic/reserved-keywords/src/seed/nursery_api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/reserved-keywords/src/seed/nursery_api/core/pydantic_utilities.py +++ b/seed/pydantic/reserved-keywords/src/seed/nursery_api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/response-property/src/seed/response_property/core/pydantic_utilities.py b/seed/pydantic/response-property/src/seed/response_property/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/response-property/src/seed/response_property/core/pydantic_utilities.py +++ b/seed/pydantic/response-property/src/seed/response_property/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/simple-fhir/src/seed/api/core/pydantic_utilities.py b/seed/pydantic/simple-fhir/src/seed/api/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/simple-fhir/src/seed/api/core/pydantic_utilities.py +++ b/seed/pydantic/simple-fhir/src/seed/api/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/single-url-environment-default/src/seed/single_url_environment_default/core/pydantic_utilities.py b/seed/pydantic/single-url-environment-default/src/seed/single_url_environment_default/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/single-url-environment-default/src/seed/single_url_environment_default/core/pydantic_utilities.py +++ b/seed/pydantic/single-url-environment-default/src/seed/single_url_environment_default/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/single-url-environment-no-default/src/seed/single_url_environment_no_default/core/pydantic_utilities.py b/seed/pydantic/single-url-environment-no-default/src/seed/single_url_environment_no_default/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/single-url-environment-no-default/src/seed/single_url_environment_no_default/core/pydantic_utilities.py +++ b/seed/pydantic/single-url-environment-no-default/src/seed/single_url_environment_no_default/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/streaming-parameter/src/seed/streaming/core/pydantic_utilities.py b/seed/pydantic/streaming-parameter/src/seed/streaming/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/streaming-parameter/src/seed/streaming/core/pydantic_utilities.py +++ b/seed/pydantic/streaming-parameter/src/seed/streaming/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/streaming/src/seed/streaming/core/pydantic_utilities.py b/seed/pydantic/streaming/src/seed/streaming/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/streaming/src/seed/streaming/core/pydantic_utilities.py +++ b/seed/pydantic/streaming/src/seed/streaming/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/trace/src/seed/trace/core/pydantic_utilities.py b/seed/pydantic/trace/src/seed/trace/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/trace/src/seed/trace/core/pydantic_utilities.py +++ b/seed/pydantic/trace/src/seed/trace/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/undiscriminated-unions/src/seed/undiscriminated_unions/core/pydantic_utilities.py b/seed/pydantic/undiscriminated-unions/src/seed/undiscriminated_unions/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/undiscriminated-unions/src/seed/undiscriminated_unions/core/pydantic_utilities.py +++ b/seed/pydantic/undiscriminated-unions/src/seed/undiscriminated_unions/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/unions/src/seed/unions/core/pydantic_utilities.py b/seed/pydantic/unions/src/seed/unions/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/unions/src/seed/unions/core/pydantic_utilities.py +++ b/seed/pydantic/unions/src/seed/unions/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/unknown/src/seed/unknown_as_any/core/pydantic_utilities.py b/seed/pydantic/unknown/src/seed/unknown_as_any/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/unknown/src/seed/unknown_as_any/core/pydantic_utilities.py +++ b/seed/pydantic/unknown/src/seed/unknown_as_any/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/validation/src/seed/validation/core/pydantic_utilities.py b/seed/pydantic/validation/src/seed/validation/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/validation/src/seed/validation/core/pydantic_utilities.py +++ b/seed/pydantic/validation/src/seed/validation/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/variables/src/seed/variables/core/pydantic_utilities.py b/seed/pydantic/variables/src/seed/variables/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/variables/src/seed/variables/core/pydantic_utilities.py +++ b/seed/pydantic/variables/src/seed/variables/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/version-no-default/src/seed/version/core/pydantic_utilities.py b/seed/pydantic/version-no-default/src/seed/version/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/version-no-default/src/seed/version/core/pydantic_utilities.py +++ b/seed/pydantic/version-no-default/src/seed/version/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/version/src/seed/version/core/pydantic_utilities.py b/seed/pydantic/version/src/seed/version/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/version/src/seed/version/core/pydantic_utilities.py +++ b/seed/pydantic/version/src/seed/version/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/pydantic/websocket/src/seed/websocket/core/pydantic_utilities.py b/seed/pydantic/websocket/src/seed/websocket/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/pydantic/websocket/src/seed/websocket/core/pydantic_utilities.py +++ b/seed/pydantic/websocket/src/seed/websocket/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/alias-extends/src/seed/core/pydantic_utilities.py b/seed/python-sdk/alias-extends/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/alias-extends/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/alias-extends/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/alias/src/seed/core/pydantic_utilities.py b/seed/python-sdk/alias/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/alias/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/alias/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/any-auth/src/seed/core/pydantic_utilities.py b/seed/python-sdk/any-auth/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/any-auth/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/any-auth/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/api-wide-base-path/src/seed/core/pydantic_utilities.py b/seed/python-sdk/api-wide-base-path/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/api-wide-base-path/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/api-wide-base-path/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/audiences/src/seed/core/pydantic_utilities.py b/seed/python-sdk/audiences/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/audiences/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/audiences/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/auth-environment-variables/src/seed/core/pydantic_utilities.py b/seed/python-sdk/auth-environment-variables/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/auth-environment-variables/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/auth-environment-variables/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/basic-auth-environment-variables/src/seed/core/pydantic_utilities.py b/seed/python-sdk/basic-auth-environment-variables/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/basic-auth-environment-variables/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/basic-auth-environment-variables/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/basic-auth/src/seed/core/pydantic_utilities.py b/seed/python-sdk/basic-auth/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/basic-auth/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/basic-auth/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/bearer-token-environment-variable/src/seed/core/pydantic_utilities.py b/seed/python-sdk/bearer-token-environment-variable/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/bearer-token-environment-variable/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/bearer-token-environment-variable/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/bytes/src/seed/core/pydantic_utilities.py b/seed/python-sdk/bytes/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/bytes/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/bytes/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/circular-references-advanced/src/seed/core/pydantic_utilities.py b/seed/python-sdk/circular-references-advanced/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/circular-references-advanced/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/circular-references-advanced/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/circular-references/src/seed/core/pydantic_utilities.py b/seed/python-sdk/circular-references/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/circular-references/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/circular-references/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/code-samples/resolved-snippet-templates.md b/seed/python-sdk/code-samples/resolved-snippet-templates.md new file mode 100644 index 00000000000..20b01e7841d --- /dev/null +++ b/seed/python-sdk/code-samples/resolved-snippet-templates.md @@ -0,0 +1,22 @@ +```python + + +client = SeedCodeSamples(base_url="https://yourhost.com/path/to/api", ) +client.service.hello( + num_events=5 +) + +``` + + +```python + + +client = SeedCodeSamples(base_url="https://yourhost.com/path/to/api", ) +client.service.hello( + num_events=5 +) + +``` + + diff --git a/seed/python-sdk/code-samples/src/seed/core/__init__.py b/seed/python-sdk/code-samples/src/seed/core/__init__.py index 4213c349a1d..f03aecbfe18 100644 --- a/seed/python-sdk/code-samples/src/seed/core/__init__.py +++ b/seed/python-sdk/code-samples/src/seed/core/__init__.py @@ -3,7 +3,7 @@ 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 +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 ( @@ -43,4 +43,5 @@ "universal_field_validator", "universal_root_validator", "update_forward_refs", + "with_content_type", ] diff --git a/seed/python-sdk/code-samples/src/seed/core/file.py b/seed/python-sdk/code-samples/src/seed/core/file.py index 6e0f92bfcb1..b4cbba30f73 100644 --- a/seed/python-sdk/code-samples/src/seed/core/file.py +++ b/seed/python-sdk/code-samples/src/seed/core/file.py @@ -1,30 +1,30 @@ # This file was auto-generated by Fern from our API Definition. -import typing +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 = typing.Union[typing.IO[bytes], bytes, str] -File = typing.Union[ +FileContent = Union[IO[bytes], bytes, str] +File = Union[ # file (or bytes) FileContent, # (filename, file (or bytes)) - typing.Tuple[typing.Optional[str], FileContent], + Tuple[Optional[str], FileContent], # (filename, file (or bytes), content_type) - typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str]], + Tuple[Optional[str], FileContent, Optional[str]], # (filename, file (or bytes), content_type, headers) - typing.Tuple[ - typing.Optional[str], + Tuple[ + Optional[str], FileContent, - typing.Optional[str], - typing.Mapping[str, str], + Optional[str], + Mapping[str, str], ], ] def convert_file_dict_to_httpx_tuples( - d: typing.Dict[str, typing.Union[File, typing.List[File]]], -) -> typing.List[typing.Tuple[str, File]]: + 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 @@ -41,3 +41,22 @@ def convert_file_dict_to_httpx_tuples( 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/code-samples/src/seed/core/pydantic_utilities.py b/seed/python-sdk/code-samples/src/seed/core/pydantic_utilities.py index 58a7a0fcddf..c14b4828025 100644 --- a/seed/python-sdk/code-samples/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/code-samples/src/seed/core/pydantic_utilities.py @@ -83,7 +83,7 @@ class UniversalBaseModel(pydantic.BaseModel): protected_namespaces=(), ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="wrap") # 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()} @@ -93,18 +93,19 @@ def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> ty class Config: smart_union = True + json_encoders = {dt.datetime: serialize_datetime} @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/cross-package-type-names/src/seed/core/pydantic_utilities.py b/seed/python-sdk/cross-package-type-names/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/cross-package-type-names/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/cross-package-type-names/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/custom-auth/src/seed/core/pydantic_utilities.py b/seed/python-sdk/custom-auth/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/custom-auth/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/custom-auth/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/enum/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/enum/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/enum/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/enum/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/enum/real-enum-forward-compat/src/seed/core/pydantic_utilities.py b/seed/python-sdk/enum/real-enum-forward-compat/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/enum/real-enum-forward-compat/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/enum/real-enum-forward-compat/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/enum/real-enum/src/seed/core/pydantic_utilities.py b/seed/python-sdk/enum/real-enum/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/enum/real-enum/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/enum/real-enum/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/enum/strenum/src/seed/core/pydantic_utilities.py b/seed/python-sdk/enum/strenum/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/enum/strenum/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/enum/strenum/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/error-property/src/seed/core/pydantic_utilities.py b/seed/python-sdk/error-property/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/error-property/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/error-property/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/examples/client-filename/snippet.json b/seed/python-sdk/examples/client-filename/snippet.json index 543dc1b46ae..83a775fa837 100644 --- a/seed/python-sdk/examples/client-filename/snippet.json +++ b/seed/python-sdk/examples/client-filename/snippet.json @@ -10,7 +10,7 @@ "type_types:CastMember": "from seed.types import Actor\n\nActor(\n id=\"actor_123\",\n name=\"Brad Pitt\",\n)\n", "type_types:Actress": "from seed.types import Actress\n\nActress(\n name=\"Jennifer Lawrence\",\n id=\"actor_456\",\n)\n", "type_types:ExtendedMovie": "from seed.types import ExtendedMovie\n\nExtendedMovie(\n id=\"movie-sda231x\",\n title=\"Pulp Fiction\",\n from_=\"Quentin Tarantino\",\n rating=8.5,\n tag=\"tag-12efs9dv\",\n cast=[\"John Travolta\", \"Samuel L. Jackson\", \"Uma Thurman\", \"Bruce Willis\"],\n metadata={\n \"academyAward\": true,\n \"releaseDate\": \"2023-12-08\",\n \"ratings\": {\"rottenTomatoes\": 97, \"imdb\": 7.6},\n },\n revenue=1000000,\n)\n", - "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'\",\n ),\n)\n", + "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"1994-01-01 01:01:01+00:00\",\n ),\n)\n", "type_types:File": "from seed.types import File\n\nFile(\n name=\"file.txt\",\n contents=\"...\",\n)\n", "type_types:Directory": "from seed.types import Directory, File\n\nDirectory(\n name=\"root\",\n files=[\n File(\n name=\"file.txt\",\n contents=\"...\",\n )\n ],\n directories=[\n Directory(\n name=\"tmp\",\n files=[\n File(\n name=\"another_file.txt\",\n contents=\"...\",\n )\n ],\n )\n ],\n)\n", "type_types:Node": "from seed.types import Node, Tree\n\nNode(\n name=\"root\",\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n trees=[\n Tree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n )\n ],\n)\n", diff --git a/seed/python-sdk/examples/client-filename/src/seed/core/pydantic_utilities.py b/seed/python-sdk/examples/client-filename/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/examples/client-filename/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/examples/client-filename/src/seed/types/types/moment.py b/seed/python-sdk/examples/client-filename/src/seed/types/types/moment.py index 673c1e7380f..b7a0e24cc37 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/types/types/moment.py +++ b/seed/python-sdk/examples/client-filename/src/seed/types/types/moment.py @@ -25,7 +25,7 @@ class Moment(UniversalBaseModel): "1994-01-01", ), datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'", + "1994-01-01 01:01:01+00:00", ), ) """ diff --git a/seed/python-sdk/examples/no-custom-config/snippet.json b/seed/python-sdk/examples/no-custom-config/snippet.json index b6e3d242617..43b6164d0ac 100644 --- a/seed/python-sdk/examples/no-custom-config/snippet.json +++ b/seed/python-sdk/examples/no-custom-config/snippet.json @@ -10,7 +10,7 @@ "type_types:CastMember": "from seed.types import Actor\n\nActor(\n id=\"actor_123\",\n name=\"Brad Pitt\",\n)\n", "type_types:Actress": "from seed.types import Actress\n\nActress(\n name=\"Jennifer Lawrence\",\n id=\"actor_456\",\n)\n", "type_types:ExtendedMovie": "from seed.types import ExtendedMovie\n\nExtendedMovie(\n id=\"movie-sda231x\",\n title=\"Pulp Fiction\",\n from_=\"Quentin Tarantino\",\n rating=8.5,\n tag=\"tag-12efs9dv\",\n cast=[\"John Travolta\", \"Samuel L. Jackson\", \"Uma Thurman\", \"Bruce Willis\"],\n metadata={\n \"academyAward\": true,\n \"releaseDate\": \"2023-12-08\",\n \"ratings\": {\"rottenTomatoes\": 97, \"imdb\": 7.6},\n },\n revenue=1000000,\n)\n", - "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'\",\n ),\n)\n", + "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"1994-01-01 01:01:01+00:00\",\n ),\n)\n", "type_types:File": "from seed.types import File\n\nFile(\n name=\"file.txt\",\n contents=\"...\",\n)\n", "type_types:Directory": "from seed.types import Directory, File\n\nDirectory(\n name=\"root\",\n files=[\n File(\n name=\"file.txt\",\n contents=\"...\",\n )\n ],\n directories=[\n Directory(\n name=\"tmp\",\n files=[\n File(\n name=\"another_file.txt\",\n contents=\"...\",\n )\n ],\n )\n ],\n)\n", "type_types:Node": "from seed.types import Node, Tree\n\nNode(\n name=\"root\",\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n trees=[\n Tree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n )\n ],\n)\n", diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/examples/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/types/types/moment.py b/seed/python-sdk/examples/no-custom-config/src/seed/types/types/moment.py index 673c1e7380f..b7a0e24cc37 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/types/types/moment.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/types/types/moment.py @@ -25,7 +25,7 @@ class Moment(UniversalBaseModel): "1994-01-01", ), datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'", + "1994-01-01 01:01:01+00:00", ), ) """ diff --git a/seed/python-sdk/examples/readme/snippet.json b/seed/python-sdk/examples/readme/snippet.json index b6e3d242617..43b6164d0ac 100644 --- a/seed/python-sdk/examples/readme/snippet.json +++ b/seed/python-sdk/examples/readme/snippet.json @@ -10,7 +10,7 @@ "type_types:CastMember": "from seed.types import Actor\n\nActor(\n id=\"actor_123\",\n name=\"Brad Pitt\",\n)\n", "type_types:Actress": "from seed.types import Actress\n\nActress(\n name=\"Jennifer Lawrence\",\n id=\"actor_456\",\n)\n", "type_types:ExtendedMovie": "from seed.types import ExtendedMovie\n\nExtendedMovie(\n id=\"movie-sda231x\",\n title=\"Pulp Fiction\",\n from_=\"Quentin Tarantino\",\n rating=8.5,\n tag=\"tag-12efs9dv\",\n cast=[\"John Travolta\", \"Samuel L. Jackson\", \"Uma Thurman\", \"Bruce Willis\"],\n metadata={\n \"academyAward\": true,\n \"releaseDate\": \"2023-12-08\",\n \"ratings\": {\"rottenTomatoes\": 97, \"imdb\": 7.6},\n },\n revenue=1000000,\n)\n", - "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'\",\n ),\n)\n", + "type_types:Moment": "import datetime\nimport uuid\n\nfrom seed.types import Moment\n\nMoment(\n id=uuid.UUID(\n \"656f12d6-f592-444c-a1d3-a3cfd46d5b39\",\n ),\n date=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n datetime=datetime.datetime.fromisoformat(\n \"1994-01-01 01:01:01+00:00\",\n ),\n)\n", "type_types:File": "from seed.types import File\n\nFile(\n name=\"file.txt\",\n contents=\"...\",\n)\n", "type_types:Directory": "from seed.types import Directory, File\n\nDirectory(\n name=\"root\",\n files=[\n File(\n name=\"file.txt\",\n contents=\"...\",\n )\n ],\n directories=[\n Directory(\n name=\"tmp\",\n files=[\n File(\n name=\"another_file.txt\",\n contents=\"...\",\n )\n ],\n )\n ],\n)\n", "type_types:Node": "from seed.types import Node, Tree\n\nNode(\n name=\"root\",\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n trees=[\n Tree(\n nodes=[\n Node(\n name=\"left\",\n ),\n Node(\n name=\"right\",\n ),\n ],\n )\n ],\n)\n", diff --git a/seed/python-sdk/examples/readme/src/seed/core/pydantic_utilities.py b/seed/python-sdk/examples/readme/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/examples/readme/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/examples/readme/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/examples/readme/src/seed/types/types/moment.py b/seed/python-sdk/examples/readme/src/seed/types/types/moment.py index 673c1e7380f..b7a0e24cc37 100644 --- a/seed/python-sdk/examples/readme/src/seed/types/types/moment.py +++ b/seed/python-sdk/examples/readme/src/seed/types/types/moment.py @@ -25,7 +25,7 @@ class Moment(UniversalBaseModel): "1994-01-01", ), datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'", + "1994-01-01 01:01:01+00:00", ), ) """ diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/reference.md b/seed/python-sdk/exhaustive/aliases_with_validation/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/reference.md +++ b/seed/python-sdk/exhaustive/aliases_with_validation/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/snippet.json b/seed/python-sdk/exhaustive/aliases_with_validation/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/snippet.json +++ b/seed/python-sdk/exhaustive/aliases_with_validation/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/object/client.py index 30f46b900c1..874068ae55b 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/object/client.py @@ -97,7 +97,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -289,7 +289,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -375,7 +375,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -459,7 +459,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -580,7 +580,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -795,7 +795,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -888,7 +888,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -979,7 +979,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/inlined_requests/client.py index 8d0c0386674..6794f430726 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/src/seed/inlined_requests/client.py @@ -67,7 +67,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -175,7 +175,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/aliases_with_validation/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/aliases_with_validation/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/aliases_with_validation/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/aliases_with_validation/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/reference.md b/seed/python-sdk/exhaustive/aliases_without_validation/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/reference.md +++ b/seed/python-sdk/exhaustive/aliases_without_validation/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/snippet.json b/seed/python-sdk/exhaustive/aliases_without_validation/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/snippet.json +++ b/seed/python-sdk/exhaustive/aliases_without_validation/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/http_methods/client.py index a7413884fcf..5cf818c947e 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/object/client.py index 5edf0944694..daa40201a48 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/object/client.py @@ -97,7 +97,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -289,7 +289,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -375,7 +375,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -459,7 +459,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -580,7 +580,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -795,7 +795,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -888,7 +888,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -979,7 +979,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/primitive/client.py index 6d41508b008..a68dd92bff1 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/inlined_requests/client.py index 2d3b8856c26..97c1ed2f4f9 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/src/seed/inlined_requests/client.py @@ -67,7 +67,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -175,7 +175,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/aliases_without_validation/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/aliases_without_validation/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/aliases_without_validation/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/aliases_without_validation/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/reference.md b/seed/python-sdk/exhaustive/deps_with_min_python_version/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/reference.md +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/snippet.json b/seed/python-sdk/exhaustive/deps_with_min_python_version/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/snippet.json +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/reference.md b/seed/python-sdk/exhaustive/extra_dependencies/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/reference.md +++ b/seed/python-sdk/exhaustive/extra_dependencies/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/snippet.json b/seed/python-sdk/exhaustive/extra_dependencies/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/snippet.json +++ b/seed/python-sdk/exhaustive/extra_dependencies/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/extra_dependencies/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/extra_dependencies/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/reference.md b/seed/python-sdk/exhaustive/extra_dev_dependencies/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/reference.md +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/snippet.json b/seed/python-sdk/exhaustive/extra_dev_dependencies/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/snippet.json +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/extra_dev_dependencies/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/reference.md b/seed/python-sdk/exhaustive/five-second-timeout/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/reference.md +++ b/seed/python-sdk/exhaustive/five-second-timeout/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/snippet.json b/seed/python-sdk/exhaustive/five-second-timeout/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/snippet.json +++ b/seed/python-sdk/exhaustive/five-second-timeout/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/five-second-timeout/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/five-second-timeout/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/reference.md b/seed/python-sdk/exhaustive/follow_redirects_by_default/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/reference.md +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/snippet.json b/seed/python-sdk/exhaustive/follow_redirects_by_default/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/snippet.json +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/follow_redirects_by_default/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/improved_imports/reference.md b/seed/python-sdk/exhaustive/improved_imports/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/improved_imports/reference.md +++ b/seed/python-sdk/exhaustive/improved_imports/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/improved_imports/snippet.json b/seed/python-sdk/exhaustive/improved_imports/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/improved_imports/snippet.json +++ b/seed/python-sdk/exhaustive/improved_imports/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/improved_imports/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/improved_imports/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/improved_imports/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/improved_imports/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/improved_imports/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/reference.md b/seed/python-sdk/exhaustive/infinite-timeout/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/reference.md +++ b/seed/python-sdk/exhaustive/infinite-timeout/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/snippet.json b/seed/python-sdk/exhaustive/infinite-timeout/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/snippet.json +++ b/seed/python-sdk/exhaustive/infinite-timeout/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/infinite-timeout/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/infinite-timeout/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/inline_request_params/reference.md b/seed/python-sdk/exhaustive/inline_request_params/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/reference.md +++ b/seed/python-sdk/exhaustive/inline_request_params/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/inline_request_params/snippet.json b/seed/python-sdk/exhaustive/inline_request_params/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/snippet.json +++ b/seed/python-sdk/exhaustive/inline_request_params/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/inline_request_params/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/inline_request_params/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/inline_request_params/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/inline_request_params/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/inline_request_params/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/inline_request_params/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/inline_request_params/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/inline_request_params/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/inline_request_params/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/inline_request_params/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/inline_request_params/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/inline_request_params/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/no-custom-config/reference.md b/seed/python-sdk/exhaustive/no-custom-config/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/reference.md +++ b/seed/python-sdk/exhaustive/no-custom-config/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/no-custom-config/snippet.json b/seed/python-sdk/exhaustive/no-custom-config/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/snippet.json +++ b/seed/python-sdk/exhaustive/no-custom-config/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/no-custom-config/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/no-custom-config/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/no-custom-config/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/no-custom-config/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/reference.md b/seed/python-sdk/exhaustive/pydantic-extra-fields/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/reference.md +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json b/seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/reference.md b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/reference.md +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/snippet.json b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/snippet.json +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/pydantic-v1-wrapped/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/reference.md b/seed/python-sdk/exhaustive/pydantic-v1/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/reference.md +++ b/seed/python-sdk/exhaustive/pydantic-v1/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/snippet.json b/seed/python-sdk/exhaustive/pydantic-v1/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/snippet.json +++ b/seed/python-sdk/exhaustive/pydantic-v1/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pydantic-v1/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/pydantic-v1/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/reference.md b/seed/python-sdk/exhaustive/pyproject_extras/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/reference.md +++ b/seed/python-sdk/exhaustive/pyproject_extras/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/snippet.json b/seed/python-sdk/exhaustive/pyproject_extras/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/snippet.json +++ b/seed/python-sdk/exhaustive/pyproject_extras/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/pyproject_extras/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/pyproject_extras/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/pyproject_extras/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/pyproject_extras/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/reference.md b/seed/python-sdk/exhaustive/skip-pydantic-validation/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/reference.md +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/snippet.json b/seed/python-sdk/exhaustive/skip-pydantic-validation/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/snippet.json +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/http_methods/client.py index a7413884fcf..5cf818c947e 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/object/client.py index 877094537f5..545b1331932 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/primitive/client.py index 6d41508b008..a68dd92bff1 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/inlined_requests/client.py index f4028b5013b..3512e8edfb6 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/skip-pydantic-validation/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/union-utils/reference.md b/seed/python-sdk/exhaustive/union-utils/reference.md index ebe6188f28a..942131cb4b9 100644 --- a/seed/python-sdk/exhaustive/union-utils/reference.md +++ b/seed/python-sdk/exhaustive/union-utils/reference.md @@ -686,7 +686,7 @@ client.endpoints.http_methods.test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -926,7 +926,7 @@ client.endpoints.object.get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1217,7 +1217,7 @@ client.endpoints.object.get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1308,7 +1308,7 @@ client.endpoints.object.get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -1411,7 +1411,7 @@ client.endpoints.object.get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -2164,7 +2164,7 @@ client = SeedExhaustive( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) @@ -2491,7 +2491,7 @@ client.inlined_requests.post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/union-utils/snippet.json b/seed/python-sdk/exhaustive/union-utils/snippet.json index d2b894a633c..a5180cd2085 100644 --- a/seed/python-sdk/exhaustive/union-utils/snippet.json +++ b/seed/python-sdk/exhaustive/union-utils/snippet.json @@ -152,8 +152,8 @@ "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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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=\"string\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -178,8 +178,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -217,8 +217,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -230,8 +230,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -243,8 +243,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n ],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -386,8 +386,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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" } }, @@ -451,8 +451,8 @@ "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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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 \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", + "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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\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_=[\"string\"],\n set_={\"string\"},\n map_={1: \"string\"},\n bigint=\"123456789123456789\",\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/core/pydantic_utilities.py b/seed/python-sdk/exhaustive/union-utils/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/http_methods/client.py b/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/http_methods/client.py index d93b915385e..a3cdcdf91f2 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/http_methods/client.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/http_methods/client.py @@ -244,7 +244,7 @@ def test_patch( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -595,7 +595,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/object/client.py b/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/object/client.py index 4f5f3c98788..7095131627b 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/object/client.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/object/client.py @@ -98,7 +98,7 @@ def get_and_return_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -290,7 +290,7 @@ def get_and_return_nested_with_optional_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -378,7 +378,7 @@ def get_and_return_nested_with_required_field( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -464,7 +464,7 @@ def get_and_return_nested_with_required_field_as_list( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -587,7 +587,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -802,7 +802,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -897,7 +897,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -990,7 +990,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/primitive/client.py b/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/primitive/client.py index 0c570058f9a..5e18f184482 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/primitive/client.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/endpoints/primitive/client.py @@ -277,7 +277,7 @@ def get_and_return_datetime( ) client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) """ @@ -766,7 +766,7 @@ async def get_and_return_datetime( async def main() -> None: await client.endpoints.primitive.get_and_return_datetime( request=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), ) diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/inlined_requests/client.py b/seed/python-sdk/exhaustive/union-utils/src/seed/inlined_requests/client.py index 72c68de9fcd..6b3d6937047 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/inlined_requests/client.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/inlined_requests/client.py @@ -68,7 +68,7 @@ def post_with_object_bodyand_response( double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", @@ -178,7 +178,7 @@ async def main() -> None: double=1.1, bool_=True, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), date=datetime.date.fromisoformat( "2023-01-15", diff --git a/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_http_methods.py b/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_http_methods.py index 454bd88677a..9bb08cbe722 100644 --- a/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_http_methods.py +++ b/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_http_methods.py @@ -132,9 +132,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -152,9 +150,7 @@ async def test_test_patch(client: SeedExhaustive, async_client: AsyncSeedExhaust long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_object.py b/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_object.py index 48fce576fa3..6d8955bf5d3 100644 --- a/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_object.py +++ b/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_object.py @@ -47,9 +47,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -66,9 +64,7 @@ async def test_get_and_return_with_optional_field(client: SeedExhaustive, async_ long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -149,9 +145,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -171,9 +165,7 @@ async def test_get_and_return_nested_with_optional_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -234,9 +226,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -257,9 +247,7 @@ async def test_get_and_return_nested_with_required_field( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -321,9 +309,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -347,9 +333,7 @@ async def test_get_and_return_nested_with_required_field_as_list( long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_primitive.py b/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_primitive.py index b0be753c6c5..ad943784420 100644 --- a/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_primitive.py +++ b/seed/python-sdk/exhaustive/union-utils/tests/endpoints/test_primitive.py @@ -62,16 +62,12 @@ async def test_get_and_return_datetime(client: SeedExhaustive, async_client: Asy 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + 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( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ) + request=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00") ) validate_response(async_response, expected_response, expected_types) diff --git a/seed/python-sdk/exhaustive/union-utils/tests/test_inlined_requests.py b/seed/python-sdk/exhaustive/union-utils/tests/test_inlined_requests.py index 5ed25b09254..4fecc702d4b 100644 --- a/seed/python-sdk/exhaustive/union-utils/tests/test_inlined_requests.py +++ b/seed/python-sdk/exhaustive/union-utils/tests/test_inlined_requests.py @@ -49,9 +49,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", @@ -72,9 +70,7 @@ async def test_post_with_object_bodyand_response(client: SeedExhaustive, async_c long_=1000000, double=1.1, bool_=True, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + 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", diff --git a/seed/python-sdk/extends/src/seed/core/pydantic_utilities.py b/seed/python-sdk/extends/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/extends/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/extends/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/extra-properties/src/seed/core/pydantic_utilities.py b/seed/python-sdk/extra-properties/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/extra-properties/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/extra-properties/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/file-download/src/seed/core/pydantic_utilities.py b/seed/python-sdk/file-download/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/file-download/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/file-download/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/file-upload/src/seed/core/pydantic_utilities.py b/seed/python-sdk/file-upload/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/file-upload/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/file-upload/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/folders/src/seed/core/pydantic_utilities.py b/seed/python-sdk/folders/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/folders/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/folders/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/grpc-proto-exhaustive/src/seed/core/pydantic_utilities.py b/seed/python-sdk/grpc-proto-exhaustive/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/grpc-proto-exhaustive/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/grpc-proto-exhaustive/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/grpc-proto/.mock/proto/google/api/field_behavior.proto b/seed/python-sdk/grpc-proto/.mock/proto/google/api/field_behavior.proto new file mode 100644 index 00000000000..128799c558d --- /dev/null +++ b/seed/python-sdk/grpc-proto/.mock/proto/google/api/field_behavior.proto @@ -0,0 +1,104 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated google.api.FieldBehavior field_behavior = 1052; +} + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; + + // Denotes that a (repeated) field is an unordered list. + // This indicates that the service may provide the elements of the list + // in any arbitrary order, rather than the order the user originally + // provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6; + + // Denotes that this field returns a non-empty default value if not set. + // This indicates that if the user provides the empty value in a request, + // a non-empty value will be returned. The user will not be aware of what + // non-empty value to expect. + NON_EMPTY_DEFAULT = 7; + + // Denotes that the field in a resource (a message annotated with + // google.api.resource) is used in the resource name to uniquely identify the + // resource. For AIP-compliant APIs, this should only be applied to the + // `name` field on the resource. + // + // This behavior should not be applied to references to other resources within + // the message. + // + // The identifier field of resources often have different field behavior + // depending on the request it is embedded in (e.g. for Create methods name + // is optional and unused, while for Update methods it is required). Instead + // of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8; +} \ No newline at end of file diff --git a/seed/python-sdk/grpc-proto/src/seed/core/pydantic_utilities.py b/seed/python-sdk/grpc-proto/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/grpc-proto/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/grpc-proto/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/grpc/resolved-snippet-templates.md b/seed/python-sdk/grpc/resolved-snippet-templates.md new file mode 100644 index 00000000000..6d7b123e80c --- /dev/null +++ b/seed/python-sdk/grpc/resolved-snippet-templates.md @@ -0,0 +1,27 @@ +```python + + +client = SeedApi(base_url="https://yourhost.com/path/to/api", ) +client.user.create_user( + username="string", + email="string", + age=1, + weight=1.1 +) + +``` + + +```python + + +client = SeedApi(base_url="https://yourhost.com/path/to/api", ) +client.user.get_user( + username="string", + age=1, + weight=1.1 +) + +``` + + diff --git a/seed/python-sdk/grpc/src/seed/core/__init__.py b/seed/python-sdk/grpc/src/seed/core/__init__.py index 4213c349a1d..f03aecbfe18 100644 --- a/seed/python-sdk/grpc/src/seed/core/__init__.py +++ b/seed/python-sdk/grpc/src/seed/core/__init__.py @@ -3,7 +3,7 @@ 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 +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 ( @@ -43,4 +43,5 @@ "universal_field_validator", "universal_root_validator", "update_forward_refs", + "with_content_type", ] diff --git a/seed/python-sdk/grpc/src/seed/core/file.py b/seed/python-sdk/grpc/src/seed/core/file.py index 6e0f92bfcb1..b4cbba30f73 100644 --- a/seed/python-sdk/grpc/src/seed/core/file.py +++ b/seed/python-sdk/grpc/src/seed/core/file.py @@ -1,30 +1,30 @@ # This file was auto-generated by Fern from our API Definition. -import typing +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 = typing.Union[typing.IO[bytes], bytes, str] -File = typing.Union[ +FileContent = Union[IO[bytes], bytes, str] +File = Union[ # file (or bytes) FileContent, # (filename, file (or bytes)) - typing.Tuple[typing.Optional[str], FileContent], + Tuple[Optional[str], FileContent], # (filename, file (or bytes), content_type) - typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str]], + Tuple[Optional[str], FileContent, Optional[str]], # (filename, file (or bytes), content_type, headers) - typing.Tuple[ - typing.Optional[str], + Tuple[ + Optional[str], FileContent, - typing.Optional[str], - typing.Mapping[str, str], + Optional[str], + Mapping[str, str], ], ] def convert_file_dict_to_httpx_tuples( - d: typing.Dict[str, typing.Union[File, typing.List[File]]], -) -> typing.List[typing.Tuple[str, File]]: + 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 @@ -41,3 +41,22 @@ def convert_file_dict_to_httpx_tuples( 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/grpc/src/seed/core/pydantic_utilities.py b/seed/python-sdk/grpc/src/seed/core/pydantic_utilities.py index 58a7a0fcddf..c14b4828025 100644 --- a/seed/python-sdk/grpc/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/grpc/src/seed/core/pydantic_utilities.py @@ -83,7 +83,7 @@ class UniversalBaseModel(pydantic.BaseModel): protected_namespaces=(), ) # type: ignore # Pydantic v2 - @pydantic.model_serializer(mode="wrap") # 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()} @@ -93,18 +93,19 @@ def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> ty class Config: smart_union = True + json_encoders = {dt.datetime: serialize_datetime} @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/idempotency-headers/src/seed/core/pydantic_utilities.py b/seed/python-sdk/idempotency-headers/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/idempotency-headers/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/idempotency-headers/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/imdb/src/seed/core/pydantic_utilities.py b/seed/python-sdk/imdb/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/imdb/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/imdb/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/literal/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/literal/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/literal/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/literal/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/literal/use_typeddict_requests/src/seed/core/pydantic_utilities.py b/seed/python-sdk/literal/use_typeddict_requests/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/literal/use_typeddict_requests/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/literal/use_typeddict_requests/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/mixed-case/src/seed/core/pydantic_utilities.py b/seed/python-sdk/mixed-case/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/mixed-case/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/mixed-case/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/mixed-file-directory/src/seed/core/pydantic_utilities.py b/seed/python-sdk/mixed-file-directory/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/mixed-file-directory/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/mixed-file-directory/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/multi-line-docs/src/seed/core/pydantic_utilities.py b/seed/python-sdk/multi-line-docs/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/multi-line-docs/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/multi-line-docs/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/multi-url-environment-no-default/src/seed/core/pydantic_utilities.py b/seed/python-sdk/multi-url-environment-no-default/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/multi-url-environment-no-default/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/multi-url-environment-no-default/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/multi-url-environment/src/seed/core/pydantic_utilities.py b/seed/python-sdk/multi-url-environment/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/multi-url-environment/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/multi-url-environment/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/no-environment/src/seed/core/pydantic_utilities.py b/seed/python-sdk/no-environment/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/no-environment/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/no-environment/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/oauth-client-credentials-default/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials-default/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/oauth-client-credentials-default/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/oauth-client-credentials-default/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/oauth-client-credentials-nested-root/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials-nested-root/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/oauth-client-credentials-nested-root/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/oauth-client-credentials-nested-root/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/oauth-client-credentials/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/oauth-client-credentials/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/oauth-client-credentials/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/object/snippet.json b/seed/python-sdk/object/snippet.json index 84291c3a1b0..01bed66e0bc 100644 --- a/seed/python-sdk/object/snippet.json +++ b/seed/python-sdk/object/snippet.json @@ -1,6 +1,6 @@ { "types": { - "type_:Type": "import datetime\nimport uuid\n\nfrom seed import Name, Type\n\nType(\n one=1,\n two=2.0,\n three=\"three\",\n four=True,\n five=5,\n six=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'\",\n ),\n seven=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n eight=uuid.UUID(\n \"7f71f677-e138-4a5c-bb01-e4453a19bfef\",\n ),\n nine=\"TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu\",\n ten=[10, 10],\n eleven={11.0},\n twelve={\"invalid\": False, \"exists\": True},\n thirteen=13,\n fourteen={},\n fifteen=[[15, 15], [15, 15]],\n sixteen=[{\"foo\": 16, \"bar\": 16}],\n seventeen=[\n uuid.UUID(\n \"244c6643-f99d-4bfc-b20d-a6518f3a4cf4\",\n ),\n uuid.UUID(\n \"07791987-dec3-43b5-8dc4-250ab5dc0478\",\n ),\n ],\n nineteen=Name(\n id=\"name-129fsdj9\",\n value=\"nineteen\",\n ),\n twenty=20,\n twentyone=21,\n twentytwo=22.22,\n twentythree=\"23\",\n)\n", + "type_:Type": "import datetime\nimport uuid\n\nfrom seed import Name, Type\n\nType(\n one=1,\n two=2.0,\n three=\"three\",\n four=True,\n five=5,\n six=datetime.datetime.fromisoformat(\n \"1994-01-01 01:01:01+00:00\",\n ),\n seven=datetime.date.fromisoformat(\n \"1994-01-01\",\n ),\n eight=uuid.UUID(\n \"7f71f677-e138-4a5c-bb01-e4453a19bfef\",\n ),\n nine=\"TWFueSBoYW5kcyBtYWtlIGxpZ2h0IHdvcmsu\",\n ten=[10, 10],\n eleven={11.0},\n twelve={\"invalid\": False, \"exists\": True},\n thirteen=13,\n fourteen={},\n fifteen=[[15, 15], [15, 15]],\n sixteen=[{\"foo\": 16, \"bar\": 16}],\n seventeen=[\n uuid.UUID(\n \"244c6643-f99d-4bfc-b20d-a6518f3a4cf4\",\n ),\n uuid.UUID(\n \"07791987-dec3-43b5-8dc4-250ab5dc0478\",\n ),\n ],\n nineteen=Name(\n id=\"name-129fsdj9\",\n value=\"nineteen\",\n ),\n twenty=20,\n twentyone=21,\n twentytwo=22.22,\n twentythree=\"23\",\n)\n", "type_:Name": "from seed import Name\n\nName(\n id=\"name-sdfg8ajk\",\n value=\"name\",\n)\n" }, "endpoints": [] diff --git a/seed/python-sdk/object/src/seed/core/pydantic_utilities.py b/seed/python-sdk/object/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/object/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/object/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/object/src/seed/types/type.py b/seed/python-sdk/object/src/seed/types/type.py index 705113276da..622c69ac661 100644 --- a/seed/python-sdk/object/src/seed/types/type.py +++ b/seed/python-sdk/object/src/seed/types/type.py @@ -27,7 +27,7 @@ class Type(UniversalBaseModel): four=True, five=5, six=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(1994, 1, 1, 1, 1, 1, tzinfo=TzInfo(UTC)) raw='1994-01-01T01:01:01Z'", + "1994-01-01 01:01:01+00:00", ), seven=datetime.date.fromisoformat( "1994-01-01", diff --git a/seed/python-sdk/objects-with-imports/src/seed/core/pydantic_utilities.py b/seed/python-sdk/objects-with-imports/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/objects-with-imports/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/optional/src/seed/core/pydantic_utilities.py b/seed/python-sdk/optional/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/optional/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/optional/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/package-yml/src/seed/core/pydantic_utilities.py b/seed/python-sdk/package-yml/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/package-yml/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/package-yml/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/pagination/src/seed/core/pydantic_utilities.py b/seed/python-sdk/pagination/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/pagination/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/pagination/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/plain-text/src/seed/core/pydantic_utilities.py b/seed/python-sdk/plain-text/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/plain-text/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/plain-text/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/query-parameters/README.md b/seed/python-sdk/query-parameters/README.md index a2b17a7e913..2e128a74dd6 100644 --- a/seed/python-sdk/query-parameters/README.md +++ b/seed/python-sdk/query-parameters/README.md @@ -34,7 +34,7 @@ client.user.get_username( "2023-01-15", ), deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), bytes="SGVsbG8gd29ybGQh", user=User( @@ -48,7 +48,7 @@ client.user.get_username( ) ], optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), key_value={"string": "string"}, optional_string="string", @@ -98,7 +98,7 @@ async def main() -> None: "2023-01-15", ), deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), bytes="SGVsbG8gd29ybGQh", user=User( @@ -112,7 +112,7 @@ async def main() -> None: ) ], optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), key_value={"string": "string"}, optional_string="string", diff --git a/seed/python-sdk/query-parameters/reference.md b/seed/python-sdk/query-parameters/reference.md index db6875c869a..805213511b5 100644 --- a/seed/python-sdk/query-parameters/reference.md +++ b/seed/python-sdk/query-parameters/reference.md @@ -31,7 +31,7 @@ client.user.get_username( "2023-01-15", ), deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), bytes="SGVsbG8gd29ybGQh", user=User( @@ -45,7 +45,7 @@ client.user.get_username( ) ], optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), key_value={"string": "string"}, optional_string="string", diff --git a/seed/python-sdk/query-parameters/snippet.json b/seed/python-sdk/query-parameters/snippet.json index 4c3dccee944..bbf5d1c95ef 100644 --- a/seed/python-sdk/query-parameters/snippet.json +++ b/seed/python-sdk/query-parameters/snippet.json @@ -9,8 +9,8 @@ "identifier_override": "endpoint_user.getUsername" }, "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedQueryParameters\nfrom seed.user import NestedUser, User\n\nclient = SeedQueryParameters(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.user.get_username(\n limit=1,\n id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n deadline=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n bytes=\"SGVsbG8gd29ybGQh\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n user_list=[\n User(\n name=\"string\",\n tags=[\"string\"],\n )\n ],\n optional_deadline=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n key_value={\"string\": \"string\"},\n optional_string=\"string\",\n nested_user=NestedUser(\n name=\"string\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n ),\n optional_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n exclude_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n filter=\"string\",\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedQueryParameters\nfrom seed.user import NestedUser, User\n\nclient = AsyncSeedQueryParameters(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.user.get_username(\n limit=1,\n id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n deadline=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n bytes=\"SGVsbG8gd29ybGQh\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n user_list=[\n User(\n name=\"string\",\n tags=[\"string\"],\n )\n ],\n optional_deadline=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n key_value={\"string\": \"string\"},\n optional_string=\"string\",\n nested_user=NestedUser(\n name=\"string\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n ),\n optional_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n exclude_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n filter=\"string\",\n )\n\n\nasyncio.run(main())\n", + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedQueryParameters\nfrom seed.user import NestedUser, User\n\nclient = SeedQueryParameters(\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.user.get_username(\n limit=1,\n id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n deadline=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n bytes=\"SGVsbG8gd29ybGQh\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n user_list=[\n User(\n name=\"string\",\n tags=[\"string\"],\n )\n ],\n optional_deadline=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n key_value={\"string\": \"string\"},\n optional_string=\"string\",\n nested_user=NestedUser(\n name=\"string\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n ),\n optional_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n exclude_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n filter=\"string\",\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedQueryParameters\nfrom seed.user import NestedUser, User\n\nclient = AsyncSeedQueryParameters(\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.user.get_username(\n limit=1,\n id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n deadline=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n bytes=\"SGVsbG8gd29ybGQh\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n user_list=[\n User(\n name=\"string\",\n tags=[\"string\"],\n )\n ],\n optional_deadline=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n key_value={\"string\": \"string\"},\n optional_string=\"string\",\n nested_user=NestedUser(\n name=\"string\",\n user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n ),\n optional_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n exclude_user=User(\n name=\"string\",\n tags=[\"string\"],\n ),\n filter=\"string\",\n )\n\n\nasyncio.run(main())\n", "type": "python" } } diff --git a/seed/python-sdk/query-parameters/src/seed/core/pydantic_utilities.py b/seed/python-sdk/query-parameters/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/query-parameters/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/query-parameters/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/query-parameters/src/seed/user/client.py b/seed/python-sdk/query-parameters/src/seed/user/client.py index d674f6ff2b7..b50eeae2c40 100644 --- a/seed/python-sdk/query-parameters/src/seed/user/client.py +++ b/seed/python-sdk/query-parameters/src/seed/user/client.py @@ -96,7 +96,7 @@ def get_username( "2023-01-15", ), deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), bytes="SGVsbG8gd29ybGQh", user=User( @@ -110,7 +110,7 @@ def get_username( ) ], optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), key_value={"string": "string"}, optional_string="string", @@ -261,7 +261,7 @@ async def main() -> None: "2023-01-15", ), deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), bytes="SGVsbG8gd29ybGQh", user=User( @@ -275,7 +275,7 @@ async def main() -> None: ) ], optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), key_value={"string": "string"}, optional_string="string", diff --git a/seed/python-sdk/query-parameters/tests/test_user.py b/seed/python-sdk/query-parameters/tests/test_user.py index a48a7eca47e..f488ae86626 100644 --- a/seed/python-sdk/query-parameters/tests/test_user.py +++ b/seed/python-sdk/query-parameters/tests/test_user.py @@ -17,15 +17,11 @@ async def test_get_username(client: SeedQueryParameters, async_client: AsyncSeed limit=1, id=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), date=datetime.date.fromisoformat("2023-01-15"), - deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + deadline=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), bytes="SGVsbG8gd29ybGQh", user=User(name="string", tags=["string"]), user_list=[User(name="string", tags=["string"])], - optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + optional_deadline=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), key_value={"string": "string"}, optional_string="string", nested_user=NestedUser(name="string", user=User(name="string", tags=["string"])), @@ -39,15 +35,11 @@ async def test_get_username(client: SeedQueryParameters, async_client: AsyncSeed limit=1, id=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), date=datetime.date.fromisoformat("2023-01-15"), - deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + deadline=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), bytes="SGVsbG8gd29ybGQh", user=User(name="string", tags=["string"]), user_list=[User(name="string", tags=["string"])], - optional_deadline=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + optional_deadline=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), key_value={"string": "string"}, optional_string="string", nested_user=NestedUser(name="string", user=User(name="string", tags=["string"])), diff --git a/seed/python-sdk/reserved-keywords/src/seed/core/pydantic_utilities.py b/seed/python-sdk/reserved-keywords/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/reserved-keywords/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/reserved-keywords/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/response-property/src/seed/core/pydantic_utilities.py b/seed/python-sdk/response-property/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/response-property/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/response-property/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/seed.yml b/seed/python-sdk/seed.yml index 242712d6bd0..3af5bde662b 100644 --- a/seed/python-sdk/seed.yml +++ b/seed/python-sdk/seed.yml @@ -202,10 +202,20 @@ fixtures: skip_validation: true outputFolder: skip-pydantic-validation scripts: + # We need to run in 3.8, but the image won't be updated until this is merged to main, so adding + # a 3rd script here to ensure we're testing on 3.8 + - docker: mwalbeck/python-poetry:1.7-3.8 + commands: + # Tests now run a mock server, you can always run seed with --skip-scripts to save time + - export NPM_CONFIG_CACHE="$(pwd)/.cache" + - export HOME="$(pwd)/" + - poetry config virtualenvs.path . + - poetry install + - poetry run mypy ./src ./tests + # Test Pydantic V2 - docker: fernapi/python-seed commands: - # The global python version is 3.8 # Tests now run a mock server, you can always run seed with --skip-scripts to save time - export NPM_CONFIG_CACHE="$(pwd)/.cache" - export HOME="$(pwd)/" diff --git a/seed/python-sdk/simple-fhir/src/seed/core/pydantic_utilities.py b/seed/python-sdk/simple-fhir/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/simple-fhir/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/simple-fhir/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/single-url-environment-default/src/seed/core/pydantic_utilities.py b/seed/python-sdk/single-url-environment-default/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/single-url-environment-default/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/single-url-environment-default/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/single-url-environment-no-default/src/seed/core/pydantic_utilities.py b/seed/python-sdk/single-url-environment-no-default/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/single-url-environment-no-default/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/single-url-environment-no-default/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/streaming-parameter/src/seed/core/pydantic_utilities.py b/seed/python-sdk/streaming-parameter/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/streaming-parameter/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/streaming-parameter/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/streaming/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/streaming/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/streaming/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/streaming/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/streaming/skip-pydantic-validation/src/seed/core/pydantic_utilities.py b/seed/python-sdk/streaming/skip-pydantic-validation/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/streaming/skip-pydantic-validation/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/streaming/skip-pydantic-validation/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/trace/reference.md b/seed/python-sdk/trace/reference.md index aa80b025c62..7d5c9ae09ce 100644 --- a/seed/python-sdk/trace/reference.md +++ b/seed/python-sdk/trace/reference.md @@ -147,7 +147,7 @@ client.admin.send_test_submission_update( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", ), update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), update_info=TestSubmissionUpdateInfo_Running(value="QUEUEING_SUBMISSION"), ) @@ -301,7 +301,7 @@ client.admin.send_workspace_submission_update( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", ), update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), update_info=WorkspaceSubmissionUpdateInfo_Running( value="QUEUEING_SUBMISSION" @@ -1048,10 +1048,10 @@ client = SeedTrace( client.playlist.create_playlist( service_param=1, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), optional_datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), name="string", problems=["string"], diff --git a/seed/python-sdk/trace/snippet.json b/seed/python-sdk/trace/snippet.json index f84343c4135..8d22f72bbd9 100644 --- a/seed/python-sdk/trace/snippet.json +++ b/seed/python-sdk/trace/snippet.json @@ -35,8 +35,8 @@ "identifier_override": "endpoint_admin.sendTestSubmissionUpdate" }, "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedTrace\nfrom seed.submission import TestSubmissionUpdateInfo_Running\n\nclient = SeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\nclient.admin.send_test_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n update_info=TestSubmissionUpdateInfo_Running(value=\"QUEUEING_SUBMISSION\"),\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedTrace\nfrom seed.submission import TestSubmissionUpdateInfo_Running\n\nclient = AsyncSeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -> None:\n await client.admin.send_test_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n update_info=TestSubmissionUpdateInfo_Running(\n value=\"QUEUEING_SUBMISSION\"\n ),\n )\n\n\nasyncio.run(main())\n", + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedTrace\nfrom seed.submission import TestSubmissionUpdateInfo_Running\n\nclient = SeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\nclient.admin.send_test_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n update_info=TestSubmissionUpdateInfo_Running(value=\"QUEUEING_SUBMISSION\"),\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedTrace\nfrom seed.submission import TestSubmissionUpdateInfo_Running\n\nclient = AsyncSeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -> None:\n await client.admin.send_test_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n update_info=TestSubmissionUpdateInfo_Running(\n value=\"QUEUEING_SUBMISSION\"\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -61,8 +61,8 @@ "identifier_override": "endpoint_admin.sendWorkspaceSubmissionUpdate" }, "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedTrace\nfrom seed.submission import WorkspaceSubmissionUpdateInfo_Running\n\nclient = SeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\nclient.admin.send_workspace_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n update_info=WorkspaceSubmissionUpdateInfo_Running(\n value=\"QUEUEING_SUBMISSION\"\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedTrace\nfrom seed.submission import WorkspaceSubmissionUpdateInfo_Running\n\nclient = AsyncSeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -> None:\n await client.admin.send_workspace_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n update_info=WorkspaceSubmissionUpdateInfo_Running(\n value=\"QUEUEING_SUBMISSION\"\n ),\n )\n\n\nasyncio.run(main())\n", + "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedTrace\nfrom seed.submission import WorkspaceSubmissionUpdateInfo_Running\n\nclient = SeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\nclient.admin.send_workspace_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n update_info=WorkspaceSubmissionUpdateInfo_Running(\n value=\"QUEUEING_SUBMISSION\"\n ),\n)\n", + "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedTrace\nfrom seed.submission import WorkspaceSubmissionUpdateInfo_Running\n\nclient = AsyncSeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -> None:\n await client.admin.send_workspace_submission_update(\n submission_id=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n update_time=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n update_info=WorkspaceSubmissionUpdateInfo_Running(\n value=\"QUEUEING_SUBMISSION\"\n ),\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, @@ -165,8 +165,8 @@ "identifier_override": "endpoint_playlist.createPlaylist" }, "snippet": { - "sync_client": "import datetime\n\nfrom seed import SeedTrace\n\nclient = SeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\nclient.playlist.create_playlist(\n service_param=1,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n optional_datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n name=\"string\",\n problems=[\"string\"],\n)\n", - "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedTrace\n\nclient = AsyncSeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -> None:\n await client.playlist.create_playlist(\n service_param=1,\n datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n optional_datetime=datetime.datetime.fromisoformat(\n \"datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'\",\n ),\n name=\"string\",\n problems=[\"string\"],\n )\n\n\nasyncio.run(main())\n", + "sync_client": "import datetime\n\nfrom seed import SeedTrace\n\nclient = SeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\nclient.playlist.create_playlist(\n service_param=1,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n optional_datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n name=\"string\",\n problems=[\"string\"],\n)\n", + "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedTrace\n\nclient = AsyncSeedTrace(\n x_random_header=\"YOUR_X_RANDOM_HEADER\",\n token=\"YOUR_TOKEN\",\n)\n\n\nasync def main() -> None:\n await client.playlist.create_playlist(\n service_param=1,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n optional_datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n name=\"string\",\n problems=[\"string\"],\n )\n\n\nasyncio.run(main())\n", "type": "python" } }, diff --git a/seed/python-sdk/trace/src/seed/admin/client.py b/seed/python-sdk/trace/src/seed/admin/client.py index beeda4b5ee9..1f6ad008067 100644 --- a/seed/python-sdk/trace/src/seed/admin/client.py +++ b/seed/python-sdk/trace/src/seed/admin/client.py @@ -125,7 +125,7 @@ def send_test_submission_update( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", ), update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), update_info=TestSubmissionUpdateInfo_Running(value="QUEUEING_SUBMISSION"), ) @@ -247,7 +247,7 @@ def send_workspace_submission_update( "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", ), update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), update_info=WorkspaceSubmissionUpdateInfo_Running( value="QUEUEING_SUBMISSION" @@ -805,7 +805,7 @@ async def main() -> None: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", ), update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), update_info=TestSubmissionUpdateInfo_Running( value="QUEUEING_SUBMISSION" @@ -943,7 +943,7 @@ async def main() -> None: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", ), update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), update_info=WorkspaceSubmissionUpdateInfo_Running( value="QUEUEING_SUBMISSION" diff --git a/seed/python-sdk/trace/src/seed/core/pydantic_utilities.py b/seed/python-sdk/trace/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/trace/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/trace/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/trace/src/seed/playlist/client.py b/seed/python-sdk/trace/src/seed/playlist/client.py index 0abd238a89c..931fd029f1c 100644 --- a/seed/python-sdk/trace/src/seed/playlist/client.py +++ b/seed/python-sdk/trace/src/seed/playlist/client.py @@ -72,10 +72,10 @@ def create_playlist( client.playlist.create_playlist( service_param=1, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), optional_datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), name="string", problems=["string"], @@ -431,10 +431,10 @@ async def main() -> None: await client.playlist.create_playlist( service_param=1, datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), optional_datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'", + "2024-01-15 09:30:00+00:00", ), name="string", problems=["string"], diff --git a/seed/python-sdk/trace/tests/test_admin.py b/seed/python-sdk/trace/tests/test_admin.py index 6fd36f90ee0..917b42f8039 100644 --- a/seed/python-sdk/trace/tests/test_admin.py +++ b/seed/python-sdk/trace/tests/test_admin.py @@ -47,9 +47,7 @@ async def test_send_test_submission_update(client: SeedTrace, async_client: Asyn assert ( client.admin.send_test_submission_update( submission_id=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), - update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + update_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), update_info=TestSubmissionUpdateInfo_Running(value="QUEUEING_SUBMISSION"), ) # type: ignore[func-returns-value] is None @@ -58,9 +56,7 @@ async def test_send_test_submission_update(client: SeedTrace, async_client: Asyn assert ( await async_client.admin.send_test_submission_update( submission_id=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), - update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + update_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), update_info=TestSubmissionUpdateInfo_Running(value="QUEUEING_SUBMISSION"), ) # type: ignore[func-returns-value] is None @@ -89,9 +85,7 @@ async def test_send_workspace_submission_update(client: SeedTrace, async_client: assert ( client.admin.send_workspace_submission_update( submission_id=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), - update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + update_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), update_info=WorkspaceSubmissionUpdateInfo_Running(value="QUEUEING_SUBMISSION"), ) # type: ignore[func-returns-value] is None @@ -100,9 +94,7 @@ async def test_send_workspace_submission_update(client: SeedTrace, async_client: assert ( await async_client.admin.send_workspace_submission_update( submission_id=uuid.UUID("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"), - update_time=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + update_time=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), update_info=WorkspaceSubmissionUpdateInfo_Running(value="QUEUEING_SUBMISSION"), ) # type: ignore[func-returns-value] is None diff --git a/seed/python-sdk/trace/tests/test_playlist.py b/seed/python-sdk/trace/tests/test_playlist.py index d05839a608b..e274df347cc 100644 --- a/seed/python-sdk/trace/tests/test_playlist.py +++ b/seed/python-sdk/trace/tests/test_playlist.py @@ -18,12 +18,8 @@ async def test_create_playlist(client: SeedTrace, async_client: AsyncSeedTrace) expected_types: typing.Any = {"playlist_id": None, "owner-id": None, "name": None, "problems": ("list", {0: None})} response = client.playlist.create_playlist( service_param=1, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), - optional_datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + optional_datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), name="string", problems=["string"], ) @@ -31,12 +27,8 @@ async def test_create_playlist(client: SeedTrace, async_client: AsyncSeedTrace) async_response = await async_client.playlist.create_playlist( service_param=1, - datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), - optional_datetime=datetime.datetime.fromisoformat( - "datetime=datetime.datetime(2024, 1, 15, 9, 30, tzinfo=TzInfo(UTC)) raw='2024-01-15T09:30:00Z'" - ), + datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), + optional_datetime=datetime.datetime.fromisoformat("2024-01-15 09:30:00+00:00"), name="string", problems=["string"], ) diff --git a/seed/python-sdk/undiscriminated-unions/src/seed/core/pydantic_utilities.py b/seed/python-sdk/undiscriminated-unions/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/undiscriminated-unions/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/undiscriminated-unions/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/unions/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/unions/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/unions/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/unions/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/unions/union-naming-v1/src/seed/core/pydantic_utilities.py b/seed/python-sdk/unions/union-naming-v1/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/unions/union-naming-v1/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/unions/union-naming-v1/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/unions/union-utils/src/seed/core/pydantic_utilities.py b/seed/python-sdk/unions/union-utils/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/unions/union-utils/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/unions/union-utils/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/unknown/src/seed/core/pydantic_utilities.py b/seed/python-sdk/unknown/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/unknown/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/unknown/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/validation/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/validation/no-custom-config/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/validation/no-custom-config/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/validation/no-custom-config/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/validation/with-defaults/src/seed/core/pydantic_utilities.py b/seed/python-sdk/validation/with-defaults/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/validation/with-defaults/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/validation/with-defaults/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/variables/src/seed/core/pydantic_utilities.py b/seed/python-sdk/variables/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/variables/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/variables/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/version-no-default/src/seed/core/pydantic_utilities.py b/seed/python-sdk/version-no-default/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/version-no-default/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/version-no-default/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/version/src/seed/core/pydantic_utilities.py b/seed/python-sdk/version/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/version/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/version/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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 diff --git a/seed/python-sdk/websocket/src/seed/core/pydantic_utilities.py b/seed/python-sdk/websocket/src/seed/core/pydantic_utilities.py index a0875ac256f..c14b4828025 100644 --- a/seed/python-sdk/websocket/src/seed/core/pydantic_utilities.py +++ b/seed/python-sdk/websocket/src/seed/core/pydantic_utilities.py @@ -97,15 +97,15 @@ class Config: @classmethod def model_construct( - cls: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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: type[Model], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any - ) -> Model: + 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