From 463e91ed3c1fb15c7c4ca059bf1db3044fac87db Mon Sep 17 00:00:00 2001 From: Armando Belardo <11140328+armandobelardo@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:55:19 -0500 Subject: [PATCH] improvement, python: make optional fields not required by default (#3041) make optional fields not required by default --- generators/python/sdk/CHANGELOG.md | 32 ++++++++++++++++--- generators/python/sdk/VERSION | 2 +- .../generators/sdk/custom_config.py | 1 + .../resources/service/types/response.py | 2 +- .../folder_b/resources/common/types/foo.py | 2 +- .../seed/resources/foo/types/filtered_type.py | 2 +- .../src/seed/types/importing_a.py | 2 +- .../commons/resources/types/types/metadata.py | 4 +-- .../seed/resources/types/types/directory.py | 4 +-- .../src/seed/resources/types/types/movie.py | 2 +- .../src/seed/resources/types/types/node.py | 4 +-- .../src/seed/resources/types/types/tree.py | 2 +- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- .../nested_object_with_optional_field.py | 4 +-- .../types/object_with_optional_field.py | 24 +++++++------- seed/python-sdk/object/src/seed/types/type.py | 2 +- .../resources/metadata/types/metadata.py | 2 +- .../resources/directory/types/directory.py | 4 +-- .../src/seed/types/node.py | 4 +-- .../src/seed/types/tree.py | 2 +- .../resources/dummy/types/stream_response.py | 2 +- .../commons/types/binary_tree_node_value.py | 4 +-- .../commons/types/binary_tree_value.py | 2 +- .../types/doubly_linked_list_node_value.py | 4 +-- .../commons/types/doubly_linked_list_value.py | 2 +- .../resources/commons/types/generic_value.py | 2 +- .../seed/resources/commons/types/list_type.py | 1 + .../types/singly_linked_list_node_value.py | 2 +- .../commons/types/singly_linked_list_value.py | 2 +- .../types/execution_session_response.py | 2 +- .../types/execution_session_state.py | 4 +-- .../get_execution_session_state_response.py | 2 +- .../types/get_submission_state_response.py | 2 +- .../types/get_trace_responses_page_request.py | 2 +- .../types/initialize_problem_request.py | 2 +- .../types/recorded_response_notification.py | 2 +- .../types/recording_response_notification.py | 4 +-- .../submission/types/stack_information.py | 2 +- .../submission/types/submit_request_v_2.py | 4 +-- .../types/test_case_non_hidden_grade.py | 4 +-- .../submission/types/trace_response.py | 6 ++-- .../submission/types/trace_response_v_2.py | 6 ++-- .../submission/types/trace_responses_page.py | 3 +- .../types/trace_responses_page_v_2.py | 3 +- .../submission/types/workspace_run_details.py | 4 +-- .../types/workspace_submit_request.py | 2 +- .../problem/types/function_implementation.py | 2 +- .../get_generated_test_case_file_request.py | 2 +- .../problem/types/test_case_expects.py | 2 +- .../resources/problem/types/test_case_v_2.py | 2 +- .../problem/types/function_implementation.py | 2 +- .../get_generated_test_case_file_request.py | 2 +- .../problem/types/test_case_expects.py | 2 +- .../resources/problem/types/test_case_v_2.py | 2 +- 65 files changed, 194 insertions(+), 166 deletions(-) diff --git a/generators/python/sdk/CHANGELOG.md b/generators/python/sdk/CHANGELOG.md index 49ff35e71b3..e7d480c4fb6 100644 --- a/generators/python/sdk/CHANGELOG.md +++ b/generators/python/sdk/CHANGELOG.md @@ -5,15 +5,39 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +- Improvement: The Python SDK generator now defaults to `require_optional_fields = False`. This means that any requests that have optional fields no longer require a user to input data (or a `None` value) in. + Example: + + ```python + # Previously: + def my_function(my_parameter: typing.Optional[str]): + pass + + my_function() # <--- This fails mypy + my_function(None) # <--- This is necessary + my_function("I work in both cases!") + ... + # Now: + def my_function(): + pass + + my_function() # <--- I no longer fail mypy + my_function(None) # <--- I still work + my_function("I work in both cases!") + ``` + ## [0.11.2] - 2024-02-21 -- Improvement (Beta): The Python generator now supports a configuration option called `improved_imports`. To enable - this configuration, just add the following to your generators.yml + +- Improvement (Beta): The Python generator now supports a configuration option called `improved_imports`. To enable + this configuration, just add the following to your generators.yml ```yaml - generators: + generators: - name: fernapi/fern-python-sdk ... - config: + config: improved_imports: true ``` diff --git a/generators/python/sdk/VERSION b/generators/python/sdk/VERSION index bc859cbd6d9..abbf0fe823a 100644 --- a/generators/python/sdk/VERSION +++ b/generators/python/sdk/VERSION @@ -1 +1 @@ -0.11.2 +0.11.2-rc0 diff --git a/generators/python/src/fern_python/generators/sdk/custom_config.py b/generators/python/src/fern_python/generators/sdk/custom_config.py index 4677eab02ff..8b8873fd6b8 100644 --- a/generators/python/src/fern_python/generators/sdk/custom_config.py +++ b/generators/python/src/fern_python/generators/sdk/custom_config.py @@ -11,6 +11,7 @@ class SdkPydanticModelCustomConfig(PydanticModelCustomConfig): smart_union: bool = True include_union_utils: bool = False wrapped_aliases: bool = False + require_optional_fields: bool = False class SDKCustomConfig(pydantic.BaseModel): diff --git a/seed/python-sdk/audiences/src/seed/resources/folder_a/resources/service/types/response.py b/seed/python-sdk/audiences/src/seed/resources/folder_a/resources/service/types/response.py index 95765f287d2..fc2c845d145 100644 --- a/seed/python-sdk/audiences/src/seed/resources/folder_a/resources/service/types/response.py +++ b/seed/python-sdk/audiences/src/seed/resources/folder_a/resources/service/types/response.py @@ -13,7 +13,7 @@ class Response(pydantic.BaseModel): - foo: typing.Optional[Foo] + foo: typing.Optional[Foo] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/audiences/src/seed/resources/folder_b/resources/common/types/foo.py b/seed/python-sdk/audiences/src/seed/resources/folder_b/resources/common/types/foo.py index 744d607bda3..e1a8766dfe2 100644 --- a/seed/python-sdk/audiences/src/seed/resources/folder_b/resources/common/types/foo.py +++ b/seed/python-sdk/audiences/src/seed/resources/folder_b/resources/common/types/foo.py @@ -13,7 +13,7 @@ class Foo(pydantic.BaseModel): - foo: typing.Optional[resources_folder_c_resources_common_types_foo_Foo] + foo: typing.Optional[resources_folder_c_resources_common_types_foo_Foo] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/audiences/src/seed/resources/foo/types/filtered_type.py b/seed/python-sdk/audiences/src/seed/resources/foo/types/filtered_type.py index 9201f65f93a..8ce55677779 100644 --- a/seed/python-sdk/audiences/src/seed/resources/foo/types/filtered_type.py +++ b/seed/python-sdk/audiences/src/seed/resources/foo/types/filtered_type.py @@ -12,7 +12,7 @@ class FilteredType(pydantic.BaseModel): - public_property: typing.Optional[str] + public_property: typing.Optional[str] = None private_property: int def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/circular-references/src/seed/types/importing_a.py b/seed/python-sdk/circular-references/src/seed/types/importing_a.py index 968f9b2fce2..ac0e753482c 100644 --- a/seed/python-sdk/circular-references/src/seed/types/importing_a.py +++ b/seed/python-sdk/circular-references/src/seed/types/importing_a.py @@ -13,7 +13,7 @@ class ImportingA(pydantic.BaseModel): - a: typing.Optional[A] + a: typing.Optional[A] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/examples/src/seed/resources/commons/resources/types/types/metadata.py b/seed/python-sdk/examples/src/seed/resources/commons/resources/types/types/metadata.py index 972591a1dd5..94fa45b149e 100644 --- a/seed/python-sdk/examples/src/seed/resources/commons/resources/types/types/metadata.py +++ b/seed/python-sdk/examples/src/seed/resources/commons/resources/types/types/metadata.py @@ -23,8 +23,8 @@ class Metadata(pydantic.BaseModel): """ id: str - data: typing.Optional[typing.Dict[str, str]] - json_string: typing.Optional[str] = pydantic.Field(alias="jsonString") + data: typing.Optional[typing.Dict[str, str]] = None + json_string: typing.Optional[str] = pydantic.Field(alias="jsonString", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/examples/src/seed/resources/types/types/directory.py b/seed/python-sdk/examples/src/seed/resources/types/types/directory.py index 2e29217dc77..8814f77ba86 100644 --- a/seed/python-sdk/examples/src/seed/resources/types/types/directory.py +++ b/seed/python-sdk/examples/src/seed/resources/types/types/directory.py @@ -41,8 +41,8 @@ class Directory(pydantic.BaseModel): """ name: str - files: typing.Optional[typing.List[File]] - directories: typing.Optional[typing.List[Directory]] + files: typing.Optional[typing.List[File]] = None + directories: typing.Optional[typing.List[Directory]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/examples/src/seed/resources/types/types/movie.py b/seed/python-sdk/examples/src/seed/resources/types/types/movie.py index a217a7346ea..72cccc035c9 100644 --- a/seed/python-sdk/examples/src/seed/resources/types/types/movie.py +++ b/seed/python-sdk/examples/src/seed/resources/types/types/movie.py @@ -33,7 +33,7 @@ class Movie(pydantic.BaseModel): rating: float = pydantic.Field(description="The rating scale is one to five stars") type: typing.Literal["movie"] tag: Tag - book: typing.Optional[str] + book: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/examples/src/seed/resources/types/types/node.py b/seed/python-sdk/examples/src/seed/resources/types/types/node.py index 44b7f2fd73a..0b9a2460042 100644 --- a/seed/python-sdk/examples/src/seed/resources/types/types/node.py +++ b/seed/python-sdk/examples/src/seed/resources/types/types/node.py @@ -43,8 +43,8 @@ class Node(pydantic.BaseModel): """ name: str - nodes: typing.Optional[typing.List[Node]] - trees: typing.Optional[typing.List[Tree]] + nodes: typing.Optional[typing.List[Node]] = None + trees: typing.Optional[typing.List[Tree]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/examples/src/seed/resources/types/types/tree.py b/seed/python-sdk/examples/src/seed/resources/types/types/tree.py index 3c1ccaa5ba1..b05194828de 100644 --- a/seed/python-sdk/examples/src/seed/resources/types/types/tree.py +++ b/seed/python-sdk/examples/src/seed/resources/types/types/tree.py @@ -29,7 +29,7 @@ class Tree(pydantic.BaseModel): ) """ - nodes: typing.Optional[typing.List[Node]] + nodes: typing.Optional[typing.List[Node]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py index 6b4a1ab145b..acf50c4ab21 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -13,8 +13,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_optional_field.py index c0ee0f11491..63852d3133b 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -13,18 +13,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py index 6b4a1ab145b..acf50c4ab21 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -13,8 +13,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py index c0ee0f11491..63852d3133b 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -13,18 +13,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_optional_field.py index d82a54d6e98..b14be47d534 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_optional_field.py @@ -13,8 +13,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_optional_field.py index f34c09bedd8..858303a4b5c 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_optional_field.py @@ -13,18 +13,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py index 6b4a1ab145b..acf50c4ab21 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -13,8 +13,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py index c0ee0f11491..63852d3133b 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -13,18 +13,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py index 6b4a1ab145b..acf50c4ab21 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -13,8 +13,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_optional_field.py index c0ee0f11491..63852d3133b 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -13,18 +13,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py index b87c5753661..1028ba391f7 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -10,8 +10,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_optional_field.py index bb3de32132e..d63a2b97842 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -10,18 +10,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py index 6b4a1ab145b..acf50c4ab21 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -13,8 +13,8 @@ class NestedObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject") + string: typing.Optional[str] = None + nested_object: typing.Optional[ObjectWithOptionalField] = pydantic.Field(alias="NestedObject", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_optional_field.py index c0ee0f11491..63852d3133b 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -13,18 +13,18 @@ class ObjectWithOptionalField(pydantic.BaseModel): - string: typing.Optional[str] - integer: typing.Optional[int] - long: typing.Optional[int] - double: typing.Optional[float] - bool: typing.Optional[bool] - datetime: typing.Optional[dt.datetime] - date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] - base_64: typing.Optional[str] = pydantic.Field(alias="base64") - list: typing.Optional[typing.List[str]] - set: typing.Optional[typing.Set[str]] - map: typing.Optional[typing.Dict[int, str]] + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long: typing.Optional[int] = None + double: typing.Optional[float] = None + bool: typing.Optional[bool] = None + datetime: typing.Optional[dt.datetime] = None + date: typing.Optional[dt.date] = None + uuid: typing.Optional[uuid.UUID] = None + base_64: typing.Optional[str] = pydantic.Field(alias="base64", default=None) + list: typing.Optional[typing.List[str]] = None + set: typing.Optional[typing.Set[str]] = None + map: typing.Optional[typing.Dict[int, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/object/src/seed/types/type.py b/seed/python-sdk/object/src/seed/types/type.py index be0cd127c9d..51e3695f0c1 100644 --- a/seed/python-sdk/object/src/seed/types/type.py +++ b/seed/python-sdk/object/src/seed/types/type.py @@ -73,7 +73,7 @@ class Type(pydantic.BaseModel): ten: typing.List[int] eleven: typing.Set[float] twelve: typing.Dict[str, bool] - thirteen: typing.Optional[int] + thirteen: typing.Optional[int] = None fourteen: typing.Any fifteen: typing.List[typing.List[int]] sixteen: typing.List[typing.Dict[str, int]] diff --git a/seed/python-sdk/objects-with-imports/src/seed/resources/commons/resources/metadata/types/metadata.py b/seed/python-sdk/objects-with-imports/src/seed/resources/commons/resources/metadata/types/metadata.py index c433052f13c..6c1ab4db253 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/resources/commons/resources/metadata/types/metadata.py +++ b/seed/python-sdk/objects-with-imports/src/seed/resources/commons/resources/metadata/types/metadata.py @@ -22,7 +22,7 @@ class Metadata(pydantic.BaseModel): """ id: str - data: typing.Optional[typing.Dict[str, str]] + data: typing.Optional[typing.Dict[str, str]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/objects-with-imports/src/seed/resources/file/resources/directory/types/directory.py b/seed/python-sdk/objects-with-imports/src/seed/resources/file/resources/directory/types/directory.py index 8d588ad010e..dd063496b6d 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/resources/file/resources/directory/types/directory.py +++ b/seed/python-sdk/objects-with-imports/src/seed/resources/file/resources/directory/types/directory.py @@ -44,8 +44,8 @@ class Directory(pydantic.BaseModel): """ name: str - files: typing.Optional[typing.List[File]] - directories: typing.Optional[typing.List[Directory]] + files: typing.Optional[typing.List[File]] = None + directories: typing.Optional[typing.List[Directory]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/objects-with-imports/src/seed/types/node.py b/seed/python-sdk/objects-with-imports/src/seed/types/node.py index 647e2b0ecd4..57dbefe358e 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/types/node.py +++ b/seed/python-sdk/objects-with-imports/src/seed/types/node.py @@ -28,8 +28,8 @@ class Node(pydantic.BaseModel): """ id: str - label: typing.Optional[str] - metadata: typing.Optional[Metadata] + label: typing.Optional[str] = None + metadata: typing.Optional[Metadata] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/objects-with-imports/src/seed/types/tree.py b/seed/python-sdk/objects-with-imports/src/seed/types/tree.py index be0fb320801..ef84b6f6635 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/types/tree.py +++ b/seed/python-sdk/objects-with-imports/src/seed/types/tree.py @@ -39,7 +39,7 @@ class Tree(pydantic.BaseModel): ) """ - nodes: typing.Optional[typing.List[Node]] + nodes: typing.Optional[typing.List[Node]] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/streaming/src/seed/resources/dummy/types/stream_response.py b/seed/python-sdk/streaming/src/seed/resources/dummy/types/stream_response.py index f3e8ef3cfc7..6e91c90ae5d 100644 --- a/seed/python-sdk/streaming/src/seed/resources/dummy/types/stream_response.py +++ b/seed/python-sdk/streaming/src/seed/resources/dummy/types/stream_response.py @@ -13,7 +13,7 @@ class StreamResponse(pydantic.BaseModel): id: str - name: typing.Optional[str] + name: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_value.py index 0ad8cd71288..370139482c1 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_value.py @@ -15,8 +15,8 @@ class BinaryTreeNodeValue(pydantic.BaseModel): node_id: NodeId = pydantic.Field(alias="nodeId") val: float - right: typing.Optional[NodeId] - left: typing.Optional[NodeId] + right: typing.Optional[NodeId] = None + left: typing.Optional[NodeId] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_value.py index a1ee78c3e26..38392e46cef 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_value.py @@ -14,7 +14,7 @@ class BinaryTreeValue(pydantic.BaseModel): - root: typing.Optional[NodeId] + root: typing.Optional[NodeId] = None nodes: typing.Dict[NodeId, BinaryTreeNodeValue] def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_value.py index 8e159e970d2..187c3deb99d 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_value.py @@ -15,8 +15,8 @@ class DoublyLinkedListNodeValue(pydantic.BaseModel): node_id: NodeId = pydantic.Field(alias="nodeId") val: float - next: typing.Optional[NodeId] - prev: typing.Optional[NodeId] + next: typing.Optional[NodeId] = None + prev: typing.Optional[NodeId] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_value.py index fb0995e211e..eb6dc5363ec 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_value.py @@ -14,7 +14,7 @@ class DoublyLinkedListValue(pydantic.BaseModel): - head: typing.Optional[NodeId] + head: typing.Optional[NodeId] = None nodes: typing.Dict[NodeId, DoublyLinkedListNodeValue] def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/generic_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/generic_value.py index e6e6658cc73..65d905feea5 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/generic_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/generic_value.py @@ -12,7 +12,7 @@ class GenericValue(pydantic.BaseModel): - stringified_type: typing.Optional[str] = pydantic.Field(alias="stringifiedType") + stringified_type: typing.Optional[str] = pydantic.Field(alias="stringifiedType", default=None) stringified_value: str = pydantic.Field(alias="stringifiedValue") def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/list_type.py b/seed/python-sdk/trace/src/seed/resources/commons/types/list_type.py index 42ec32771df..31fe4eb01d6 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/list_type.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/list_type.py @@ -17,6 +17,7 @@ class ListType(pydantic.BaseModel): value_type: VariableType = pydantic.Field(alias="valueType") is_fixed_length: typing.Optional[bool] = pydantic.Field( alias="isFixedLength", + default=None, description="Whether this list is fixed-size (for languages that supports fixed-size lists). Defaults to false.", ) diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_value.py index 7842f1e2559..61890ef7b8f 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_value.py @@ -15,7 +15,7 @@ class SinglyLinkedListNodeValue(pydantic.BaseModel): node_id: NodeId = pydantic.Field(alias="nodeId") val: float - next: typing.Optional[NodeId] + next: typing.Optional[NodeId] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_value.py index aef76c7af5f..eb2cfab2e86 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_value.py @@ -14,7 +14,7 @@ class SinglyLinkedListValue(pydantic.BaseModel): - head: typing.Optional[NodeId] + head: typing.Optional[NodeId] = None nodes: typing.Dict[NodeId, SinglyLinkedListNodeValue] def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_response.py index a5b90274e3a..2548adf1c35 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_response.py @@ -15,7 +15,7 @@ class ExecutionSessionResponse(pydantic.BaseModel): session_id: str = pydantic.Field(alias="sessionId") - execution_session_url: typing.Optional[str] = pydantic.Field(alias="executionSessionUrl") + execution_session_url: typing.Optional[str] = pydantic.Field(alias="executionSessionUrl", default=None) language: Language status: ExecutionSessionStatus diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_state.py b/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_state.py index c9f9d618474..4331948d780 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_state.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/execution_session_state.py @@ -14,12 +14,12 @@ class ExecutionSessionState(pydantic.BaseModel): - last_time_contacted: typing.Optional[str] = pydantic.Field(alias="lastTimeContacted") + last_time_contacted: typing.Optional[str] = pydantic.Field(alias="lastTimeContacted", default=None) session_id: str = pydantic.Field( alias="sessionId", description="The auto-generated session id. Formatted as a uuid." ) is_warm_instance: bool = pydantic.Field(alias="isWarmInstance") - aws_task_id: typing.Optional[str] = pydantic.Field(alias="awsTaskId") + aws_task_id: typing.Optional[str] = pydantic.Field(alias="awsTaskId", default=None) language: Language status: ExecutionSessionStatus diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/get_execution_session_state_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/get_execution_session_state_response.py index 287db0b430e..bea6262767e 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/get_execution_session_state_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/get_execution_session_state_response.py @@ -14,7 +14,7 @@ class GetExecutionSessionStateResponse(pydantic.BaseModel): states: typing.Dict[str, ExecutionSessionState] - num_warming_instances: typing.Optional[int] = pydantic.Field(alias="numWarmingInstances") + num_warming_instances: typing.Optional[int] = pydantic.Field(alias="numWarmingInstances", default=None) warming_session_ids: typing.List[str] = pydantic.Field(alias="warmingSessionIds") def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/get_submission_state_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/get_submission_state_response.py index 9a7e6dc9a36..f60c2bc3dac 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/get_submission_state_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/get_submission_state_response.py @@ -14,7 +14,7 @@ class GetSubmissionStateResponse(pydantic.BaseModel): - time_submitted: typing.Optional[dt.datetime] = pydantic.Field(alias="timeSubmitted") + time_submitted: typing.Optional[dt.datetime] = pydantic.Field(alias="timeSubmitted", default=None) submission: str language: Language submission_type_state: SubmissionTypeState = pydantic.Field(alias="submissionTypeState") diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/get_trace_responses_page_request.py b/seed/python-sdk/trace/src/seed/resources/submission/types/get_trace_responses_page_request.py index ee674636666..fb6647c4e43 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/get_trace_responses_page_request.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/get_trace_responses_page_request.py @@ -12,7 +12,7 @@ class GetTraceResponsesPageRequest(pydantic.BaseModel): - offset: typing.Optional[int] + offset: typing.Optional[int] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/initialize_problem_request.py b/seed/python-sdk/trace/src/seed/resources/submission/types/initialize_problem_request.py index a17fe27c251..bd11547ca9a 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/initialize_problem_request.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/initialize_problem_request.py @@ -14,7 +14,7 @@ class InitializeProblemRequest(pydantic.BaseModel): problem_id: ProblemId = pydantic.Field(alias="problemId") - problem_version: typing.Optional[int] = pydantic.Field(alias="problemVersion") + problem_version: typing.Optional[int] = pydantic.Field(alias="problemVersion", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_response_notification.py b/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_response_notification.py index 2f93874c469..6729d406dc0 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_response_notification.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_response_notification.py @@ -15,7 +15,7 @@ class RecordedResponseNotification(pydantic.BaseModel): submission_id: SubmissionId = pydantic.Field(alias="submissionId") trace_responses_size: int = pydantic.Field(alias="traceResponsesSize") - test_case_id: typing.Optional[str] = pydantic.Field(alias="testCaseId") + test_case_id: typing.Optional[str] = pydantic.Field(alias="testCaseId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/recording_response_notification.py b/seed/python-sdk/trace/src/seed/resources/submission/types/recording_response_notification.py index 5e1665b62bd..7e8a63e014f 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/recording_response_notification.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/recording_response_notification.py @@ -16,10 +16,10 @@ class RecordingResponseNotification(pydantic.BaseModel): submission_id: SubmissionId = pydantic.Field(alias="submissionId") - test_case_id: typing.Optional[str] = pydantic.Field(alias="testCaseId") + test_case_id: typing.Optional[str] = pydantic.Field(alias="testCaseId", default=None) line_number: int = pydantic.Field(alias="lineNumber") lightweight_stack_info: LightweightStackframeInformation = pydantic.Field(alias="lightweightStackInfo") - traced_file: typing.Optional[TracedFile] = pydantic.Field(alias="tracedFile") + traced_file: typing.Optional[TracedFile] = pydantic.Field(alias="tracedFile", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/stack_information.py b/seed/python-sdk/trace/src/seed/resources/submission/types/stack_information.py index b4fde6a9cb3..79dfde3602c 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/stack_information.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/stack_information.py @@ -14,7 +14,7 @@ class StackInformation(pydantic.BaseModel): num_stack_frames: int = pydantic.Field(alias="numStackFrames") - top_stack_frame: typing.Optional[StackFrame] = pydantic.Field(alias="topStackFrame") + top_stack_frame: typing.Optional[StackFrame] = pydantic.Field(alias="topStackFrame", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/submit_request_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/submit_request_v_2.py index 45f8d5b7248..6ba911336c1 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/submit_request_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/submit_request_v_2.py @@ -20,8 +20,8 @@ class SubmitRequestV2(pydantic.BaseModel): language: Language submission_files: typing.List[SubmissionFileInfo] = pydantic.Field(alias="submissionFiles") problem_id: ProblemId = pydantic.Field(alias="problemId") - problem_version: typing.Optional[int] = pydantic.Field(alias="problemVersion") - user_id: typing.Optional[str] = pydantic.Field(alias="userId") + problem_version: typing.Optional[int] = pydantic.Field(alias="problemVersion", default=None) + user_id: typing.Optional[str] = pydantic.Field(alias="userId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_non_hidden_grade.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_non_hidden_grade.py index 2f7147cef02..5c4181a3f9f 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_non_hidden_grade.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_non_hidden_grade.py @@ -15,8 +15,8 @@ class TestCaseNonHiddenGrade(pydantic.BaseModel): passed: bool - actual_result: typing.Optional[VariableValue] = pydantic.Field(alias="actualResult") - exception: typing.Optional[ExceptionV2] + actual_result: typing.Optional[VariableValue] = pydantic.Field(alias="actualResult", default=None) + exception: typing.Optional[ExceptionV2] = None stdout: str def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response.py index e24307fc0f9..33421d8d3b5 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response.py @@ -18,10 +18,10 @@ class TraceResponse(pydantic.BaseModel): submission_id: SubmissionId = pydantic.Field(alias="submissionId") line_number: int = pydantic.Field(alias="lineNumber") - return_value: typing.Optional[DebugVariableValue] = pydantic.Field(alias="returnValue") - expression_location: typing.Optional[ExpressionLocation] = pydantic.Field(alias="expressionLocation") + return_value: typing.Optional[DebugVariableValue] = pydantic.Field(alias="returnValue", default=None) + expression_location: typing.Optional[ExpressionLocation] = pydantic.Field(alias="expressionLocation", default=None) stack: StackInformation - stdout: typing.Optional[str] + stdout: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response_v_2.py index 8c26968c4a4..93f005c2868 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_response_v_2.py @@ -20,10 +20,10 @@ class TraceResponseV2(pydantic.BaseModel): submission_id: SubmissionId = pydantic.Field(alias="submissionId") line_number: int = pydantic.Field(alias="lineNumber") file: TracedFile - return_value: typing.Optional[DebugVariableValue] = pydantic.Field(alias="returnValue") - expression_location: typing.Optional[ExpressionLocation] = pydantic.Field(alias="expressionLocation") + return_value: typing.Optional[DebugVariableValue] = pydantic.Field(alias="returnValue", default=None) + expression_location: typing.Optional[ExpressionLocation] = pydantic.Field(alias="expressionLocation", default=None) stack: StackInformation - stdout: typing.Optional[str] + stdout: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page.py b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page.py index 3139c502003..c7c8d711b1f 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page.py @@ -14,10 +14,11 @@ class TraceResponsesPage(pydantic.BaseModel): offset: typing.Optional[int] = pydantic.Field( + default=None, description=( "If present, use this to load subseqent pages.\n" "The offset is the id of the next trace response to load.\n" - ) + ), ) trace_responses: typing.List[TraceResponse] = pydantic.Field(alias="traceResponses") diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page_v_2.py index bb4f0e2b7a0..84cd0a8bf13 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/trace_responses_page_v_2.py @@ -14,10 +14,11 @@ class TraceResponsesPageV2(pydantic.BaseModel): offset: typing.Optional[int] = pydantic.Field( + default=None, description=( "If present, use this to load subseqent pages.\n" "The offset is the id of the next trace response to load.\n" - ) + ), ) trace_responses: typing.List[TraceResponseV2] = pydantic.Field(alias="traceResponses") diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_run_details.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_run_details.py index bd17711dc4b..0c967a09e0f 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_run_details.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_run_details.py @@ -14,8 +14,8 @@ class WorkspaceRunDetails(pydantic.BaseModel): - exception_v_2: typing.Optional[ExceptionV2] = pydantic.Field(alias="exceptionV2") - exception: typing.Optional[ExceptionInfo] + exception_v_2: typing.Optional[ExceptionV2] = pydantic.Field(alias="exceptionV2", default=None) + exception: typing.Optional[ExceptionInfo] = None stdout: str def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submit_request.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submit_request.py index 7acd8ee579a..218f9ddf7b5 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submit_request.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submit_request.py @@ -18,7 +18,7 @@ class WorkspaceSubmitRequest(pydantic.BaseModel): submission_id: SubmissionId = pydantic.Field(alias="submissionId") language: Language submission_files: typing.List[SubmissionFileInfo] = pydantic.Field(alias="submissionFiles") - user_id: typing.Optional[str] = pydantic.Field(alias="userId") + user_id: typing.Optional[str] = pydantic.Field(alias="userId", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation.py index 2f754eb1f8d..24fba373621 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation.py @@ -13,7 +13,7 @@ class FunctionImplementation(pydantic.BaseModel): impl: str - imports: typing.Optional[str] + imports: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_file_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_file_request.py index d329382b583..2054002fef3 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_file_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_file_request.py @@ -14,7 +14,7 @@ class GetGeneratedTestCaseFileRequest(pydantic.BaseModel): - template: typing.Optional[TestCaseTemplate] + template: typing.Optional[TestCaseTemplate] = None test_case: TestCaseV2 = pydantic.Field(alias="testCase") def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_expects.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_expects.py index cf24ce6399e..e6bab4fa015 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_expects.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_expects.py @@ -12,7 +12,7 @@ class TestCaseExpects(pydantic.BaseModel): - expected_stdout: typing.Optional[str] = pydantic.Field(alias="expectedStdout") + expected_stdout: typing.Optional[str] = pydantic.Field(alias="expectedStdout", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_v_2.py index f599f16e0cc..10d1332ab0a 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_v_2.py @@ -20,7 +20,7 @@ class TestCaseV2(pydantic.BaseModel): metadata: TestCaseMetadata implementation: TestCaseImplementationReference arguments: typing.Dict[ParameterId, VariableValue] - expects: typing.Optional[TestCaseExpects] + expects: typing.Optional[TestCaseExpects] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation.py index 93233c53ce6..51682d8e881 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation.py @@ -13,7 +13,7 @@ class FunctionImplementation(pydantic.BaseModel): impl: str - imports: typing.Optional[str] + imports: typing.Optional[str] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_file_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_file_request.py index 4e9447577a3..7e8ce89cd45 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_file_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_file_request.py @@ -14,7 +14,7 @@ class GetGeneratedTestCaseFileRequest(pydantic.BaseModel): - template: typing.Optional[TestCaseTemplate] + template: typing.Optional[TestCaseTemplate] = None test_case: TestCaseV2 = pydantic.Field(alias="testCase") def json(self, **kwargs: typing.Any) -> str: diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_expects.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_expects.py index b584229ebf9..0e5afc67929 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_expects.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_expects.py @@ -12,7 +12,7 @@ class TestCaseExpects(pydantic.BaseModel): - expected_stdout: typing.Optional[str] = pydantic.Field(alias="expectedStdout") + expected_stdout: typing.Optional[str] = pydantic.Field(alias="expectedStdout", default=None) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_v_2.py index 1e8f40e32a9..15897cbc9eb 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_v_2.py @@ -20,7 +20,7 @@ class TestCaseV2(pydantic.BaseModel): metadata: TestCaseMetadata implementation: TestCaseImplementationReference arguments: typing.Dict[ParameterId, VariableValue] - expects: typing.Optional[TestCaseExpects] + expects: typing.Optional[TestCaseExpects] = None def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}