From 48a16a8757bb2ec7309c21fb564d4c13a64a642b Mon Sep 17 00:00:00 2001 From: Armando Belardo <11140328+armandobelardo@users.noreply.github.com> Date: Fri, 8 Mar 2024 16:21:01 -0500 Subject: [PATCH] feat, python: allow extra fields not specified in model to come through (#3131) --- generators/python/sdk/CHANGELOG.md | 29 + generators/python/sdk/VERSION | 2 +- .../external_dependencies/pydantic.py | 4 + .../generators/fastapi/fastapi_generator.py | 1 + .../pydantic_model/custom_config.py | 4 + .../fern_aware_pydantic_model.py | 2 +- .../pydantic_codegen/pydantic_model.py | 15 +- .../resources/ast/types/container_value.py | 6 +- .../object/types/object_with_map_of_map.py | 3 +- .../types/object_with_optional_field.py | 12 +- .../object/types/object_with_map_of_map.py | 3 +- .../types/object_with_optional_field.py | 12 +- .../object/types/object_with_map_of_map.py | 3 +- .../types/object_with_optional_field.py | 12 +- .../object/types/object_with_map_of_map.py | 3 +- .../types/object_with_optional_field.py | 12 +- seed/pydantic/alias/src/seed/alias/type.py | 1 + .../folder_a/resources/service/response.py | 1 + .../folder_b/resources/common/foo.py | 1 + .../folder_c/resources/common/foo.py | 1 + .../audiences/resources/foo/filtered_type.py | 1 + .../audiences/resources/foo/importing_type.py | 1 + .../errors/unauthorized_request_error_body.py | 1 + .../src/seed/api/importing_a.py | 1 + .../src/seed/api/resources/a/a.py | 6 + .../seed/api/resources/ast/object_value.py | 1 + .../src/seed/api/root_type.py | 1 + .../errors/unauthorized_request_error_body.py | 1 + .../errors/property_based_error_test_body.py | 1 + .../commons/resources/types/metadata.py | 1 + .../seed/examples/resources/types/actor.py | 1 + .../seed/examples/resources/types/actress.py | 1 + .../examples/resources/types/directory.py | 1 + .../resources/types/exception_info.py | 1 + .../resources/types/extended_movie.py | 6 + .../src/seed/examples/resources/types/file.py | 1 + .../seed/examples/resources/types/metadata.py | 1 + .../examples/resources/types/migration.py | 1 + .../seed/examples/resources/types/moment.py | 1 + .../seed/examples/resources/types/movie.py | 1 + .../src/seed/examples/resources/types/node.py | 1 + .../seed/examples/resources/types/request.py | 1 + .../seed/examples/resources/types/response.py | 1 + .../examples/resources/types/stunt_double.py | 1 + .../src/seed/examples/resources/types/tree.py | 1 + .../general_errors/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/object_with_map_of_map.py | 4 +- .../object/object_with_optional_field.py | 13 +- .../object/object_with_required_field.py | 1 + .../resources/types/resources/union/cat.py | 1 + .../resources/types/resources/union/dog.py | 1 + .../general_errors/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/object_with_map_of_map.py | 4 +- .../object/object_with_optional_field.py | 13 +- .../object/object_with_required_field.py | 1 + .../resources/types/resources/union/cat.py | 1 + .../resources/types/resources/union/dog.py | 1 + .../pydantic/extends/src/seed/extends/docs.py | 1 + .../extends/src/seed/extends/example_type.py | 6 + .../pydantic/extends/src/seed/extends/json.py | 6 + .../extends/src/seed/extends/nested_type.py | 6 + .../resources/service/my_object.py | 1 + .../resources/imdb/create_movie_request.py | 1 + .../imdb/src/seed/api/resources/imdb/movie.py | 1 + .../resources/reference/send_request.py | 1 + .../literal/src/seed/literal/send_response.py | 1 + seed/pydantic/object/src/seed/object/name.py | 1 + seed/pydantic/object/src/seed/object/type.py | 1 + .../src/seed/objects_with_imports/node.py | 1 + .../commons/resources/metadata/metadata.py | 1 + .../resources/file/file.py | 1 + .../file/resources/directory/directory.py | 1 + .../src/seed/objects_with_imports/tree.py | 1 + .../resources/user/nested_user.py | 1 + .../query_parameters/resources/user/user.py | 1 + .../nursery_api/resources/package/package.py | 1 + .../nursery_api/resources/package/record.py | 1 + .../resources/service/movie.py | 1 + .../resources/service/response.py | 6 + .../resources/service/with_docs.py | 1 + .../seed/response_property/string_response.py | 1 + .../seed/response_property/with_metadata.py | 1 + .../resources/dummy/stream_response.py | 1 + .../binary_tree_node_and_tree_value.py | 1 + .../commons/binary_tree_node_value.py | 1 + .../resources/commons/binary_tree_value.py | 1 + .../commons/debug_key_value_pairs.py | 1 + .../resources/commons/debug_map_value.py | 1 + .../doubly_linked_list_node_and_list_value.py | 1 + .../commons/doubly_linked_list_node_value.py | 1 + .../commons/doubly_linked_list_value.py | 1 + .../seed/trace/resources/commons/file_info.py | 1 + .../trace/resources/commons/generic_value.py | 1 + .../trace/resources/commons/key_value_pair.py | 1 + .../seed/trace/resources/commons/list_type.py | 1 + .../seed/trace/resources/commons/map_type.py | 1 + .../seed/trace/resources/commons/map_value.py | 1 + .../singly_linked_list_node_and_list_value.py | 1 + .../commons/singly_linked_list_node_value.py | 1 + .../commons/singly_linked_list_value.py | 1 + .../seed/trace/resources/commons/test_case.py | 1 + .../commons/test_case_with_expected_result.py | 1 + .../lang_server/lang_server_request.py | 1 + .../lang_server/lang_server_response.py | 1 + .../trace/resources/migration/migration.py | 1 + .../seed/trace/resources/playlist/playlist.py | 1 + .../playlist/playlist_create_request.py | 1 + .../playlist/update_playlist_request.py | 1 + .../problem/create_problem_request.py | 1 + .../problem/generic_create_problem_error.py | 1 + .../get_default_starter_files_response.py | 1 + .../resources/problem/problem_description.py | 1 + .../trace/resources/problem/problem_files.py | 1 + .../trace/resources/problem/problem_info.py | 1 + .../problem/update_problem_response.py | 1 + .../problem/variable_type_and_name.py | 1 + .../submission/building_executor_response.py | 1 + .../resources/submission/compile_error.py | 1 + .../custom_test_cases_unsupported.py | 1 + .../resources/submission/errored_response.py | 1 + .../resources/submission/exception_info.py | 1 + .../submission/execution_session_response.py | 1 + .../submission/execution_session_state.py | 1 + .../existing_submission_executing.py | 1 + .../submission/expression_location.py | 1 + .../resources/submission/finished_response.py | 1 + .../get_execution_session_state_response.py | 1 + .../get_submission_state_response.py | 1 + .../get_trace_responses_page_request.py | 1 + .../resources/submission/graded_response.py | 1 + .../submission/graded_response_v_2.py | 1 + .../submission/graded_test_case_update.py | 1 + .../submission/initialize_problem_request.py | 1 + .../resources/submission/internal_error.py | 1 + .../submission/invalid_request_response.py | 1 + .../lightweight_stackframe_information.py | 1 + .../recorded_response_notification.py | 1 + .../submission/recorded_test_case_update.py | 1 + .../recording_response_notification.py | 1 + .../resources/submission/running_response.py | 1 + .../resources/submission/runtime_error.py | 1 + .../seed/trace/resources/submission/scope.py | 1 + .../trace/resources/submission/stack_frame.py | 1 + .../resources/submission/stack_information.py | 1 + .../resources/submission/stderr_response.py | 1 + .../resources/submission/stdout_response.py | 1 + .../resources/submission/stop_request.py | 1 + .../resources/submission/stopped_response.py | 1 + .../submission/submission_file_info.py | 1 + .../submission/submission_id_not_found.py | 1 + .../submission/submit_request_v_2.py | 1 + .../submission/terminated_response.py | 1 + .../submission/test_case_hidden_grade.py | 1 + .../submission/test_case_non_hidden_grade.py | 1 + .../resources/submission/test_case_result.py | 1 + .../test_case_result_with_stdout.py | 1 + .../submission/test_submission_state.py | 1 + .../submission/test_submission_status_v_2.py | 1 + .../submission/test_submission_update.py | 1 + .../resources/submission/trace_response.py | 1 + .../submission/trace_response_v_2.py | 1 + .../submission/trace_responses_page.py | 1 + .../submission/trace_responses_page_v_2.py | 1 + .../trace/resources/submission/traced_file.py | 1 + .../resources/submission/traced_test_case.py | 1 + .../submission/unexpected_language_error.py | 1 + .../resources/submission/workspace_files.py | 1 + .../submission/workspace_ran_response.py | 1 + .../submission/workspace_run_details.py | 1 + .../workspace_starter_files_response.py | 1 + .../workspace_starter_files_response_v_2.py | 1 + .../submission/workspace_submission_state.py | 1 + .../workspace_submission_status_v_2.py | 1 + .../submission/workspace_submission_update.py | 1 + .../submission/workspace_submit_request.py | 1 + .../submission/workspace_traced_update.py | 1 + .../resources/problem/basic_custom_files.py | 1 + .../problem/basic_test_case_template.py | 1 + .../problem/create_problem_request_v_2.py | 1 + .../deep_equality_correctness_check.py | 1 + .../problem/default_provided_file.py | 1 + .../v_2/resources/problem/file_info_v_2.py | 1 + .../resources/v_2/resources/problem/files.py | 1 + .../problem/function_implementation.py | 1 + ...n_implementation_for_multiple_languages.py | 1 + .../v_2/resources/problem/generated_files.py | 1 + .../get_basic_solution_file_request.py | 1 + .../get_basic_solution_file_response.py | 1 + .../problem/get_function_signature_request.py | 1 + .../get_function_signature_response.py | 1 + .../get_generated_test_case_file_request.py | 1 + ...nerated_test_case_template_file_request.py | 1 + .../problem/lightweight_problem_info_v_2.py | 1 + .../problem/non_void_function_definition.py | 1 + .../problem/non_void_function_signature.py | 1 + .../v_2/resources/problem/parameter.py | 1 + .../v_2/resources/problem/problem_info_v_2.py | 1 + .../resources/problem/test_case_expects.py | 1 + .../problem/test_case_implementation.py | 1 + .../test_case_implementation_description.py | 1 + .../resources/problem/test_case_metadata.py | 1 + .../resources/problem/test_case_template.py | 1 + .../v_2/resources/problem/test_case_v_2.py | 1 + ..._case_with_actual_result_implementation.py | 1 + .../problem/void_function_definition.py | 1 + ...ion_definition_that_takes_actual_result.py | 1 + .../problem/void_function_signature.py | 1 + ...tion_signature_that_takes_actual_result.py | 1 + .../resources/problem/basic_custom_files.py | 1 + .../problem/basic_test_case_template.py | 1 + .../problem/create_problem_request_v_2.py | 1 + .../deep_equality_correctness_check.py | 1 + .../problem/default_provided_file.py | 1 + .../v_3/resources/problem/file_info_v_2.py | 1 + .../resources/v_3/resources/problem/files.py | 1 + .../problem/function_implementation.py | 1 + ...n_implementation_for_multiple_languages.py | 1 + .../v_3/resources/problem/generated_files.py | 1 + .../get_basic_solution_file_request.py | 1 + .../get_basic_solution_file_response.py | 1 + .../problem/get_function_signature_request.py | 1 + .../get_function_signature_response.py | 1 + .../get_generated_test_case_file_request.py | 1 + ...nerated_test_case_template_file_request.py | 1 + .../problem/lightweight_problem_info_v_2.py | 1 + .../problem/non_void_function_definition.py | 1 + .../problem/non_void_function_signature.py | 1 + .../v_3/resources/problem/parameter.py | 1 + .../v_3/resources/problem/problem_info_v_2.py | 1 + .../resources/problem/test_case_expects.py | 1 + .../problem/test_case_implementation.py | 1 + .../test_case_implementation_description.py | 1 + .../resources/problem/test_case_metadata.py | 1 + .../resources/problem/test_case_template.py | 1 + .../v_3/resources/problem/test_case_v_2.py | 1 + ..._case_with_actual_result_implementation.py | 1 + .../problem/void_function_definition.py | 1 + ...ion_definition_that_takes_actual_result.py | 1 + .../problem/void_function_signature.py | 1 + ...tion_signature_that_takes_actual_result.py | 1 + .../src/seed/unions/resources/types/bar.py | 1 + .../src/seed/unions/resources/types/foo.py | 1 + .../types/union_with_base_properties.py | 1 + .../resources/types/union_with_literal.py | 1 + .../src/seed/unions/resources/union/circle.py | 1 + .../resources/union/get_shape_request.py | 1 + .../src/seed/unions/resources/union/shape.py | 1 + .../src/seed/unions/resources/union/square.py | 1 + .../resources/unknown/my_object.py | 1 + seed/python-sdk/alias/src/seed/types/type.py | 1 + .../resources/service/types/response.py | 1 + .../folder_b/resources/common/types/foo.py | 1 + .../folder_c/resources/common/types/foo.py | 1 + .../seed/resources/foo/types/filtered_type.py | 1 + .../resources/foo/types/importing_type.py | 1 + .../types/unauthorized_request_error_body.py | 1 + .../src/seed/resources/a/types/a.py | 6 + .../seed/resources/ast/types/object_value.py | 1 + .../src/seed/types/importing_a.py | 1 + .../src/seed/types/root_type.py | 1 + .../types/unauthorized_request_error_body.py | 1 + .../types/property_based_error_test_body.py | 1 + .../commons/resources/types/types/metadata.py | 1 + .../src/seed/resources/types/types/actor.py | 1 + .../src/seed/resources/types/types/actress.py | 1 + .../seed/resources/types/types/directory.py | 1 + .../resources/types/types/exception_info.py | 1 + .../resources/types/types/extended_movie.py | 6 + .../src/seed/resources/types/types/file.py | 1 + .../seed/resources/types/types/metadata.py | 1 + .../seed/resources/types/types/migration.py | 1 + .../src/seed/resources/types/types/moment.py | 1 + .../src/seed/resources/types/types/movie.py | 1 + .../src/seed/resources/types/types/node.py | 1 + .../src/seed/resources/types/types/request.py | 1 + .../seed/resources/types/types/response.py | 1 + .../resources/types/types/stunt_double.py | 1 + .../src/seed/resources/types/types/tree.py | 1 + .../commons/resources/types/types/metadata.py | 1 + .../src/seed/resources/types/types/actor.py | 1 + .../src/seed/resources/types/types/actress.py | 1 + .../seed/resources/types/types/directory.py | 1 + .../resources/types/types/exception_info.py | 1 + .../resources/types/types/extended_movie.py | 6 + .../src/seed/resources/types/types/file.py | 1 + .../seed/resources/types/types/metadata.py | 1 + .../seed/resources/types/types/migration.py | 1 + .../src/seed/resources/types/types/moment.py | 1 + .../src/seed/resources/types/types/movie.py | 1 + .../src/seed/resources/types/types/node.py | 1 + .../src/seed/resources/types/types/request.py | 1 + .../seed/resources/types/types/response.py | 1 + .../resources/types/types/stunt_double.py | 1 + .../src/seed/resources/types/types/tree.py | 1 + .../exhaustive/additional_init_exports | 2 +- .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../types/resources/union/types/cat.py | 1 + .../types/resources/union/types/dog.py | 1 + .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../types/resources/union/types/cat.py | 1 + .../types/resources/union/types/dog.py | 1 + .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../src/seed/types/union/types/cat.py | 1 + .../src/seed/types/union/types/dog.py | 1 + .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../types/resources/union/types/cat.py | 1 + .../types/resources/union/types/dog.py | 1 + .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../types/resources/union/types/cat.py | 1 + .../types/resources/union/types/dog.py | 1 + .../.github/workflows/ci.yml | 36 + .../pydantic-extra-fields/.gitignore | 4 + .../pydantic-extra-fields/README.md | 0 .../pydantic-extra-fields/pyproject.toml | 23 + .../pydantic-extra-fields/snippet.json | 0 .../src/seed/__init__.py | 25 + .../pydantic-extra-fields/src/seed/client.py | 94 +++ .../src/seed/core/__init__.py | 25 + .../src/seed/core/api_error.py | 15 + .../src/seed/core/client_wrapper.py | 57 ++ .../src/seed/core/datetime_utils.py | 28 + .../src/seed/core/file.py | 38 + .../src/seed/core/http_client.py | 125 +++ .../src/seed/core/jsonable_encoder.py | 103 +++ .../src/seed/core/remove_none_from_dict.py | 11 + .../src/seed/core/request_options.py | 32 + .../pydantic-extra-fields/src/seed/py.typed | 0 .../src/seed/resources/__init__.py | 16 + .../src/seed/resources/endpoints/__init__.py | 5 + .../src/seed/resources/endpoints/client.py | 34 + .../resources/endpoints/resources/__init__.py | 5 + .../endpoints/resources/container/__init__.py | 2 + .../endpoints/resources/container/client.py | 656 +++++++++++++++ .../endpoints/resources/enum/__init__.py | 2 + .../endpoints/resources/enum/client.py | 106 +++ .../resources/http_methods/__init__.py | 2 + .../resources/http_methods/client.py | 437 ++++++++++ .../endpoints/resources/object/__init__.py | 2 + .../endpoints/resources/object/client.py | 576 ++++++++++++++ .../endpoints/resources/params/__init__.py | 2 + .../endpoints/resources/params/client.py | 499 ++++++++++++ .../endpoints/resources/primitive/__init__.py | 2 + .../endpoints/resources/primitive/client.py | 753 ++++++++++++++++++ .../endpoints/resources/union/__init__.py | 2 + .../endpoints/resources/union/client.py | 116 +++ .../seed/resources/general_errors/__init__.py | 6 + .../general_errors/errors/__init__.py | 5 + .../general_errors/errors/bad_request_body.py | 9 + .../general_errors/types/__init__.py | 5 + .../types/bad_object_request_info.py | 29 + .../resources/inlined_requests/__init__.py | 2 + .../seed/resources/inlined_requests/client.py | 144 ++++ .../src/seed/resources/no_auth/__init__.py | 2 + .../src/seed/resources/no_auth/client.py | 125 +++ .../seed/resources/no_req_body/__init__.py | 2 + .../src/seed/resources/no_req_body/client.py | 169 ++++ .../resources/req_with_headers/__init__.py | 2 + .../seed/resources/req_with_headers/client.py | 122 +++ .../src/seed/resources/types/__init__.py | 47 ++ .../resources/types/resources/__init__.py | 39 + .../types/resources/enum/__init__.py | 6 + .../types/resources/enum/errors/__init__.py | 5 + .../enum/errors/error_with_enum_body.py | 9 + .../types/resources/enum/types/__init__.py | 5 + .../resources/enum/types/weather_report.py | 29 + .../types/resources/object/__init__.py | 27 + .../types/resources/object/errors/__init__.py | 13 + ...nested_object_with_optional_field_error.py | 9 + ...nested_object_with_required_field_error.py | 9 + .../object_with_optional_field_error.py | 9 + .../object_with_required_field_error.py | 9 + .../types/resources/object/types/__init__.py | 15 + .../nested_object_with_optional_field.py | 32 + .../nested_object_with_required_field.py | 32 + .../object/types/object_with_map_of_map.py | 30 + .../types/object_with_optional_field.py | 42 + .../types/object_with_required_field.py | 29 + .../types/resources/union/__init__.py | 6 + .../types/resources/union/errors/__init__.py | 5 + .../union/errors/error_with_union_body.py | 9 + .../types/resources/union/types/__init__.py | 7 + .../types/resources/union/types/animal.py | 29 + .../types/resources/union/types/cat.py | 31 + .../types/resources/union/types/dog.py | 31 + .../pydantic-extra-fields/tests/__init__.py | 0 .../tests/test_client.py | 6 + .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../types/resources/union/types/cat.py | 1 + .../types/resources/union/types/dog.py | 1 + .../types/bad_object_request_info.py | 1 + .../nested_object_with_optional_field.py | 1 + .../nested_object_with_required_field.py | 1 + .../object/types/object_with_map_of_map.py | 4 +- .../types/object_with_optional_field.py | 13 +- .../types/object_with_required_field.py | 1 + .../types/resources/union/types/animal.py | 1 + .../types/resources/union/types/cat.py | 1 + .../types/resources/union/types/dog.py | 1 + .../python-sdk/extends/src/seed/types/docs.py | 1 + .../extends/src/seed/types/example_type.py | 6 + .../python-sdk/extends/src/seed/types/json.py | 6 + .../extends/src/seed/types/nested_type.py | 6 + .../seed/resources/service/types/my_object.py | 1 + .../imdb/types/create_movie_request.py | 1 + .../src/seed/resources/imdb/types/movie.py | 1 + .../resources/reference/types/send_request.py | 1 + .../literal/src/seed/types/send_response.py | 1 + seed/python-sdk/object/src/seed/types/name.py | 1 + seed/python-sdk/object/src/seed/types/type.py | 1 + .../resources/metadata/types/metadata.py | 1 + .../resources/directory/types/directory.py | 1 + .../src/seed/resources/file/types/file.py | 1 + .../src/seed/types/node.py | 1 + .../src/seed/types/tree.py | 1 + .../seed/resources/user/types/nested_user.py | 1 + .../src/seed/resources/user/types/user.py | 1 + .../seed/resources/package/types/package.py | 1 + .../seed/resources/package/types/record.py | 1 + seed/python-sdk/seed.yml | 4 + .../resources/dummy/types/stream_response.py | 1 + .../types/binary_tree_node_and_tree_value.py | 1 + .../commons/types/binary_tree_node_value.py | 1 + .../commons/types/binary_tree_value.py | 1 + .../commons/types/debug_key_value_pairs.py | 1 + .../commons/types/debug_map_value.py | 1 + .../doubly_linked_list_node_and_list_value.py | 1 + .../types/doubly_linked_list_node_value.py | 1 + .../commons/types/doubly_linked_list_value.py | 1 + .../seed/resources/commons/types/file_info.py | 1 + .../resources/commons/types/generic_value.py | 1 + .../resources/commons/types/key_value_pair.py | 1 + .../seed/resources/commons/types/list_type.py | 1 + .../seed/resources/commons/types/map_type.py | 1 + .../seed/resources/commons/types/map_value.py | 1 + .../singly_linked_list_node_and_list_value.py | 1 + .../types/singly_linked_list_node_value.py | 1 + .../commons/types/singly_linked_list_value.py | 1 + .../seed/resources/commons/types/test_case.py | 1 + .../types/test_case_with_expected_result.py | 1 + .../lang_server/types/lang_server_request.py | 1 + .../lang_server/types/lang_server_response.py | 1 + .../resources/migration/types/migration.py | 1 + .../seed/resources/playlist/types/playlist.py | 1 + .../playlist/types/playlist_create_request.py | 1 + .../playlist/types/update_playlist_request.py | 1 + .../problem/types/create_problem_request.py | 1 + .../types/generic_create_problem_error.py | 1 + .../get_default_starter_files_response.py | 1 + .../problem/types/problem_description.py | 1 + .../resources/problem/types/problem_files.py | 1 + .../resources/problem/types/problem_info.py | 1 + .../problem/types/update_problem_response.py | 1 + .../problem/types/variable_type_and_name.py | 1 + .../types/building_executor_response.py | 1 + .../submission/types/compile_error.py | 1 + .../types/custom_test_cases_unsupported.py | 1 + .../submission/types/errored_response.py | 1 + .../submission/types/exception_info.py | 1 + .../types/execution_session_response.py | 1 + .../types/execution_session_state.py | 1 + .../types/existing_submission_executing.py | 1 + .../submission/types/expression_location.py | 1 + .../submission/types/finished_response.py | 1 + .../get_execution_session_state_response.py | 1 + .../types/get_submission_state_response.py | 1 + .../types/get_trace_responses_page_request.py | 1 + .../submission/types/graded_response.py | 1 + .../submission/types/graded_response_v_2.py | 1 + .../types/graded_test_case_update.py | 1 + .../types/initialize_problem_request.py | 1 + .../submission/types/internal_error.py | 1 + .../types/invalid_request_response.py | 1 + .../lightweight_stackframe_information.py | 1 + .../types/recorded_response_notification.py | 1 + .../types/recorded_test_case_update.py | 1 + .../types/recording_response_notification.py | 1 + .../submission/types/running_response.py | 1 + .../submission/types/runtime_error.py | 1 + .../seed/resources/submission/types/scope.py | 1 + .../resources/submission/types/stack_frame.py | 1 + .../submission/types/stack_information.py | 1 + .../submission/types/stderr_response.py | 1 + .../submission/types/stdout_response.py | 1 + .../submission/types/stop_request.py | 1 + .../submission/types/stopped_response.py | 1 + .../submission/types/submission_file_info.py | 1 + .../types/submission_id_not_found.py | 1 + .../submission/types/submit_request_v_2.py | 1 + .../submission/types/terminated_response.py | 1 + .../types/test_case_hidden_grade.py | 1 + .../types/test_case_non_hidden_grade.py | 1 + .../submission/types/test_case_result.py | 1 + .../types/test_case_result_with_stdout.py | 1 + .../submission/types/test_submission_state.py | 1 + .../types/test_submission_status_v_2.py | 1 + .../types/test_submission_update.py | 1 + .../submission/types/trace_response.py | 1 + .../submission/types/trace_response_v_2.py | 1 + .../submission/types/trace_responses_page.py | 1 + .../types/trace_responses_page_v_2.py | 1 + .../resources/submission/types/traced_file.py | 1 + .../submission/types/traced_test_case.py | 1 + .../types/unexpected_language_error.py | 1 + .../submission/types/workspace_files.py | 1 + .../types/workspace_ran_response.py | 1 + .../submission/types/workspace_run_details.py | 1 + .../types/workspace_starter_files_response.py | 1 + .../workspace_starter_files_response_v_2.py | 1 + .../types/workspace_submission_state.py | 1 + .../types/workspace_submission_status_v_2.py | 1 + .../types/workspace_submission_update.py | 1 + .../types/workspace_submit_request.py | 1 + .../types/workspace_traced_update.py | 1 + .../problem/types/basic_custom_files.py | 1 + .../problem/types/basic_test_case_template.py | 1 + .../types/create_problem_request_v_2.py | 1 + .../types/deep_equality_correctness_check.py | 1 + .../problem/types/default_provided_file.py | 1 + .../resources/problem/types/file_info_v_2.py | 1 + .../v_2/resources/problem/types/files.py | 1 + .../problem/types/function_implementation.py | 1 + ...n_implementation_for_multiple_languages.py | 1 + .../problem/types/generated_files.py | 1 + .../types/get_basic_solution_file_request.py | 1 + .../types/get_basic_solution_file_response.py | 1 + .../types/get_function_signature_request.py | 1 + .../types/get_function_signature_response.py | 1 + .../get_generated_test_case_file_request.py | 1 + ...nerated_test_case_template_file_request.py | 1 + .../types/lightweight_problem_info_v_2.py | 1 + .../types/non_void_function_definition.py | 1 + .../types/non_void_function_signature.py | 1 + .../v_2/resources/problem/types/parameter.py | 1 + .../problem/types/problem_info_v_2.py | 1 + .../problem/types/test_case_expects.py | 1 + .../problem/types/test_case_implementation.py | 1 + .../test_case_implementation_description.py | 1 + .../problem/types/test_case_metadata.py | 1 + .../problem/types/test_case_template.py | 1 + .../resources/problem/types/test_case_v_2.py | 1 + ..._case_with_actual_result_implementation.py | 1 + .../problem/types/void_function_definition.py | 1 + ...ion_definition_that_takes_actual_result.py | 1 + .../problem/types/void_function_signature.py | 1 + ...tion_signature_that_takes_actual_result.py | 1 + .../problem/types/basic_custom_files.py | 1 + .../problem/types/basic_test_case_template.py | 1 + .../types/create_problem_request_v_2.py | 1 + .../types/deep_equality_correctness_check.py | 1 + .../problem/types/default_provided_file.py | 1 + .../resources/problem/types/file_info_v_2.py | 1 + .../v_3/resources/problem/types/files.py | 1 + .../problem/types/function_implementation.py | 1 + ...n_implementation_for_multiple_languages.py | 1 + .../problem/types/generated_files.py | 1 + .../types/get_basic_solution_file_request.py | 1 + .../types/get_basic_solution_file_response.py | 1 + .../types/get_function_signature_request.py | 1 + .../types/get_function_signature_response.py | 1 + .../get_generated_test_case_file_request.py | 1 + ...nerated_test_case_template_file_request.py | 1 + .../types/lightweight_problem_info_v_2.py | 1 + .../types/non_void_function_definition.py | 1 + .../types/non_void_function_signature.py | 1 + .../v_3/resources/problem/types/parameter.py | 1 + .../problem/types/problem_info_v_2.py | 1 + .../problem/types/test_case_expects.py | 1 + .../problem/types/test_case_implementation.py | 1 + .../test_case_implementation_description.py | 1 + .../problem/types/test_case_metadata.py | 1 + .../problem/types/test_case_template.py | 1 + .../resources/problem/types/test_case_v_2.py | 1 + ..._case_with_actual_result_implementation.py | 1 + .../problem/types/void_function_definition.py | 1 + ...ion_definition_that_takes_actual_result.py | 1 + .../problem/types/void_function_signature.py | 1 + ...tion_signature_that_takes_actual_result.py | 1 + .../src/seed/resources/types/types/bar.py | 1 + .../src/seed/resources/types/types/foo.py | 1 + .../types/types/union_with_base_properties.py | 1 + .../types/types/union_with_literal.py | 1 + .../src/seed/resources/union/types/circle.py | 1 + .../union/types/get_shape_request.py | 1 + .../src/seed/resources/union/types/shape.py | 1 + .../src/seed/resources/union/types/square.py | 1 + .../seed/resources/unknown/types/my_object.py | 1 + 620 files changed, 5724 insertions(+), 101 deletions(-) create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/.github/workflows/ci.yml create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/.gitignore create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/README.md create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/pyproject.toml create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/api_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/client_wrapper.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/datetime_utils.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/file.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/http_client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/jsonable_encoder.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/remove_none_from_dict.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/request_options.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/py.typed create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/bad_request_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/bad_object_request_info.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/client.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/error_with_enum_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/weather_report.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_optional_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_required_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_optional_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_required_field_error.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_map_of_map.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_optional_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_required_field.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/error_with_union_body.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/animal.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/cat.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/dog.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/tests/__init__.py create mode 100644 seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_client.py diff --git a/generators/python/sdk/CHANGELOG.md b/generators/python/sdk/CHANGELOG.md index 30f058d6d88..ed913e3b452 100644 --- a/generators/python/sdk/CHANGELOG.md +++ b/generators/python/sdk/CHANGELOG.md @@ -5,6 +5,35 @@ 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). +## [0.11.10] - 2024-03-08 + +- feature: Expose a feature flag to pass through additional properties not specified within your pydantic model from your SDK. This allows for easier forward compatibility should your SDK drift behind your spec. + + Config: + + ```yaml + generators: + - name: fernapi/fern-python-sdk + ... + config: + pydantic_config: + extra_fields: "allow" + ``` + + Example generated code: + + ```python + # my_object.py + class MyObject(pydantic.BaseModel): + string: typing.Optional[str] = None + ... + + # main.py + o = pydantic.parse_obj_as(MyObject, {"string": "string", "my_new_property": "custom_value"}) + + print(o.my_new_property) # <--- "custom_value" + ``` + ## [0.11.9] - 2024-03-04 - chore: Use docstrings instead of Pydantic field descriptions. This is meant to be a cleanliness change. diff --git a/generators/python/sdk/VERSION b/generators/python/sdk/VERSION index 24b197ac924..0521cad14b0 100644 --- a/generators/python/sdk/VERSION +++ b/generators/python/sdk/VERSION @@ -1 +1 @@ -0.11.9 +0.11.10 diff --git a/generators/python/src/fern_python/external_dependencies/pydantic.py b/generators/python/src/fern_python/external_dependencies/pydantic.py index 26588b12269..63239c3dd5e 100644 --- a/generators/python/src/fern_python/external_dependencies/pydantic.py +++ b/generators/python/src/fern_python/external_dependencies/pydantic.py @@ -74,6 +74,10 @@ class Extra: def forbid(version: PydanticVersionCompatibility) -> AST.Expression: return AST.Expression(_export(version, "Extra", "forbid")) + @staticmethod + def allow(version: PydanticVersionCompatibility) -> AST.Expression: + return AST.Expression(_export(version, "Extra", "allow")) + @staticmethod def root_validator(version: PydanticVersionCompatibility, pre: bool = False) -> AST.FunctionInvocation: return AST.FunctionInvocation( diff --git a/generators/python/src/fern_python/generators/fastapi/fastapi_generator.py b/generators/python/src/fern_python/generators/fastapi/fastapi_generator.py index 5a1123a576c..16ea99b68ff 100644 --- a/generators/python/src/fern_python/generators/fastapi/fastapi_generator.py +++ b/generators/python/src/fern_python/generators/fastapi/fastapi_generator.py @@ -55,6 +55,7 @@ def run( custom_config = FastAPICustomConfig.parse_obj(generator_config.custom_config or {}) self._pydantic_model_custom_config = PydanticModelCustomConfig( forbid_extra_fields=True, + extra_fields="forbid", wrapped_aliases=True, include_union_utils=True, include_validators=custom_config.include_validators, diff --git a/generators/python/src/fern_python/generators/pydantic_model/custom_config.py b/generators/python/src/fern_python/generators/pydantic_model/custom_config.py index 33657e5f678..84de07fc208 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/custom_config.py +++ b/generators/python/src/fern_python/generators/pydantic_model/custom_config.py @@ -1,3 +1,5 @@ +from typing import Literal, Optional + import pydantic from ...external_dependencies.pydantic import PydanticVersionCompatibility @@ -13,7 +15,9 @@ class BasePydanticModelCustomConfig(pydantic.BaseModel): class PydanticModelCustomConfig(BasePydanticModelCustomConfig): include_validators: bool = False + # DEPRECATED: use `extra_fields` instead forbid_extra_fields: bool = False + extra_fields: Optional[Literal["allow", "forbid"]] = "allow" wrapped_aliases: bool = False skip_formatting: bool = False include_union_utils: bool = False diff --git a/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py b/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py index 66bddb2a2db..ae2aa5585f4 100644 --- a/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py +++ b/generators/python/src/fern_python/generators/pydantic_model/fern_aware_pydantic_model.py @@ -61,7 +61,7 @@ def __init__( else None, docstring=docstring, snippet=snippet, - forbid_extra_fields=custom_config.forbid_extra_fields, + extra_fields="forbid" if custom_config.forbid_extra_fields else custom_config.extra_fields, frozen=custom_config.frozen, orm_mode=custom_config.orm_mode, smart_union=custom_config.smart_union, diff --git a/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py b/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py index f3f86d6ddf1..02109b3c7e9 100644 --- a/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py +++ b/generators/python/src/fern_python/pydantic_codegen/pydantic_model.py @@ -2,7 +2,7 @@ import dataclasses from types import TracebackType -from typing import Iterable, List, Optional, Sequence, Tuple, Type, Union +from typing import Iterable, List, Literal, Optional, Sequence, Tuple, Type, Union from fern_python.codegen import AST, ClassParent, LocalClassReference, SourceFile from fern_python.external_dependencies import Pydantic, PydanticVersionCompatibility @@ -33,7 +33,7 @@ def __init__( parent: ClassParent = None, docstring: Optional[str] = None, snippet: Optional[str] = None, - forbid_extra_fields: bool = False, + extra_fields: Optional[Literal["allow", "forbid"]] = None, ): self._source_file = source_file self._class_declaration = AST.ClassDeclaration( @@ -50,7 +50,7 @@ def __init__( self._version = version self._root_type: Optional[AST.TypeHint] = None self._fields: List[PydanticField] = [] - self._forbid_extra_fields = forbid_extra_fields + self._extra_fields = extra_fields self._frozen = frozen self._orm_mode = orm_mode self._smart_union = smart_union @@ -306,13 +306,20 @@ def _add_config_class(self) -> None: ) ) - if self._forbid_extra_fields: + if self._extra_fields == "forbid": config.add_class_var( AST.VariableDeclaration( name="extra", initializer=Pydantic.Extra.forbid(self._version), ) ) + elif self._extra_fields == "allow": + config.add_class_var( + AST.VariableDeclaration( + name="extra", + initializer=Pydantic.Extra.allow(self._version), + ) + ) if len(self.json_encoders) > 0: config.add_class_var( diff --git a/seed/fastapi/circular-references/resources/ast/types/container_value.py b/seed/fastapi/circular-references/resources/ast/types/container_value.py index fd2a7d37837..d27db3d56fc 100644 --- a/seed/fastapi/circular-references/resources/ast/types/container_value.py +++ b/seed/fastapi/circular-references/resources/ast/types/container_value.py @@ -16,7 +16,7 @@ class _Factory: - def list(self, value: typing.List[FieldValue]) -> ContainerValue: + def list_(self, value: typing.List[FieldValue]) -> ContainerValue: return ContainerValue(__root__=_ContainerValue.List(type="list", value=value)) def optional(self, value: typing.Optional[FieldValue]) -> ContainerValue: @@ -31,11 +31,11 @@ def get_as_union(self) -> typing.Union[_ContainerValue.List, _ContainerValue.Opt def visit( self, - list: typing.Callable[[typing.List[FieldValue]], T_Result], + list_: typing.Callable[[typing.List[FieldValue]], T_Result], optional: typing.Callable[[typing.Optional[FieldValue]], T_Result], ) -> T_Result: if self.__root__.type == "list": - return list(self.__root__.value) + return list_(self.__root__.value) if self.__root__.type == "optional": return optional(self.__root__.value) diff --git a/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_map_of_map.py b/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_map_of_map.py index 231008fd80c..232cbb12fb1 100644 --- a/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -23,5 +23,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + allow_population_by_field_name = True extra = pydantic.Extra.forbid json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_optional_field.py b/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_optional_field.py index 564aa7979d8..60fa93b56f0 100644 --- a/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/fastapi/exhaustive/no-custom-config/resources/types/resources/object/types/object_with_optional_field.py @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] integer: typing.Optional[int] - long: typing.Optional[int] + long_: typing.Optional[int] = pydantic.Field(alias="long") double: typing.Optional[float] - bool: typing.Optional[bool] + bool_: typing.Optional[bool] = pydantic.Field(alias="bool") datetime: typing.Optional[dt.datetime] date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="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]] + list_: typing.Optional[typing.List[str]] = pydantic.Field(alias="list") + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set") + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_map_of_map.py b/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_map_of_map.py index a3e77c37557..49f3a022fbe 100644 --- a/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_map_of_map.py @@ -9,7 +9,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -20,5 +20,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + allow_population_by_field_name = True extra = pydantic.Extra.forbid json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_optional_field.py b/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_optional_field.py index 6c836462731..9580b7ee56e 100644 --- a/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/fastapi/exhaustive/pydantic-v1/resources/types/resources/object/types/object_with_optional_field.py @@ -12,16 +12,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] integer: typing.Optional[int] - long: typing.Optional[int] + long_: typing.Optional[int] = pydantic.Field(alias="long") double: typing.Optional[float] - bool: typing.Optional[bool] + bool_: typing.Optional[bool] = pydantic.Field(alias="bool") datetime: typing.Optional[dt.datetime] date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="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]] + list_: typing.Optional[typing.List[str]] = pydantic.Field(alias="list") + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set") + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_map_of_map.py b/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_map_of_map.py index 25d7247e0f1..6eda4c27a05 100644 --- a/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_map_of_map.py @@ -9,7 +9,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -20,5 +20,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + allow_population_by_field_name = True extra = pydantic.Extra.forbid json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_optional_field.py b/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_optional_field.py index bc15dbeb1a9..ea325328538 100644 --- a/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/fastapi/exhaustive/pydantic-v2/resources/types/resources/object/types/object_with_optional_field.py @@ -12,16 +12,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] integer: typing.Optional[int] - long: typing.Optional[int] + long_: typing.Optional[int] = pydantic.Field(alias="long") double: typing.Optional[float] - bool: typing.Optional[bool] + bool_: typing.Optional[bool] = pydantic.Field(alias="bool") datetime: typing.Optional[dt.datetime] date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="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]] + list_: typing.Optional[typing.List[str]] = pydantic.Field(alias="list") + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set") + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_map_of_map.py b/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_map_of_map.py index 2bba6bb67ed..3592304b851 100644 --- a/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_map_of_map.py @@ -10,7 +10,7 @@ import pydantic # type: ignore class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs } return super().json(**kwargs_with_defaults) @@ -18,5 +18,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: kwargs_with_defaults: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs } return super().dict(**kwargs_with_defaults) class Config: + allow_population_by_field_name = True extra = pydantic.Extra.forbid json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_optional_field.py b/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_optional_field.py index bca9f9730e5..02f109c153f 100644 --- a/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_optional_field.py +++ b/seed/fastapi/exhaustive/skip-formatting/resources/types/resources/object/types/object_with_optional_field.py @@ -13,16 +13,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] integer: typing.Optional[int] - long: typing.Optional[int] + long_: typing.Optional[int] = pydantic.Field(alias="long") double: typing.Optional[float] - bool: typing.Optional[bool] + bool_: typing.Optional[bool] = pydantic.Field(alias="bool") datetime: typing.Optional[dt.datetime] date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="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]] + list_: typing.Optional[typing.List[str]] = pydantic.Field(alias="list") + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set") + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = { "by_alias": True, "exclude_unset": True, **kwargs } return super().json(**kwargs_with_defaults) diff --git a/seed/pydantic/alias/src/seed/alias/type.py b/seed/pydantic/alias/src/seed/alias/type.py index 9e726605081..62d60805add 100644 --- a/seed/pydantic/alias/src/seed/alias/type.py +++ b/seed/pydantic/alias/src/seed/alias/type.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/audiences/src/seed/audiences/resources/folder_a/resources/service/response.py b/seed/pydantic/audiences/src/seed/audiences/resources/folder_a/resources/service/response.py index ca58db2cfbb..54e9d8bcf3b 100644 --- a/seed/pydantic/audiences/src/seed/audiences/resources/folder_a/resources/service/response.py +++ b/seed/pydantic/audiences/src/seed/audiences/resources/folder_a/resources/service/response.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/audiences/src/seed/audiences/resources/folder_b/resources/common/foo.py b/seed/pydantic/audiences/src/seed/audiences/resources/folder_b/resources/common/foo.py index 5f714cba6bb..d9d01e5ff29 100644 --- a/seed/pydantic/audiences/src/seed/audiences/resources/folder_b/resources/common/foo.py +++ b/seed/pydantic/audiences/src/seed/audiences/resources/folder_b/resources/common/foo.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/audiences/src/seed/audiences/resources/folder_c/resources/common/foo.py b/seed/pydantic/audiences/src/seed/audiences/resources/folder_c/resources/common/foo.py index 7c97002aba3..7cbd5b37565 100644 --- a/seed/pydantic/audiences/src/seed/audiences/resources/folder_c/resources/common/foo.py +++ b/seed/pydantic/audiences/src/seed/audiences/resources/folder_c/resources/common/foo.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/audiences/src/seed/audiences/resources/foo/filtered_type.py b/seed/pydantic/audiences/src/seed/audiences/resources/foo/filtered_type.py index aea3d50f004..deb2b878ade 100644 --- a/seed/pydantic/audiences/src/seed/audiences/resources/foo/filtered_type.py +++ b/seed/pydantic/audiences/src/seed/audiences/resources/foo/filtered_type.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/audiences/src/seed/audiences/resources/foo/importing_type.py b/seed/pydantic/audiences/src/seed/audiences/resources/foo/importing_type.py index 89cfb15594f..79c4e66df94 100644 --- a/seed/pydantic/audiences/src/seed/audiences/resources/foo/importing_type.py +++ b/seed/pydantic/audiences/src/seed/audiences/resources/foo/importing_type.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/basic-auth/src/seed/basic_auth/resources/errors/unauthorized_request_error_body.py b/seed/pydantic/basic-auth/src/seed/basic_auth/resources/errors/unauthorized_request_error_body.py index 53a9a50c934..d04326faa45 100644 --- a/seed/pydantic/basic-auth/src/seed/basic_auth/resources/errors/unauthorized_request_error_body.py +++ b/seed/pydantic/basic-auth/src/seed/basic_auth/resources/errors/unauthorized_request_error_body.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/circular-references/src/seed/api/importing_a.py b/seed/pydantic/circular-references/src/seed/api/importing_a.py index 62994353de0..51aae793c39 100644 --- a/seed/pydantic/circular-references/src/seed/api/importing_a.py +++ b/seed/pydantic/circular-references/src/seed/api/importing_a.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/circular-references/src/seed/api/resources/a/a.py b/seed/pydantic/circular-references/src/seed/api/resources/a/a.py index 5df0eafacbe..ba8356bedd2 100644 --- a/seed/pydantic/circular-references/src/seed/api/resources/a/a.py +++ b/seed/pydantic/circular-references/src/seed/api/resources/a/a.py @@ -6,6 +6,11 @@ from ...core.datetime_utils import serialize_datetime from ...root_type import RootType +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class A(RootType): def json(self, **kwargs: typing.Any) -> str: @@ -18,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/circular-references/src/seed/api/resources/ast/object_value.py b/seed/pydantic/circular-references/src/seed/api/resources/ast/object_value.py index be51fb8d97c..72c4169e3c4 100644 --- a/seed/pydantic/circular-references/src/seed/api/resources/ast/object_value.py +++ b/seed/pydantic/circular-references/src/seed/api/resources/ast/object_value.py @@ -21,4 +21,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/circular-references/src/seed/api/root_type.py b/seed/pydantic/circular-references/src/seed/api/root_type.py index 4783dfcd9f7..0fd66ca5ec4 100644 --- a/seed/pydantic/circular-references/src/seed/api/root_type.py +++ b/seed/pydantic/circular-references/src/seed/api/root_type.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/custom-auth/src/seed/custom_auth/resources/errors/unauthorized_request_error_body.py b/seed/pydantic/custom-auth/src/seed/custom_auth/resources/errors/unauthorized_request_error_body.py index 53a9a50c934..d04326faa45 100644 --- a/seed/pydantic/custom-auth/src/seed/custom_auth/resources/errors/unauthorized_request_error_body.py +++ b/seed/pydantic/custom-auth/src/seed/custom_auth/resources/errors/unauthorized_request_error_body.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/error-property/src/seed/error_property/resources/errors/property_based_error_test_body.py b/seed/pydantic/error-property/src/seed/error_property/resources/errors/property_based_error_test_body.py index 53992ccd5d2..cfbd2df42f6 100644 --- a/seed/pydantic/error-property/src/seed/error_property/resources/errors/property_based_error_test_body.py +++ b/seed/pydantic/error-property/src/seed/error_property/resources/errors/property_based_error_test_body.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/commons/resources/types/metadata.py b/seed/pydantic/examples/src/seed/examples/resources/commons/resources/types/metadata.py index d52205642a5..35c2f3b90cb 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/commons/resources/types/metadata.py +++ b/seed/pydantic/examples/src/seed/examples/resources/commons/resources/types/metadata.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/actor.py b/seed/pydantic/examples/src/seed/examples/resources/types/actor.py index aa2ea8106fa..e177cf49eed 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/actor.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/actor.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/actress.py b/seed/pydantic/examples/src/seed/examples/resources/types/actress.py index cd1afc50877..3a86116536e 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/actress.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/actress.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/directory.py b/seed/pydantic/examples/src/seed/examples/resources/types/directory.py index a7fac11aaab..2172fbb4f15 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/directory.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/directory.py @@ -53,6 +53,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/exception_info.py b/seed/pydantic/examples/src/seed/examples/resources/types/exception_info.py index f4494cb3861..828dbc5a878 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/exception_info.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/exception_info.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/extended_movie.py b/seed/pydantic/examples/src/seed/examples/resources/types/extended_movie.py index 9e9a6ac5911..899c2b999c5 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/extended_movie.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/extended_movie.py @@ -6,6 +6,11 @@ from ...core.datetime_utils import serialize_datetime from .movie import Movie +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class ExtendedMovie(Movie): """ @@ -34,4 +39,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/file.py b/seed/pydantic/examples/src/seed/examples/resources/types/file.py index 6d12b75e923..af5d8ddf004 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/file.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/file.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/metadata.py b/seed/pydantic/examples/src/seed/examples/resources/types/metadata.py index cea260bc1be..565bfa70a28 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/metadata.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/metadata.py @@ -32,6 +32,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/migration.py b/seed/pydantic/examples/src/seed/examples/resources/types/migration.py index 70c740497e5..6d4b7de4723 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/migration.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/migration.py @@ -34,4 +34,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 063d223e97c..b14af7bb4cc 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/moment.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/moment.py @@ -45,4 +45,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/movie.py b/seed/pydantic/examples/src/seed/examples/resources/types/movie.py index 1eefffdf007..fd41d03cc14 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/movie.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/movie.py @@ -51,4 +51,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/node.py b/seed/pydantic/examples/src/seed/examples/resources/types/node.py index e7ea56c0ff1..b344325f042 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/node.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/node.py @@ -55,6 +55,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/request.py b/seed/pydantic/examples/src/seed/examples/resources/types/request.py index d324bc4f05a..040535c38e5 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/request.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/request.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/response.py b/seed/pydantic/examples/src/seed/examples/resources/types/response.py index 5e72d9aec78..1ac0f9e9c3f 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/response.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/response.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/stunt_double.py b/seed/pydantic/examples/src/seed/examples/resources/types/stunt_double.py index 792bde2d45d..65397f093bb 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/stunt_double.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/stunt_double.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/examples/src/seed/examples/resources/types/tree.py b/seed/pydantic/examples/src/seed/examples/resources/types/tree.py index 5c3bc235d5e..a5f40daf459 100644 --- a/seed/pydantic/examples/src/seed/examples/resources/types/tree.py +++ b/seed/pydantic/examples/src/seed/examples/resources/types/tree.py @@ -40,6 +40,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py index 8e38801466d..ec0eac91347 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py @@ -20,4 +20,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py index 766342ba485..253102ace38 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py index 330a1f27029..879e1bd7366 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py index 6d53a7db579..e1a6c5ee00c 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py @@ -9,7 +9,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -20,4 +20,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py index 19e23b0a688..56e7b8240c2 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py @@ -12,16 +12,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] integer: typing.Optional[int] - long: typing.Optional[int] + long_: typing.Optional[int] = pydantic.Field(alias="long") double: typing.Optional[float] - bool: typing.Optional[bool] + bool_: typing.Optional[bool] = pydantic.Field(alias="bool") datetime: typing.Optional[dt.datetime] date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="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]] + list_: typing.Optional[typing.List[str]] = pydantic.Field(alias="list") + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set") + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py index c6b0029025b..74189624933 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py @@ -20,4 +20,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/cat.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/cat.py index 935a82b917e..5d3432455c2 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/cat.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/cat.py @@ -22,4 +22,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/dog.py b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/dog.py index e0f4e34cbda..5f0e86f9040 100644 --- a/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/dog.py +++ b/seed/pydantic/exhaustive/pydantic-v1/src/seed/exhaustive/resources/types/resources/union/dog.py @@ -22,4 +22,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py index ae7b4c62315..5712800c420 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/general_errors/bad_object_request_info.py @@ -20,4 +20,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py index bf47305a724..bd88c8c7b65 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_optional_field.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py index f1a2cd1de49..502c9da81d8 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/nested_object_with_required_field.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py index ae7dc4f3def..acc4f2d416b 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_map_of_map.py @@ -9,7 +9,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -20,4 +20,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py index 7b1e6a75a39..d9f1c5d8b68 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_optional_field.py @@ -12,16 +12,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] integer: typing.Optional[int] - long: typing.Optional[int] + long_: typing.Optional[int] = pydantic.Field(alias="long") double: typing.Optional[float] - bool: typing.Optional[bool] + bool_: typing.Optional[bool] = pydantic.Field(alias="bool") datetime: typing.Optional[dt.datetime] date: typing.Optional[dt.date] - uuid: typing.Optional[uuid.UUID] + uuid_: typing.Optional[uuid.UUID] = pydantic.Field(alias="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]] + list_: typing.Optional[typing.List[str]] = pydantic.Field(alias="list") + set_: typing.Optional[typing.Set[str]] = pydantic.Field(alias="set") + map_: typing.Optional[typing.Dict[int, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py index 72a3aff9e0a..69e8f9329ad 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/object/object_with_required_field.py @@ -20,4 +20,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/cat.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/cat.py index 69e7f37d70a..008836ee3fd 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/cat.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/cat.py @@ -22,4 +22,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/dog.py b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/dog.py index 976fe0b258e..ea0e6f56982 100644 --- a/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/dog.py +++ b/seed/pydantic/exhaustive/pydantic-v2/src/seed/exhaustive/resources/types/resources/union/dog.py @@ -22,4 +22,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/extends/src/seed/extends/docs.py b/seed/pydantic/extends/src/seed/extends/docs.py index 2777cc9c931..9593e3c28fb 100644 --- a/seed/pydantic/extends/src/seed/extends/docs.py +++ b/seed/pydantic/extends/src/seed/extends/docs.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/extends/src/seed/extends/example_type.py b/seed/pydantic/extends/src/seed/extends/example_type.py index 47e177da205..2c00a5a91eb 100644 --- a/seed/pydantic/extends/src/seed/extends/example_type.py +++ b/seed/pydantic/extends/src/seed/extends/example_type.py @@ -6,6 +6,11 @@ from .core.datetime_utils import serialize_datetime from .docs import Docs +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class ExampleType(Docs): """ @@ -29,4 +34,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/extends/src/seed/extends/json.py b/seed/pydantic/extends/src/seed/extends/json.py index 53d37ab46cf..2ccad71ed10 100644 --- a/seed/pydantic/extends/src/seed/extends/json.py +++ b/seed/pydantic/extends/src/seed/extends/json.py @@ -6,6 +6,11 @@ from .core.datetime_utils import serialize_datetime from .docs import Docs +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class Json(Docs): """ @@ -29,4 +34,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/extends/src/seed/extends/nested_type.py b/seed/pydantic/extends/src/seed/extends/nested_type.py index 4fa5ea37972..d08a471186e 100644 --- a/seed/pydantic/extends/src/seed/extends/nested_type.py +++ b/seed/pydantic/extends/src/seed/extends/nested_type.py @@ -6,6 +6,11 @@ from .core.datetime_utils import serialize_datetime from .json import Json +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class NestedType(Json): """ @@ -30,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/my_object.py b/seed/pydantic/file-upload/src/seed/file_upload/resources/service/my_object.py index 923381f5c0e..c1f9f94e591 100644 --- a/seed/pydantic/file-upload/src/seed/file_upload/resources/service/my_object.py +++ b/seed/pydantic/file-upload/src/seed/file_upload/resources/service/my_object.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/imdb/src/seed/api/resources/imdb/create_movie_request.py b/seed/pydantic/imdb/src/seed/api/resources/imdb/create_movie_request.py index 14a20303955..7edadead33b 100644 --- a/seed/pydantic/imdb/src/seed/api/resources/imdb/create_movie_request.py +++ b/seed/pydantic/imdb/src/seed/api/resources/imdb/create_movie_request.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/imdb/src/seed/api/resources/imdb/movie.py b/seed/pydantic/imdb/src/seed/api/resources/imdb/movie.py index 094f63c6a0a..6305e196de9 100644 --- a/seed/pydantic/imdb/src/seed/api/resources/imdb/movie.py +++ b/seed/pydantic/imdb/src/seed/api/resources/imdb/movie.py @@ -29,4 +29,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/literal/src/seed/literal/resources/reference/send_request.py b/seed/pydantic/literal/src/seed/literal/resources/reference/send_request.py index d1b603ddc93..bde46e2adbf 100644 --- a/seed/pydantic/literal/src/seed/literal/resources/reference/send_request.py +++ b/seed/pydantic/literal/src/seed/literal/resources/reference/send_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/literal/src/seed/literal/send_response.py b/seed/pydantic/literal/src/seed/literal/send_response.py index 35dfb6a0be7..ce21a85c098 100644 --- a/seed/pydantic/literal/src/seed/literal/send_response.py +++ b/seed/pydantic/literal/src/seed/literal/send_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/object/src/seed/object/name.py b/seed/pydantic/object/src/seed/object/name.py index 45599f8b08a..4e40c4abf94 100644 --- a/seed/pydantic/object/src/seed/object/name.py +++ b/seed/pydantic/object/src/seed/object/name.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/object/src/seed/object/type.py b/seed/pydantic/object/src/seed/object/type.py index 3858e6fe98b..4191b646603 100644 --- a/seed/pydantic/object/src/seed/object/type.py +++ b/seed/pydantic/object/src/seed/object/type.py @@ -90,4 +90,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/node.py b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/node.py index 042f2e9dd4d..12b4f3c90cc 100644 --- a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/node.py +++ b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/node.py @@ -40,4 +40,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/commons/resources/metadata/metadata.py b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/commons/resources/metadata/metadata.py index 25d63093e42..957548c5732 100644 --- a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/commons/resources/metadata/metadata.py +++ b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/commons/resources/metadata/metadata.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/file.py b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/file.py index d6573ce76cd..67bb10c9631 100644 --- a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/file.py +++ b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/file.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/resources/directory/directory.py b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/resources/directory/directory.py index fb1249d4e94..f410dc1b317 100644 --- a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/resources/directory/directory.py +++ b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/resources/file/resources/directory/directory.py @@ -56,6 +56,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/tree.py b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/tree.py index f7b178dd4f6..3ea61df70f4 100644 --- a/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/tree.py +++ b/seed/pydantic/objects-with-imports/src/seed/objects_with_imports/tree.py @@ -50,4 +50,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/nested_user.py b/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/nested_user.py index cbdca6f1fb5..7bd751be77f 100644 --- a/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/nested_user.py +++ b/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/nested_user.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/user.py b/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/user.py index 4a962f97578..78016a17530 100644 --- a/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/user.py +++ b/seed/pydantic/query-parameters/src/seed/query_parameters/resources/user/user.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/package.py b/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/package.py index e8ff1cf982c..6b644c893b5 100644 --- a/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/package.py +++ b/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/package.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/record.py b/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/record.py index ab04193b84b..045f997e78f 100644 --- a/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/record.py +++ b/seed/pydantic/reserved-keywords/src/seed/nursery_api/resources/package/record.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/response-property/src/seed/response_property/resources/service/movie.py b/seed/pydantic/response-property/src/seed/response_property/resources/service/movie.py index ce3027e490d..97952b203b8 100644 --- a/seed/pydantic/response-property/src/seed/response_property/resources/service/movie.py +++ b/seed/pydantic/response-property/src/seed/response_property/resources/service/movie.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/response-property/src/seed/response_property/resources/service/response.py b/seed/pydantic/response-property/src/seed/response_property/resources/service/response.py index 5dbc5d126de..69e16547c8a 100644 --- a/seed/pydantic/response-property/src/seed/response_property/resources/service/response.py +++ b/seed/pydantic/response-property/src/seed/response_property/resources/service/response.py @@ -8,6 +8,11 @@ from .movie import Movie from .with_docs import WithDocs +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class Response(WithMetadata, WithDocs): data: Movie @@ -22,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/response-property/src/seed/response_property/resources/service/with_docs.py b/seed/pydantic/response-property/src/seed/response_property/resources/service/with_docs.py index cda48439ad1..3e2290d10cc 100644 --- a/seed/pydantic/response-property/src/seed/response_property/resources/service/with_docs.py +++ b/seed/pydantic/response-property/src/seed/response_property/resources/service/with_docs.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/response-property/src/seed/response_property/string_response.py b/seed/pydantic/response-property/src/seed/response_property/string_response.py index 55a82cb8237..9ce78f0faf7 100644 --- a/seed/pydantic/response-property/src/seed/response_property/string_response.py +++ b/seed/pydantic/response-property/src/seed/response_property/string_response.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/response-property/src/seed/response_property/with_metadata.py b/seed/pydantic/response-property/src/seed/response_property/with_metadata.py index 29cf0652a0a..6f265e93e87 100644 --- a/seed/pydantic/response-property/src/seed/response_property/with_metadata.py +++ b/seed/pydantic/response-property/src/seed/response_property/with_metadata.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/streaming/src/seed/streaming/resources/dummy/stream_response.py b/seed/pydantic/streaming/src/seed/streaming/resources/dummy/stream_response.py index 24770ee8132..4faf1dece2f 100644 --- a/seed/pydantic/streaming/src/seed/streaming/resources/dummy/stream_response.py +++ b/seed/pydantic/streaming/src/seed/streaming/resources/dummy/stream_response.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_and_tree_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_and_tree_value.py index f62bad7c3d5..8c146e28855 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_and_tree_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_and_tree_value.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_value.py index e5dfad2317c..b0c4fadc01b 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_node_value.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_value.py index 9d31f470c45..7172bfa1b7a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/binary_tree_value.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py index 3c1359e2971..e42b52fbe7b 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_key_value_pairs.py @@ -26,6 +26,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py index 0c5b5fbf45b..0e53c47a711 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/debug_map_value.py @@ -26,6 +26,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_and_list_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_and_list_value.py index 760e6c948e0..d6532376f26 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_and_list_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_and_list_value.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_value.py index a73e25d66e2..8bb343d7b36 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_node_value.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_value.py index ca829a8e34f..e1dd9412ace 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/doubly_linked_list_value.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/file_info.py b/seed/pydantic/trace/src/seed/trace/resources/commons/file_info.py index ddf28132a68..6c1ca41420a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/file_info.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/file_info.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/generic_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/generic_value.py index 2f4ad4d63c7..bf5058ee258 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/generic_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/generic_value.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py b/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py index f92da97494d..72e1476d7b3 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/key_value_pair.py @@ -26,6 +26,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py b/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py index ecdc74506b7..3372c1d394f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/list_type.py @@ -30,6 +30,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py b/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py index d87e3a47228..895b3dd5a69 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/map_type.py @@ -27,6 +27,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py index 85131bc9a35..322bf1c4862 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/map_value.py @@ -26,6 +26,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_and_list_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_and_list_value.py index e3c6f8a4b01..4eff7d73a85 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_and_list_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_and_list_value.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_value.py index 6e19a61fc5d..2e01d83cab9 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_node_value.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_value.py b/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_value.py index f4bc57cae13..8aff9440a7b 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_value.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/singly_linked_list_value.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/test_case.py b/seed/pydantic/trace/src/seed/trace/resources/commons/test_case.py index e855092dfb5..54cc77581fc 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/test_case.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/test_case.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/commons/test_case_with_expected_result.py b/seed/pydantic/trace/src/seed/trace/resources/commons/test_case_with_expected_result.py index bd15ddd4318..50762b4aec8 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/commons/test_case_with_expected_result.py +++ b/seed/pydantic/trace/src/seed/trace/resources/commons/test_case_with_expected_result.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_request.py b/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_request.py index bbc8f897866..d41f818bc87 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_request.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_response.py b/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_response.py index 23d18ea18c3..4b6b7cae900 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/lang_server/lang_server_response.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/migration/migration.py b/seed/pydantic/trace/src/seed/trace/resources/migration/migration.py index 970caa36491..db9cc5bd2a6 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/migration/migration.py +++ b/seed/pydantic/trace/src/seed/trace/resources/migration/migration.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist.py b/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist.py index 2dac35c135c..e438a574c22 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist.py +++ b/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist_create_request.py b/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist_create_request.py index 6db8f631667..3e8b63ff6eb 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist_create_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/playlist/playlist_create_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/playlist/update_playlist_request.py b/seed/pydantic/trace/src/seed/trace/resources/playlist/update_playlist_request.py index 2cabd5f7286..0b36ef4c65d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/playlist/update_playlist_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/playlist/update_playlist_request.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/create_problem_request.py b/seed/pydantic/trace/src/seed/trace/resources/problem/create_problem_request.py index 4e322f7c2f2..3fbd87db5f6 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/create_problem_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/create_problem_request.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/generic_create_problem_error.py b/seed/pydantic/trace/src/seed/trace/resources/problem/generic_create_problem_error.py index 3336245a6d6..abb00588586 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/generic_create_problem_error.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/generic_create_problem_error.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/get_default_starter_files_response.py b/seed/pydantic/trace/src/seed/trace/resources/problem/get_default_starter_files_response.py index d0f843b9083..3987d3bba05 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/get_default_starter_files_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/get_default_starter_files_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/problem_description.py b/seed/pydantic/trace/src/seed/trace/resources/problem/problem_description.py index f5a1154c560..aec9d1bfd40 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/problem_description.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/problem_description.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/problem_files.py b/seed/pydantic/trace/src/seed/trace/resources/problem/problem_files.py index c5d467a57b4..25238019d02 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/problem_files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/problem_files.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/problem_info.py b/seed/pydantic/trace/src/seed/trace/resources/problem/problem_info.py index 69f7c4e8dce..788335790a1 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/problem_info.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/problem_info.py @@ -40,4 +40,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/update_problem_response.py b/seed/pydantic/trace/src/seed/trace/resources/problem/update_problem_response.py index dade36abcf6..7a728388170 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/update_problem_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/update_problem_response.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/problem/variable_type_and_name.py b/seed/pydantic/trace/src/seed/trace/resources/problem/variable_type_and_name.py index 7de1a800265..04c2a0d853a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/problem/variable_type_and_name.py +++ b/seed/pydantic/trace/src/seed/trace/resources/problem/variable_type_and_name.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/building_executor_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/building_executor_response.py index b1662e2dfae..fbf2f19ace5 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/building_executor_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/building_executor_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/compile_error.py b/seed/pydantic/trace/src/seed/trace/resources/submission/compile_error.py index c722764e1b7..1ee812dbced 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/compile_error.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/compile_error.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/custom_test_cases_unsupported.py b/seed/pydantic/trace/src/seed/trace/resources/submission/custom_test_cases_unsupported.py index ad4387bd18b..06597f2b29c 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/custom_test_cases_unsupported.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/custom_test_cases_unsupported.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/errored_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/errored_response.py index 51261fd28d8..dadd49d2300 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/errored_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/errored_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/exception_info.py b/seed/pydantic/trace/src/seed/trace/resources/submission/exception_info.py index 5de382f77f5..98b8e3a9f1c 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/exception_info.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/exception_info.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_response.py index 70ffd4988d6..4cf1497344e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_response.py @@ -29,4 +29,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_state.py b/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_state.py index 06b3fbf3e48..1a1997c9f24 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_state.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/execution_session_state.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/existing_submission_executing.py b/seed/pydantic/trace/src/seed/trace/resources/submission/existing_submission_executing.py index b28490a45ca..05b62b8852b 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/existing_submission_executing.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/existing_submission_executing.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/expression_location.py b/seed/pydantic/trace/src/seed/trace/resources/submission/expression_location.py index 18755a1cac4..01cbcecbd23 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/expression_location.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/expression_location.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/finished_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/finished_response.py index f371aa127b4..f7e8ab42640 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/finished_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/finished_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/get_execution_session_state_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/get_execution_session_state_response.py index f6828240289..c869888501d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/get_execution_session_state_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/get_execution_session_state_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/get_submission_state_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/get_submission_state_response.py index 1e0da911506..a2d486bcec4 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/get_submission_state_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/get_submission_state_response.py @@ -29,4 +29,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/get_trace_responses_page_request.py b/seed/pydantic/trace/src/seed/trace/resources/submission/get_trace_responses_page_request.py index f5e99a55783..bc36a2db54f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/get_trace_responses_page_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/get_trace_responses_page_request.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response.py index 59591bc5ed3..a8089e39783 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response_v_2.py index cf41b8886a3..2e1dd6b0f4c 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/graded_response_v_2.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/graded_test_case_update.py b/seed/pydantic/trace/src/seed/trace/resources/submission/graded_test_case_update.py index 4ed5122d08b..3c57e5bd2df 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/graded_test_case_update.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/graded_test_case_update.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/initialize_problem_request.py b/seed/pydantic/trace/src/seed/trace/resources/submission/initialize_problem_request.py index 97926a20680..f3ec088bc03 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/initialize_problem_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/initialize_problem_request.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/internal_error.py b/seed/pydantic/trace/src/seed/trace/resources/submission/internal_error.py index 843cb57de70..999a25276c6 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/internal_error.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/internal_error.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/invalid_request_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/invalid_request_response.py index 39d3a44272a..596a04cc7e5 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/invalid_request_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/invalid_request_response.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/lightweight_stackframe_information.py b/seed/pydantic/trace/src/seed/trace/resources/submission/lightweight_stackframe_information.py index e4813c73c27..f88f275a10f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/lightweight_stackframe_information.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/lightweight_stackframe_information.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_response_notification.py b/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_response_notification.py index 3418b96108c..c0f3aa9155b 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_response_notification.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_response_notification.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_test_case_update.py b/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_test_case_update.py index 31f21242c2e..f49827e4e09 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_test_case_update.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/recorded_test_case_update.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/recording_response_notification.py b/seed/pydantic/trace/src/seed/trace/resources/submission/recording_response_notification.py index bb609714729..3ecda1c0133 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/recording_response_notification.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/recording_response_notification.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/running_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/running_response.py index a01e8994f29..b32f368267e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/running_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/running_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/runtime_error.py b/seed/pydantic/trace/src/seed/trace/resources/submission/runtime_error.py index 3ce02a24f02..58fbfa43932 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/runtime_error.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/runtime_error.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/scope.py b/seed/pydantic/trace/src/seed/trace/resources/submission/scope.py index 1819660acfd..f850da7be0a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/scope.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/scope.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/stack_frame.py b/seed/pydantic/trace/src/seed/trace/resources/submission/stack_frame.py index 36168a9e91b..17a223be1b8 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/stack_frame.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/stack_frame.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/stack_information.py b/seed/pydantic/trace/src/seed/trace/resources/submission/stack_information.py index c0b1bd61b30..6ef81e21578 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/stack_information.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/stack_information.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/stderr_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/stderr_response.py index 524e2f90d64..f851c0abd89 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/stderr_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/stderr_response.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/stdout_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/stdout_response.py index 260a1207a05..5cca6b0ee69 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/stdout_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/stdout_response.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/stop_request.py b/seed/pydantic/trace/src/seed/trace/resources/submission/stop_request.py index 572694f4188..0adb71f14a9 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/stop_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/stop_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/stopped_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/stopped_response.py index 2efec2e1d25..1619b6f911e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/stopped_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/stopped_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/submission_file_info.py b/seed/pydantic/trace/src/seed/trace/resources/submission/submission_file_info.py index 8d2efee9db6..398025d1f6a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/submission_file_info.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/submission_file_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/submission_id_not_found.py b/seed/pydantic/trace/src/seed/trace/resources/submission/submission_id_not_found.py index 1c7b41327ca..e650caa7d95 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/submission_id_not_found.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/submission_id_not_found.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/submit_request_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/submit_request_v_2.py index 9a7c29f03f1..1d8b03cc5b3 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/submit_request_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/submit_request_v_2.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/terminated_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/terminated_response.py index b54a5f41e4d..1e3406144ea 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/terminated_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/terminated_response.py @@ -21,4 +21,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_hidden_grade.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_hidden_grade.py index 4d4445f0f4d..516000f15ef 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_hidden_grade.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_hidden_grade.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_non_hidden_grade.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_non_hidden_grade.py index 3e744a687a7..f4b28b3994d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_non_hidden_grade.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_non_hidden_grade.py @@ -29,4 +29,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result.py index 773d8784115..28ee9210523 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result_with_stdout.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result_with_stdout.py index aa7119f0b5e..3cfaff8f92d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result_with_stdout.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_case_result_with_stdout.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_state.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_state.py index 558e257f25b..0f0025a799e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_state.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_state.py @@ -30,4 +30,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_status_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_status_v_2.py index 5970cd3dc4a..31be5b4248f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_status_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_status_v_2.py @@ -30,4 +30,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_update.py b/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_update.py index d737da8f7f8..25d3ef4b70a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_update.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/test_submission_update.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response.py index 07551f53eb5..e1bf4fd55ef 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response_v_2.py index 3043c03da45..733317c05b6 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_response_v_2.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page.py b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page.py index d383f6ebbc9..87a50bc301e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page_v_2.py index 514f433c7fe..d079af79e1d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/trace_responses_page_v_2.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/traced_file.py b/seed/pydantic/trace/src/seed/trace/resources/submission/traced_file.py index a88888e4c0b..15ce48b1531 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/traced_file.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/traced_file.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/traced_test_case.py b/seed/pydantic/trace/src/seed/trace/resources/submission/traced_test_case.py index 6a663fe31cc..988c425aa4e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/traced_test_case.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/traced_test_case.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/unexpected_language_error.py b/seed/pydantic/trace/src/seed/trace/resources/submission/unexpected_language_error.py index 585455cbf6f..6e06aa1ac08 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/unexpected_language_error.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/unexpected_language_error.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_files.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_files.py index 41afa32b789..e915758b0e3 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_files.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_ran_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_ran_response.py index 0c0629d7004..54e1fb2b250 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_ran_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_ran_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_run_details.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_run_details.py index 1d689f87f02..869ec5403c7 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_run_details.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_run_details.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response.py index a91d4b88d97..c80aa9422d9 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response_v_2.py index c484f229861..c582cc713ef 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_starter_files_response_v_2.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_state.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_state.py index c43fc27775b..3de4f1cdd9e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_state.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_state.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_status_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_status_v_2.py index 3aaceee0720..86e10090bbe 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_status_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_status_v_2.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_update.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_update.py index 2c3e2b93677..527e79f8973 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_update.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submission_update.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submit_request.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submit_request.py index 8802e0ece6f..d8fae0cc4cf 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submit_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_submit_request.py @@ -30,4 +30,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_traced_update.py b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_traced_update.py index 3e8addc7911..511c98fb460 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_traced_update.py +++ b/seed/pydantic/trace/src/seed/trace/resources/submission/workspace_traced_update.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_custom_files.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_custom_files.py index 551e02c4ecc..3f4a8b84c04 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_custom_files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_custom_files.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_test_case_template.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_test_case_template.py index e38cc9211de..fa1941cecdd 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_test_case_template.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/basic_test_case_template.py @@ -30,4 +30,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/create_problem_request_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/create_problem_request_v_2.py index a6f7a341ed3..dc7cce60b38 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/create_problem_request_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/create_problem_request_v_2.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/deep_equality_correctness_check.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/deep_equality_correctness_check.py index 873d4251cbc..240e99314a0 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/deep_equality_correctness_check.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/deep_equality_correctness_check.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/default_provided_file.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/default_provided_file.py index 853e82e53de..1e8a52b8dae 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/default_provided_file.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/default_provided_file.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/file_info_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/file_info_v_2.py index 0984d99d188..9b2699f14e8 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/file_info_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/file_info_v_2.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/files.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/files.py index d7504fb39bc..6e2c91096f9 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/files.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation.py index b3013d193a5..dc5416ca3b1 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation_for_multiple_languages.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation_for_multiple_languages.py index 81a3c0a5251..0268a9f3393 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation_for_multiple_languages.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/function_implementation_for_multiple_languages.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/generated_files.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/generated_files.py index 7d8b49b203d..a9bc5a4aaf8 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/generated_files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/generated_files.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_request.py index a30a5811acf..b8f28a6c5c3 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_request.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_response.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_response.py index 03bf052555c..0a6b48dfa93 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_basic_solution_file_response.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_request.py index 4dd61f61150..523211f6d5a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_response.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_response.py index cd5abaec351..fd304bbe6ac 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_function_signature_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_file_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_file_request.py index 3ae424adfba..defbea552c6 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_file_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_file_request.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_template_file_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_template_file_request.py index a7487ac6dcf..43e1a9a1f5d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_template_file_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/get_generated_test_case_template_file_request.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/lightweight_problem_info_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/lightweight_problem_info_v_2.py index cefd728c126..17b81db088e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/lightweight_problem_info_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/lightweight_problem_info_v_2.py @@ -29,4 +29,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_definition.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_definition.py index c4fee2d9234..d09a142a179 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_definition.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_definition.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_signature.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_signature.py index e886b2e5938..d9d29eeb770 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_signature.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/non_void_function_signature.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/parameter.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/parameter.py index 00cf56b7dca..20fa8d7e6af 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/parameter.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/parameter.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/problem_info_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/problem_info_v_2.py index 6a203a36276..f5019280715 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/problem_info_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/problem_info_v_2.py @@ -40,4 +40,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_expects.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_expects.py index 18cb502898f..96c59ef2d63 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_expects.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_expects.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation.py index e1f49ff2d3d..cf24c3fcbbe 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation_description.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation_description.py index e73fe30aaad..c24d291de86 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation_description.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_implementation_description.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_metadata.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_metadata.py index 28b94ac2cc2..74ab4892a84 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_metadata.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_metadata.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_template.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_template.py index 7fc2ecadf5e..d6d5f41c576 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_template.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_template.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_v_2.py index 3dcffe60f8a..d4669b45740 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_v_2.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_with_actual_result_implementation.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_with_actual_result_implementation.py index 8bc14214ce8..d8239362396 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_with_actual_result_implementation.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/test_case_with_actual_result_implementation.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition.py index 6d9c822c063..64984b57c0a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition_that_takes_actual_result.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition_that_takes_actual_result.py index fbfdd7c99ea..bbc65b6861f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition_that_takes_actual_result.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_definition_that_takes_actual_result.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature.py index d2ade8c2d4a..6f00de27232 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature_that_takes_actual_result.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature_that_takes_actual_result.py index 6b7d67c592f..72c568d89bf 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature_that_takes_actual_result.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/problem/void_function_signature_that_takes_actual_result.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_custom_files.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_custom_files.py index f02d2418d99..d65b0c0acb0 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_custom_files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_custom_files.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_test_case_template.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_test_case_template.py index f1dce099bbe..239a6acf5df 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_test_case_template.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/basic_test_case_template.py @@ -30,4 +30,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/create_problem_request_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/create_problem_request_v_2.py index c062a7b9b65..1397490bc5c 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/create_problem_request_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/create_problem_request_v_2.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/deep_equality_correctness_check.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/deep_equality_correctness_check.py index b41772dfa7a..e9f446add00 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/deep_equality_correctness_check.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/deep_equality_correctness_check.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/default_provided_file.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/default_provided_file.py index b016f179335..58cc6bbb760 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/default_provided_file.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/default_provided_file.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/file_info_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/file_info_v_2.py index 37d48070f55..1d4e31b9085 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/file_info_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/file_info_v_2.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/files.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/files.py index 16615df5e97..3925e4cb24c 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/files.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation.py index 61e4ac37f2d..75f6e6acc8a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation_for_multiple_languages.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation_for_multiple_languages.py index abba99aa8a4..79d71424098 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation_for_multiple_languages.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/function_implementation_for_multiple_languages.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/generated_files.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/generated_files.py index 6a4e240ade7..c3f2ec1c6f9 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/generated_files.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/generated_files.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_request.py index ea0283acb7a..c16e7365838 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_request.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_response.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_response.py index 72c5860df77..966b7bb2d4e 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_basic_solution_file_response.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_request.py index 33feec371f4..f8b4a707abf 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_response.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_response.py index 2042c31d7da..f8bc7e6ac73 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_response.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_function_signature_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_file_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_file_request.py index df80781008f..e5c2ac5f94c 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_file_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_file_request.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_template_file_request.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_template_file_request.py index 8cde92f10a7..76f68173e1f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_template_file_request.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/get_generated_test_case_template_file_request.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/lightweight_problem_info_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/lightweight_problem_info_v_2.py index 39d8262f618..e8f60685375 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/lightweight_problem_info_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/lightweight_problem_info_v_2.py @@ -29,4 +29,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_definition.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_definition.py index 80dbc5d242c..a1f4b5e8ae8 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_definition.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_definition.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_signature.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_signature.py index 3d65e35e6bf..60d667c81a4 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_signature.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/non_void_function_signature.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/parameter.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/parameter.py index 6cfb7f4b4b0..5a5d36fa43b 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/parameter.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/parameter.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/problem_info_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/problem_info_v_2.py index 6cddb8b6488..36f40c082a0 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/problem_info_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/problem_info_v_2.py @@ -40,4 +40,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_expects.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_expects.py index 3d7d9ffc60b..fe838bddccb 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_expects.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_expects.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation.py index 72401ec9128..861710fc80d 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation_description.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation_description.py index 63770c42224..fcf32bc4d2a 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation_description.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_implementation_description.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_metadata.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_metadata.py index efe97235351..6c16d8dd4bb 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_metadata.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_metadata.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_template.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_template.py index d0bd8ef5d05..efb0c1b1ad6 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_template.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_template.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_v_2.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_v_2.py index ed62801b090..8ffddda63e5 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_v_2.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_v_2.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_with_actual_result_implementation.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_with_actual_result_implementation.py index 14d4a8a537a..8b35ae9f657 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_with_actual_result_implementation.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/test_case_with_actual_result_implementation.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition.py index 53aae482079..a967fdd0dce 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition_that_takes_actual_result.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition_that_takes_actual_result.py index 26c86c14585..92a7fb8f6cf 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition_that_takes_actual_result.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_definition_that_takes_actual_result.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature.py index cc4b122f18d..0ed8786459f 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature.py @@ -24,4 +24,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature_that_takes_actual_result.py b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature_that_takes_actual_result.py index ae05653d0eb..112e1e07341 100644 --- a/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature_that_takes_actual_result.py +++ b/seed/pydantic/trace/src/seed/trace/resources/v_2/resources/v_3/resources/problem/void_function_signature_that_takes_actual_result.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/types/bar.py b/seed/pydantic/unions/src/seed/unions/resources/types/bar.py index a644767ce72..03cd36d149b 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/types/bar.py +++ b/seed/pydantic/unions/src/seed/unions/resources/types/bar.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/types/foo.py b/seed/pydantic/unions/src/seed/unions/resources/types/foo.py index 7a9c2c2113b..cafa413aca2 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/types/foo.py +++ b/seed/pydantic/unions/src/seed/unions/resources/types/foo.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/types/union_with_base_properties.py b/seed/pydantic/unions/src/seed/unions/resources/types/union_with_base_properties.py index 59e81380cfe..679aadb4b23 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/types/union_with_base_properties.py +++ b/seed/pydantic/unions/src/seed/unions/resources/types/union_with_base_properties.py @@ -25,6 +25,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/types/union_with_literal.py b/seed/pydantic/unions/src/seed/unions/resources/types/union_with_literal.py index be3414767c1..4a23d83de9d 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/types/union_with_literal.py +++ b/seed/pydantic/unions/src/seed/unions/resources/types/union_with_literal.py @@ -25,6 +25,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/union/circle.py b/seed/pydantic/unions/src/seed/unions/resources/union/circle.py index f7872ad8684..6d0ea884cc7 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/union/circle.py +++ b/seed/pydantic/unions/src/seed/unions/resources/union/circle.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/union/get_shape_request.py b/seed/pydantic/unions/src/seed/unions/resources/union/get_shape_request.py index ad7309b007f..679d8d4c40a 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/union/get_shape_request.py +++ b/seed/pydantic/unions/src/seed/unions/resources/union/get_shape_request.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/union/shape.py b/seed/pydantic/unions/src/seed/unions/resources/union/shape.py index c0973e1e4d8..6ec8efaf93d 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/union/shape.py +++ b/seed/pydantic/unions/src/seed/unions/resources/union/shape.py @@ -27,6 +27,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unions/src/seed/unions/resources/union/square.py b/seed/pydantic/unions/src/seed/unions/resources/union/square.py index aa0e7a87a1b..f1e779af2b8 100644 --- a/seed/pydantic/unions/src/seed/unions/resources/union/square.py +++ b/seed/pydantic/unions/src/seed/unions/resources/union/square.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/pydantic/unknown/src/seed/unknown_as_any/resources/unknown/my_object.py b/seed/pydantic/unknown/src/seed/unknown_as_any/resources/unknown/my_object.py index d784a3c4150..218c35d7c6f 100644 --- a/seed/pydantic/unknown/src/seed/unknown_as_any/resources/unknown/my_object.py +++ b/seed/pydantic/unknown/src/seed/unknown_as_any/resources/unknown/my_object.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: return super().dict(**kwargs_with_defaults) class Config: + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/alias/src/seed/types/type.py b/seed/python-sdk/alias/src/seed/types/type.py index 374a077f564..326f98eccb8 100644 --- a/seed/python-sdk/alias/src/seed/types/type.py +++ b/seed/python-sdk/alias/src/seed/types/type.py @@ -38,4 +38,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 fc2c845d145..bf668a06c5c 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 e1a8766dfe2..a22f0faaa7c 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/audiences/src/seed/resources/folder_c/resources/common/types/foo.py b/seed/python-sdk/audiences/src/seed/resources/folder_c/resources/common/types/foo.py index e8e73622a76..b92cbd7fcb9 100644 --- a/seed/python-sdk/audiences/src/seed/resources/folder_c/resources/common/types/foo.py +++ b/seed/python-sdk/audiences/src/seed/resources/folder_c/resources/common/types/foo.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 8ce55677779..65b92e9ce7a 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/audiences/src/seed/resources/foo/types/importing_type.py b/seed/python-sdk/audiences/src/seed/resources/foo/types/importing_type.py index 9d722ea4897..69d98729297 100644 --- a/seed/python-sdk/audiences/src/seed/resources/foo/types/importing_type.py +++ b/seed/python-sdk/audiences/src/seed/resources/foo/types/importing_type.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/basic-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py b/seed/python-sdk/basic-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py index 46a4b536ed2..7f3af50d08f 100644 --- a/seed/python-sdk/basic-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py +++ b/seed/python-sdk/basic-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/circular-references/src/seed/resources/a/types/a.py b/seed/python-sdk/circular-references/src/seed/resources/a/types/a.py index dd1972bb66f..c5f7989b61e 100644 --- a/seed/python-sdk/circular-references/src/seed/resources/a/types/a.py +++ b/seed/python-sdk/circular-references/src/seed/resources/a/types/a.py @@ -6,6 +6,11 @@ from ....core.datetime_utils import serialize_datetime from ....types.root_type import RootType +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class A(RootType): def json(self, **kwargs: typing.Any) -> str: @@ -20,4 +25,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/circular-references/src/seed/resources/ast/types/object_value.py b/seed/python-sdk/circular-references/src/seed/resources/ast/types/object_value.py index 1e39b6b9d67..e8534cf516a 100644 --- a/seed/python-sdk/circular-references/src/seed/resources/ast/types/object_value.py +++ b/seed/python-sdk/circular-references/src/seed/resources/ast/types/object_value.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 ac0e753482c..cdabecc6c23 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/circular-references/src/seed/types/root_type.py b/seed/python-sdk/circular-references/src/seed/types/root_type.py index 271c5623723..75b30bb50b2 100644 --- a/seed/python-sdk/circular-references/src/seed/types/root_type.py +++ b/seed/python-sdk/circular-references/src/seed/types/root_type.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/custom-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py b/seed/python-sdk/custom-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py index 46a4b536ed2..7f3af50d08f 100644 --- a/seed/python-sdk/custom-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py +++ b/seed/python-sdk/custom-auth/src/seed/resources/errors/types/unauthorized_request_error_body.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/error-property/src/seed/resources/errors/types/property_based_error_test_body.py b/seed/python-sdk/error-property/src/seed/resources/errors/types/property_based_error_test_body.py index ddf53f9651c..248c4b375b7 100644 --- a/seed/python-sdk/error-property/src/seed/resources/errors/types/property_based_error_test_body.py +++ b/seed/python-sdk/error-property/src/seed/resources/errors/types/property_based_error_test_body.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/commons/resources/types/types/metadata.py b/seed/python-sdk/examples/client-filename/src/seed/resources/commons/resources/types/types/metadata.py index 94fa45b149e..1e0ae273b5e 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/commons/resources/types/types/metadata.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/commons/resources/types/types/metadata.py @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actor.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actor.py index 907c7f52119..dab9b769f0c 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actor.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actor.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actress.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actress.py index e8d54f5e587..7bdeae75545 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actress.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/actress.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/directory.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/directory.py index 8814f77ba86..d2dc7a75411 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/directory.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/directory.py @@ -55,6 +55,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/exception_info.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/exception_info.py index d202ff8af3d..dc62099ae1f 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/exception_info.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/exception_info.py @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/extended_movie.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/extended_movie.py index df10fe4f5f0..a38f691369e 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/extended_movie.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/extended_movie.py @@ -6,6 +6,11 @@ from ....core.datetime_utils import serialize_datetime from .movie import Movie +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class ExtendedMovie(Movie): """ @@ -36,4 +41,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/file.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/file.py index a24952eec7e..a034c832303 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/file.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/file.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/metadata.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/metadata.py index 308b8aee999..281f3906191 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/metadata.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/metadata.py @@ -34,6 +34,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/migration.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/migration.py index 009193f2884..be0fa34e7d6 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/migration.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/migration.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/moment.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/moment.py index dc58aa08a9c..42e85c4e7e1 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/moment.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/moment.py @@ -47,4 +47,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/movie.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/movie.py index 7b0464373f0..0fe794e7311 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/movie.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/movie.py @@ -53,4 +53,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/node.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/node.py index 0b9a2460042..dc14194345f 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/node.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/node.py @@ -57,6 +57,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/request.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/request.py index 916c95fc04b..3f48dbbcd32 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/request.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/request.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/response.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/response.py index 0393f2a81c6..4104f99f492 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/response.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/response.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/stunt_double.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/stunt_double.py index 9c8cca6f3aa..63a87b11b19 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/stunt_double.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/stunt_double.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/tree.py b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/tree.py index b05194828de..5b27bc7b5a1 100644 --- a/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/tree.py +++ b/seed/python-sdk/examples/client-filename/src/seed/resources/types/types/tree.py @@ -42,6 +42,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/commons/resources/types/types/metadata.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/commons/resources/types/types/metadata.py index 94fa45b149e..1e0ae273b5e 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/commons/resources/types/types/metadata.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/commons/resources/types/types/metadata.py @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actor.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actor.py index 907c7f52119..dab9b769f0c 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actor.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actor.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actress.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actress.py index e8d54f5e587..7bdeae75545 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actress.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/actress.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/directory.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/directory.py index 8814f77ba86..d2dc7a75411 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/directory.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/directory.py @@ -55,6 +55,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/exception_info.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/exception_info.py index d202ff8af3d..dc62099ae1f 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/exception_info.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/exception_info.py @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/extended_movie.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/extended_movie.py index df10fe4f5f0..a38f691369e 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/extended_movie.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/extended_movie.py @@ -6,6 +6,11 @@ from ....core.datetime_utils import serialize_datetime from .movie import Movie +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class ExtendedMovie(Movie): """ @@ -36,4 +41,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/file.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/file.py index a24952eec7e..a034c832303 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/file.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/file.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/metadata.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/metadata.py index 308b8aee999..281f3906191 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/metadata.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/metadata.py @@ -34,6 +34,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/migration.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/migration.py index 009193f2884..be0fa34e7d6 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/migration.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/migration.py @@ -36,4 +36,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/moment.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/moment.py index dc58aa08a9c..42e85c4e7e1 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/moment.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/moment.py @@ -47,4 +47,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/movie.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/movie.py index 7b0464373f0..0fe794e7311 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/movie.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/movie.py @@ -53,4 +53,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/node.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/node.py index 0b9a2460042..dc14194345f 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/node.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/node.py @@ -57,6 +57,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/request.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/request.py index 916c95fc04b..3f48dbbcd32 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/request.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/request.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/response.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/response.py index 0393f2a81c6..4104f99f492 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/response.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/response.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/stunt_double.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/stunt_double.py index 9c8cca6f3aa..63a87b11b19 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/stunt_double.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/stunt_double.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/tree.py b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/tree.py index b05194828de..5b27bc7b5a1 100644 --- a/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/tree.py +++ b/seed/python-sdk/examples/no-custom-config/src/seed/resources/types/types/tree.py @@ -42,6 +42,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/additional_init_exports b/seed/python-sdk/exhaustive/additional_init_exports index 39ada5cccb1..f1fa9fab542 160000 --- a/seed/python-sdk/exhaustive/additional_init_exports +++ b/seed/python-sdk/exhaustive/additional_init_exports @@ -1 +1 @@ -Subproject commit 39ada5cccb116c211d76966344a2da18c944def8 +Subproject commit f1fa9fab542fd96457fa421db49b7511a9af44bf diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/general_errors/types/bad_object_request_info.py index 4efd8af3173..3c7ba19955b 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 acf50c4ab21..4ed4201e63b 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py index c95accbe650..a820ed0155f 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_map_of_map.py index 29f82505996..136dcc71a71 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -25,4 +25,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 63852d3133b..525b5d1ed6d 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 @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_required_field.py index ca96bde6b8e..bdbef4001b1 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/cat.py index b8dba54f623..304ddbe3e19 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/cat.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/cat.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/dog.py index 02da77f9c66..ee116c9b428 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/dog.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/resources/types/resources/union/types/dog.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py index 4efd8af3173..3c7ba19955b 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 acf50c4ab21..4ed4201e63b 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py index c95accbe650..a820ed0155f 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py index 29f82505996..136dcc71a71 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -25,4 +25,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 63852d3133b..525b5d1ed6d 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 @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py index ca96bde6b8e..bdbef4001b1 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/cat.py index b8dba54f623..304ddbe3e19 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/cat.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/cat.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/dog.py index 02da77f9c66..ee116c9b428 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/dog.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/resources/types/resources/union/types/dog.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/general_errors/types/bad_object_request_info.py index 9ad3d20b091..226da85766a 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/general_errors/types/bad_object_request_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 b14be47d534..c7f376bb4ce 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_required_field.py index b6610604215..4925ff4dc04 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/nested_object_with_required_field.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_map_of_map.py index 466c765aa46..cae7772f8d4 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -25,4 +25,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 858303a4b5c..667cc78d576 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 @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_required_field.py index 186e4a8f41e..f4945e25d0d 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/object/types/object_with_required_field.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/cat.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/cat.py index 23980e31c9e..9158f853981 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/cat.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/cat.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/dog.py b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/dog.py index fe59068a387..9dc90fef452 100644 --- a/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/dog.py +++ b/seed/python-sdk/exhaustive/improved_imports/src/seed/types/union/types/dog.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py index 4efd8af3173..3c7ba19955b 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 acf50c4ab21..4ed4201e63b 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py index c95accbe650..a820ed0155f 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py index 29f82505996..136dcc71a71 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -25,4 +25,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 63852d3133b..525b5d1ed6d 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 @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py index ca96bde6b8e..bdbef4001b1 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/cat.py index b8dba54f623..304ddbe3e19 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/cat.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/cat.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/dog.py index 02da77f9c66..ee116c9b428 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/dog.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/resources/types/resources/union/types/dog.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/general_errors/types/bad_object_request_info.py index 4efd8af3173..3c7ba19955b 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 acf50c4ab21..4ed4201e63b 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py index c95accbe650..a820ed0155f 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_map_of_map.py index 29f82505996..136dcc71a71 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -25,4 +25,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 63852d3133b..525b5d1ed6d 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 @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_required_field.py index ca96bde6b8e..bdbef4001b1 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/cat.py index b8dba54f623..304ddbe3e19 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/cat.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/cat.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/dog.py index 02da77f9c66..ee116c9b428 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/dog.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/resources/types/resources/union/types/dog.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/.github/workflows/ci.yml b/seed/python-sdk/exhaustive/pydantic-extra-fields/.github/workflows/ci.yml new file mode 100644 index 00000000000..1a1ac9cae2f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: ci + +on: [push] +jobs: + compile: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Compile + run: poetry run mypy . + test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Bootstrap poetry + run: | + curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 + - name: Install dependencies + run: poetry install + - name: Test + run: poetry run pytest . diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/.gitignore b/seed/python-sdk/exhaustive/pydantic-extra-fields/.gitignore new file mode 100644 index 00000000000..42cb863501e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/.gitignore @@ -0,0 +1,4 @@ +dist/ +.mypy_cache/ +__pycache__/ +poetry.toml diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/README.md b/seed/python-sdk/exhaustive/pydantic-extra-fields/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/pyproject.toml b/seed/python-sdk/exhaustive/pydantic-extra-fields/pyproject.toml new file mode 100644 index 00000000000..4179d485219 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/pyproject.toml @@ -0,0 +1,23 @@ +[tool.poetry] +name = "seed" +version = "0.0.0" +description = "" +readme = "README.md" +authors = [] +packages = [ + { include = "seed", from = "src"} +] + +[tool.poetry.dependencies] +python = "^3.8" +httpx = ">=0.21.2" +pydantic = ">= 1.9.2" +typing_extensions = ">= 4.0.0" + +[tool.poetry.dev-dependencies] +mypy = "^1.8.0" +pytest = "^7.4.0" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json b/seed/python-sdk/exhaustive/pydantic-extra-fields/snippet.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/__init__.py new file mode 100644 index 00000000000..3616a86449e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/__init__.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from .resources import ( + BadObjectRequestInfo, + BadRequestBody, + endpoints, + general_errors, + inlined_requests, + no_auth, + no_req_body, + req_with_headers, + types, +) + +__all__ = [ + "BadObjectRequestInfo", + "BadRequestBody", + "endpoints", + "general_errors", + "inlined_requests", + "no_auth", + "no_req_body", + "req_with_headers", + "types", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/client.py new file mode 100644 index 00000000000..02262763646 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/client.py @@ -0,0 +1,94 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx + +from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .resources.endpoints.client import AsyncEndpointsClient, EndpointsClient +from .resources.inlined_requests.client import AsyncInlinedRequestsClient, InlinedRequestsClient +from .resources.no_auth.client import AsyncNoAuthClient, NoAuthClient +from .resources.no_req_body.client import AsyncNoReqBodyClient, NoReqBodyClient +from .resources.req_with_headers.client import AsyncReqWithHeadersClient, ReqWithHeadersClient + + +class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + timeout: typing.Optional[float] = 60, + httpx_client: typing.Optional[httpx.Client] = None + ): + self._client_wrapper = SyncClientWrapper( + base_url=base_url, + token=token, + httpx_client=httpx.Client(timeout=timeout) if httpx_client is None else httpx_client, + ) + self.endpoints = EndpointsClient(client_wrapper=self._client_wrapper) + self.inlined_requests = InlinedRequestsClient(client_wrapper=self._client_wrapper) + self.no_auth = NoAuthClient(client_wrapper=self._client_wrapper) + self.no_req_body = NoReqBodyClient(client_wrapper=self._client_wrapper) + self.req_with_headers = ReqWithHeadersClient(client_wrapper=self._client_wrapper) + + +class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + + def __init__( + self, + *, + base_url: str, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + timeout: typing.Optional[float] = 60, + httpx_client: typing.Optional[httpx.AsyncClient] = None + ): + self._client_wrapper = AsyncClientWrapper( + base_url=base_url, + token=token, + httpx_client=httpx.AsyncClient(timeout=timeout) if httpx_client is None else httpx_client, + ) + self.endpoints = AsyncEndpointsClient(client_wrapper=self._client_wrapper) + self.inlined_requests = AsyncInlinedRequestsClient(client_wrapper=self._client_wrapper) + self.no_auth = AsyncNoAuthClient(client_wrapper=self._client_wrapper) + self.no_req_body = AsyncNoReqBodyClient(client_wrapper=self._client_wrapper) + self.req_with_headers = AsyncReqWithHeadersClient(client_wrapper=self._client_wrapper) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/__init__.py new file mode 100644 index 00000000000..b3e43c22838 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/__init__.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +from .api_error import ApiError +from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper +from .datetime_utils import serialize_datetime +from .file import File, convert_file_dict_to_httpx_tuples +from .http_client import AsyncHttpClient, HttpClient +from .jsonable_encoder import jsonable_encoder +from .remove_none_from_dict import remove_none_from_dict +from .request_options import RequestOptions + +__all__ = [ + "ApiError", + "AsyncClientWrapper", + "AsyncHttpClient", + "BaseClientWrapper", + "File", + "HttpClient", + "RequestOptions", + "SyncClientWrapper", + "convert_file_dict_to_httpx_tuples", + "jsonable_encoder", + "remove_none_from_dict", + "serialize_datetime", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/api_error.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/api_error.py new file mode 100644 index 00000000000..2e9fc5431cd --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/api_error.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + + +class ApiError(Exception): + status_code: typing.Optional[int] + body: typing.Any + + def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None): + self.status_code = status_code + self.body = body + + def __str__(self) -> str: + return f"status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/client_wrapper.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/client_wrapper.py new file mode 100644 index 00000000000..1426c3d1643 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/client_wrapper.py @@ -0,0 +1,57 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import httpx + +from .http_client import AsyncHttpClient, HttpClient + + +class BaseClientWrapper: + def __init__(self, *, token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, base_url: str): + self._token = token + self._base_url = base_url + + def get_headers(self) -> typing.Dict[str, str]: + headers: typing.Dict[str, str] = { + "X-Fern-Language": "Python", + "X-Fern-SDK-Name": "seed", + "X-Fern-SDK-Version": "0.0.0", + } + token = self._get_token() + if token is not None: + headers["Authorization"] = f"Bearer {token}" + return headers + + def _get_token(self) -> typing.Optional[str]: + if isinstance(self._token, str) or self._token is None: + return self._token + else: + return self._token() + + def get_base_url(self) -> str: + return self._base_url + + +class SyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + base_url: str, + httpx_client: httpx.Client, + ): + super().__init__(token=token, base_url=base_url) + self.httpx_client = HttpClient(httpx_client=httpx_client) + + +class AsyncClientWrapper(BaseClientWrapper): + def __init__( + self, + *, + token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, + base_url: str, + httpx_client: httpx.AsyncClient, + ): + super().__init__(token=token, base_url=base_url) + self.httpx_client = AsyncHttpClient(httpx_client=httpx_client) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/datetime_utils.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/datetime_utils.py new file mode 100644 index 00000000000..7c9864a944c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/datetime_utils.py @@ -0,0 +1,28 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt + + +def serialize_datetime(v: dt.datetime) -> str: + """ + Serialize a datetime including timezone info. + + Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. + + UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. + """ + + def _serialize_zoned_datetime(v: dt.datetime) -> str: + if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): + # UTC is a special case where we use "Z" at the end instead of "+00:00" + return v.isoformat().replace("+00:00", "Z") + else: + # Delegate to the typical +/- offset format + return v.isoformat() + + if v.tzinfo is not None: + return _serialize_zoned_datetime(v) + else: + local_tz = dt.datetime.now().astimezone().tzinfo + localized_dt = v.replace(tzinfo=local_tz) + return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/file.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/file.py new file mode 100644 index 00000000000..cb0d40bbbf3 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/file.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +# 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[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + typing.Tuple[typing.Optional[str], FileContent], + # (filename, file (or bytes), content_type) + typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str]], + # (filename, file (or bytes), content_type, headers) + typing.Tuple[typing.Optional[str], FileContent, typing.Optional[str], typing.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]]: + """ + The format we use is a list of tuples, where the first element is the + name of the file and the second is the file object. Typically HTTPX wants + a dict, but to be able to send lists of files, you have to use the list + approach (which also works for non-lists) + https://github.com/encode/httpx/pull/1032 + """ + + httpx_tuples = [] + for key, file_like in d.items(): + if isinstance(file_like, list): + for file_like_item in file_like: + httpx_tuples.append((key, file_like_item)) + else: + httpx_tuples.append((key, file_like)) + return httpx_tuples diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/http_client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/http_client.py new file mode 100644 index 00000000000..fbbbc15ec74 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/http_client.py @@ -0,0 +1,125 @@ +# This file was auto-generated by Fern from our API Definition. + +import asyncio +import email.utils +import re +import time +import typing +from functools import wraps +from random import random + +import httpx + +INITIAL_RETRY_DELAY_SECONDS = 0.5 +MAX_RETRY_DELAY_SECONDS = 10 +MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30 + + +def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: + """ + This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. + + Inspired by the urllib3 retry implementation. + """ + retry_after_ms = response_headers.get("retry-after-ms") + if retry_after_ms is not None: + try: + return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 + except Exception: + pass + + retry_after = response_headers.get("retry-after") + if retry_after is None: + return None + + # Attempt to parse the header as an int. + if re.match(r"^\s*[0-9]+\s*$", retry_after): + seconds = float(retry_after) + # Fallback to parsing it as a date. + else: + retry_date_tuple = email.utils.parsedate_tz(retry_after) + if retry_date_tuple is None: + return None + if retry_date_tuple[9] is None: # Python 2 + # Assume UTC if no timezone was specified + # On Python2.7, parsedate_tz returns None for a timezone offset + # instead of 0 if no timezone is given, where mktime_tz treats + # a None timezone offset as local time. + retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] + + retry_date = email.utils.mktime_tz(retry_date_tuple) + seconds = retry_date - time.time() + + if seconds < 0: + seconds = 0 + + return seconds + + +def _retry_timeout(response: httpx.Response, retries: int) -> float: + """ + Determine the amount of time to wait before retrying a request. + This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff + with a jitter to determine the number of seconds to wait. + """ + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = _parse_retry_after(response.headers) + if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER: + return retry_after + + # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS. + retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) + + # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries. + timeout = retry_delay * (1 - 0.25 * random()) + return timeout if timeout >= 0 else 0 + + +def _should_retry(response: httpx.Response) -> bool: + retriable_400s = [429, 408, 409] + return response.status_code >= 500 or response.status_code in retriable_400s + + +class HttpClient: + def __init__(self, *, httpx_client: httpx.Client): + self.httpx_client = httpx_client + + # Ensure that the signature of the `request` method is the same as the `httpx.Client.request` method + @wraps(httpx.Client.request) + def request( + self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any + ) -> httpx.Response: + response = self.httpx_client.request(*args, **kwargs) + if _should_retry(response=response): + if max_retries > retries: + time.sleep(_retry_timeout(response=response, retries=retries)) + return self.request(max_retries=max_retries, retries=retries + 1, *args, **kwargs) + return response + + @wraps(httpx.Client.stream) + def stream(self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any) -> typing.Any: + return self.httpx_client.stream(*args, **kwargs) + + +class AsyncHttpClient: + def __init__(self, *, httpx_client: httpx.AsyncClient): + self.httpx_client = httpx_client + + # Ensure that the signature of the `request` method is the same as the `httpx.Client.request` method + @wraps(httpx.AsyncClient.request) + async def request( + self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any + ) -> httpx.Response: + response = await self.httpx_client.request(*args, **kwargs) + if _should_retry(response=response): + if max_retries > retries: + await asyncio.sleep(_retry_timeout(response=response, retries=retries)) + return await self.request(max_retries=max_retries, retries=retries + 1, *args, **kwargs) + return response + + @wraps(httpx.AsyncClient.request) + async def stream( + self, *args: typing.Any, max_retries: int = 0, retries: int = 0, **kwargs: typing.Any + ) -> typing.Any: + return self.httpx_client.stream(*args, **kwargs) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/jsonable_encoder.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/jsonable_encoder.py new file mode 100644 index 00000000000..37238ab6793 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/jsonable_encoder.py @@ -0,0 +1,103 @@ +# This file was auto-generated by Fern from our API Definition. + +""" +jsonable_encoder converts a Python object to a JSON-friendly dict +(e.g. datetimes to strings, Pydantic models to dicts). + +Taken from FastAPI, and made a bit simpler +https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py +""" + +import dataclasses +import datetime as dt +from collections import defaultdict +from enum import Enum +from pathlib import PurePath +from types import GeneratorType +from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +from .datetime_utils import serialize_datetime + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] + + +def generate_encoders_by_class_tuples( + type_encoder_map: Dict[Any, Callable[[Any], Any]] +) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]: + encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) + for type_, encoder in type_encoder_map.items(): + encoders_by_class_tuples[encoder] += (type_,) + return encoders_by_class_tuples + + +encoders_by_class_tuples = generate_encoders_by_class_tuples(pydantic.json.ENCODERS_BY_TYPE) + + +def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: + custom_encoder = custom_encoder or {} + if custom_encoder: + if type(obj) in custom_encoder: + return custom_encoder[type(obj)](obj) + else: + for encoder_type, encoder_instance in custom_encoder.items(): + if isinstance(obj, encoder_type): + return encoder_instance(obj) + if isinstance(obj, pydantic.BaseModel): + encoder = getattr(obj.__config__, "json_encoders", {}) + if custom_encoder: + encoder.update(custom_encoder) + obj_dict = obj.dict(by_alias=True) + if "__root__" in obj_dict: + obj_dict = obj_dict["__root__"] + return jsonable_encoder(obj_dict, custom_encoder=encoder) + if dataclasses.is_dataclass(obj): + obj_dict = dataclasses.asdict(obj) + return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) + if isinstance(obj, Enum): + return obj.value + if isinstance(obj, PurePath): + return str(obj) + if isinstance(obj, (str, int, float, type(None))): + return obj + if isinstance(obj, dt.date): + return str(obj) + if isinstance(obj, dt.datetime): + return serialize_datetime(obj) + if isinstance(obj, dict): + encoded_dict = {} + allowed_keys = set(obj.keys()) + for key, value in obj.items(): + if key in allowed_keys: + encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) + encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) + encoded_dict[encoded_key] = encoded_value + return encoded_dict + if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): + encoded_list = [] + for item in obj: + encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) + return encoded_list + + if type(obj) in pydantic.json.ENCODERS_BY_TYPE: + return pydantic.json.ENCODERS_BY_TYPE[type(obj)](obj) + for encoder, classes_tuple in encoders_by_class_tuples.items(): + if isinstance(obj, classes_tuple): + return encoder(obj) + + try: + data = dict(obj) + except Exception as e: + errors: List[Exception] = [] + errors.append(e) + try: + data = vars(obj) + except Exception as e: + errors.append(e) + raise ValueError(errors) from e + return jsonable_encoder(data, custom_encoder=custom_encoder) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/remove_none_from_dict.py new file mode 100644 index 00000000000..2da30f71337 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/remove_none_from_dict.py @@ -0,0 +1,11 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import Any, Dict, Optional + + +def remove_none_from_dict(original: Dict[str, Optional[Any]]) -> Dict[str, Any]: + new: Dict[str, Any] = {} + for key, value in original.items(): + if value is not None: + new[key] = value + return new diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/request_options.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/request_options.py new file mode 100644 index 00000000000..cd6f27a7e9b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/core/request_options.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +try: + from typing import NotRequired # type: ignore +except ImportError: + from typing_extensions import NotRequired # type: ignore + + +class RequestOptions(typing.TypedDict): + """ + Additional options for request-specific configuration when calling APIs via the SDK. + This is used primarily as an optional final parameter for service functions. + + Attributes: + - timeout_in_seconds: int. The number of seconds to await an API call before timing out. + + - max_retries: int. The max number of retries to attempt if the API call fails. + + - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict + + - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict + + - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict + """ + + timeout_in_seconds: NotRequired[int] + max_retries: NotRequired[int] + additional_headers: NotRequired[typing.Dict[str, typing.Any]] + additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] + additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/py.typed b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/py.typed new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/__init__.py new file mode 100644 index 00000000000..3e6746abfb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/__init__.py @@ -0,0 +1,16 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import endpoints, general_errors, inlined_requests, no_auth, no_req_body, req_with_headers, types +from .general_errors import BadObjectRequestInfo, BadRequestBody + +__all__ = [ + "BadObjectRequestInfo", + "BadRequestBody", + "endpoints", + "general_errors", + "inlined_requests", + "no_auth", + "no_req_body", + "req_with_headers", + "types", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/__init__.py new file mode 100644 index 00000000000..466c54f1df7 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .resources import container, enum, http_methods, object, params, primitive, union + +__all__ = ["container", "enum", "http_methods", "object", "params", "primitive", "union"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/client.py new file mode 100644 index 00000000000..fcfbb5adba8 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/client.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .resources.container.client import AsyncContainerClient, ContainerClient +from .resources.enum.client import AsyncEnumClient, EnumClient +from .resources.http_methods.client import AsyncHttpMethodsClient, HttpMethodsClient +from .resources.object.client import AsyncObjectClient, ObjectClient +from .resources.params.client import AsyncParamsClient, ParamsClient +from .resources.primitive.client import AsyncPrimitiveClient, PrimitiveClient +from .resources.union.client import AsyncUnionClient, UnionClient + + +class EndpointsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + self.container = ContainerClient(client_wrapper=self._client_wrapper) + self.enum = EnumClient(client_wrapper=self._client_wrapper) + self.http_methods = HttpMethodsClient(client_wrapper=self._client_wrapper) + self.object = ObjectClient(client_wrapper=self._client_wrapper) + self.params = ParamsClient(client_wrapper=self._client_wrapper) + self.primitive = PrimitiveClient(client_wrapper=self._client_wrapper) + self.union = UnionClient(client_wrapper=self._client_wrapper) + + +class AsyncEndpointsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + self.container = AsyncContainerClient(client_wrapper=self._client_wrapper) + self.enum = AsyncEnumClient(client_wrapper=self._client_wrapper) + self.http_methods = AsyncHttpMethodsClient(client_wrapper=self._client_wrapper) + self.object = AsyncObjectClient(client_wrapper=self._client_wrapper) + self.params = AsyncParamsClient(client_wrapper=self._client_wrapper) + self.primitive = AsyncPrimitiveClient(client_wrapper=self._client_wrapper) + self.union = AsyncUnionClient(client_wrapper=self._client_wrapper) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/__init__.py new file mode 100644 index 00000000000..92307cab7fe --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import container, enum, http_methods, object, params, primitive, union + +__all__ = ["container", "enum", "http_methods", "object", "params", "primitive", "union"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/client.py new file mode 100644 index 00000000000..671afc2dd38 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/container/client.py @@ -0,0 +1,656 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions +from ....types.resources.object.types.object_with_required_field import ObjectWithRequiredField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ContainerClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_list_of_primitives( + self, *, request: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[str]: + """ + Parameters: + - request: typing.Sequence[str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/list-of-primitives"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.List[str], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_list_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Sequence[ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/list-of-objects"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.List[ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_set_of_primitives( + self, *, request: typing.Set[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Set[str]: + """ + Parameters: + - request: typing.Set[str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/set-of-primitives"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Set[str], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_set_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Sequence[ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/set-of-objects"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.List[ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_map_prim_to_prim( + self, *, request: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Dict[str, str]: + """ + Parameters: + - request: typing.Dict[str, str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/map-prim-to-prim"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Dict[str, str], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_map_of_prim_to_object( + self, + *, + request: typing.Dict[str, ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Dict[str, ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Dict[str, ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/map-prim-to-object"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Dict[str, ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_optional( + self, + *, + request: typing.Optional[ObjectWithRequiredField] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Optional[ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Optional[ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/opt-objects"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Optional[ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncContainerClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_list_of_primitives( + self, *, request: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[str]: + """ + Parameters: + - request: typing.Sequence[str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/list-of-primitives"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.List[str], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_list_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Sequence[ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/list-of-objects"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.List[ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_set_of_primitives( + self, *, request: typing.Set[str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Set[str]: + """ + Parameters: + - request: typing.Set[str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/set-of-primitives"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Set[str], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_set_of_objects( + self, + *, + request: typing.Sequence[ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.List[ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Sequence[ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/set-of-objects"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.List[ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_map_prim_to_prim( + self, *, request: typing.Dict[str, str], request_options: typing.Optional[RequestOptions] = None + ) -> typing.Dict[str, str]: + """ + Parameters: + - request: typing.Dict[str, str]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/map-prim-to-prim"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Dict[str, str], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_map_of_prim_to_object( + self, + *, + request: typing.Dict[str, ObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Dict[str, ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Dict[str, ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/map-prim-to-object"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Dict[str, ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_optional( + self, + *, + request: typing.Optional[ObjectWithRequiredField] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> typing.Optional[ObjectWithRequiredField]: + """ + Parameters: + - request: typing.Optional[ObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "container/opt-objects"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(typing.Optional[ObjectWithRequiredField], _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/client.py new file mode 100644 index 00000000000..cdfc2dfab13 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/enum/client.py @@ -0,0 +1,106 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions +from ....types.resources.enum.types.weather_report import WeatherReport + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class EnumClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_enum( + self, *, request: WeatherReport, request_options: typing.Optional[RequestOptions] = None + ) -> WeatherReport: + """ + Parameters: + - request: WeatherReport. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "enum"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(WeatherReport, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncEnumClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_enum( + self, *, request: WeatherReport, request_options: typing.Optional[RequestOptions] = None + ) -> WeatherReport: + """ + Parameters: + - request: WeatherReport. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "enum"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(WeatherReport, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/client.py new file mode 100644 index 00000000000..97455b78236 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/http_methods/client.py @@ -0,0 +1,437 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions +from ....types.resources.object.types.object_with_optional_field import ObjectWithOptionalField +from ....types.resources.object.types.object_with_required_field import ObjectWithRequiredField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class HttpMethodsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def test_get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters: + - id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_post( + self, *, request: ObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - request: ObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "http-methods"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_put( + self, id: str, *, request: ObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - id: str. + + - request: ObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_patch( + self, id: str, *, request: ObjectWithOptionalField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - id: str. + + - request: ObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "PATCH", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def test_delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> bool: + """ + Parameters: + - id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "DELETE", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(bool, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncHttpMethodsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def test_get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters: + - id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_post( + self, *, request: ObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - request: ObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "http-methods"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_put( + self, id: str, *, request: ObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - id: str. + + - request: ObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_patch( + self, id: str, *, request: ObjectWithOptionalField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - id: str. + + - request: ObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "PATCH", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def test_delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> bool: + """ + Parameters: + - id: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "DELETE", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"http-methods/{jsonable_encoder(id)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(bool, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/client.py new file mode 100644 index 00000000000..6e41829761f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/object/client.py @@ -0,0 +1,576 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions +from ....types.resources.object.types.nested_object_with_optional_field import NestedObjectWithOptionalField +from ....types.resources.object.types.nested_object_with_required_field import NestedObjectWithRequiredField +from ....types.resources.object.types.object_with_map_of_map import ObjectWithMapOfMap +from ....types.resources.object.types.object_with_optional_field import ObjectWithOptionalField +from ....types.resources.object.types.object_with_required_field import ObjectWithRequiredField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ObjectClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_with_optional_field( + self, *, request: ObjectWithOptionalField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - request: ObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-with-optional-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_with_required_field( + self, *, request: ObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithRequiredField: + """ + Parameters: + - request: ObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-with-required-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithRequiredField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_with_map_of_map( + self, *, request: ObjectWithMapOfMap, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithMapOfMap: + """ + Parameters: + - request: ObjectWithMapOfMap. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-with-map-of-map"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithMapOfMap, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_nested_with_optional_field( + self, *, request: NestedObjectWithOptionalField, request_options: typing.Optional[RequestOptions] = None + ) -> NestedObjectWithOptionalField: + """ + Parameters: + - request: NestedObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-nested-with-optional-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(NestedObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_nested_with_required_field( + self, *, request: NestedObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> NestedObjectWithRequiredField: + """ + Parameters: + - request: NestedObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-nested-with-required-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(NestedObjectWithRequiredField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_nested_with_required_field_as_list( + self, + *, + request: typing.Sequence[NestedObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithRequiredField: + """ + Parameters: + - request: typing.Sequence[NestedObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-nested-with-required-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(NestedObjectWithRequiredField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncObjectClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_with_optional_field( + self, *, request: ObjectWithOptionalField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - request: ObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-with-optional-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_with_required_field( + self, *, request: ObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithRequiredField: + """ + Parameters: + - request: ObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-with-required-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithRequiredField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_with_map_of_map( + self, *, request: ObjectWithMapOfMap, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithMapOfMap: + """ + Parameters: + - request: ObjectWithMapOfMap. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-with-map-of-map"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithMapOfMap, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_nested_with_optional_field( + self, *, request: NestedObjectWithOptionalField, request_options: typing.Optional[RequestOptions] = None + ) -> NestedObjectWithOptionalField: + """ + Parameters: + - request: NestedObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-nested-with-optional-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(NestedObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_nested_with_required_field( + self, *, request: NestedObjectWithRequiredField, request_options: typing.Optional[RequestOptions] = None + ) -> NestedObjectWithRequiredField: + """ + Parameters: + - request: NestedObjectWithRequiredField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-nested-with-required-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(NestedObjectWithRequiredField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_nested_with_required_field_as_list( + self, + *, + request: typing.Sequence[NestedObjectWithRequiredField], + request_options: typing.Optional[RequestOptions] = None, + ) -> NestedObjectWithRequiredField: + """ + Parameters: + - request: typing.Sequence[NestedObjectWithRequiredField]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin( + f"{self._client_wrapper.get_base_url()}/", "object/get-and-return-nested-with-required-field" + ), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(NestedObjectWithRequiredField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/client.py new file mode 100644 index 00000000000..7e405ed9979 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/params/client.py @@ -0,0 +1,499 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ParamsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_with_path(self, param: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + GET with path param + + Parameters: + - param: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"params/path/{jsonable_encoder(param)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_with_query( + self, *, query: str, number: int, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with query param + + Parameters: + - query: str. + + - number: int. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "params"), + params=jsonable_encoder( + remove_none_from_dict( + { + "query": query, + "number": number, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_with_allow_multiple_query( + self, + *, + query: typing.Union[str, typing.Sequence[str]], + numer: typing.Union[int, typing.Sequence[int]], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + GET with multiple of same query param + + Parameters: + - query: typing.Union[str, typing.Sequence[str]]. + + - numer: typing.Union[int, typing.Sequence[int]]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "params"), + params=jsonable_encoder( + remove_none_from_dict( + { + "query": query, + "numer": numer, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_with_path_and_query( + self, param: str, *, query: str, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with path and query params + + Parameters: + - param: str. + + - query: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"params/path/{jsonable_encoder(param)}"), + params=jsonable_encoder( + remove_none_from_dict( + { + "query": query, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def modify_with_path( + self, param: str, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + PUT to update with path param + + Parameters: + - param: str. + + - request: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"params/path/{jsonable_encoder(param)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncParamsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_with_path(self, param: str, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + GET with path param + + Parameters: + - param: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"params/path/{jsonable_encoder(param)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_with_query( + self, *, query: str, number: int, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with query param + + Parameters: + - query: str. + + - number: int. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "params"), + params=jsonable_encoder( + remove_none_from_dict( + { + "query": query, + "number": number, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_with_allow_multiple_query( + self, + *, + query: typing.Union[str, typing.Sequence[str]], + numer: typing.Union[int, typing.Sequence[int]], + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + GET with multiple of same query param + + Parameters: + - query: typing.Union[str, typing.Sequence[str]]. + + - numer: typing.Union[int, typing.Sequence[int]]. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "params"), + params=jsonable_encoder( + remove_none_from_dict( + { + "query": query, + "numer": numer, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_with_path_and_query( + self, param: str, *, query: str, request_options: typing.Optional[RequestOptions] = None + ) -> None: + """ + GET with path and query params + + Parameters: + - param: str. + + - query: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"params/path/{jsonable_encoder(param)}"), + params=jsonable_encoder( + remove_none_from_dict( + { + "query": query, + **( + request_options.get("additional_query_parameters", {}) + if request_options is not None + else {} + ), + } + ) + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def modify_with_path( + self, param: str, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + PUT to update with path param + + Parameters: + - param: str. + + - request: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "PUT", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"params/path/{jsonable_encoder(param)}"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/client.py new file mode 100644 index 00000000000..d165735ef9a --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/primitive/client.py @@ -0,0 +1,753 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +import urllib.parse +import uuid +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class PrimitiveClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_string(self, *, request: str, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters: + - request: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/string"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_int(self, *, request: int, request_options: typing.Optional[RequestOptions] = None) -> int: + """ + Parameters: + - request: int. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/integer"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(int, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_long(self, *, request: int, request_options: typing.Optional[RequestOptions] = None) -> int: + """ + Parameters: + - request: int. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/long"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(int, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_double( + self, *, request: float, request_options: typing.Optional[RequestOptions] = None + ) -> float: + """ + Parameters: + - request: float. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/double"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(float, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_bool(self, *, request: bool, request_options: typing.Optional[RequestOptions] = None) -> bool: + """ + Parameters: + - request: bool. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/boolean"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(bool, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_datetime( + self, *, request: dt.datetime, request_options: typing.Optional[RequestOptions] = None + ) -> dt.datetime: + """ + Parameters: + - request: dt.datetime. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/datetime"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(dt.datetime, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_date( + self, *, request: dt.date, request_options: typing.Optional[RequestOptions] = None + ) -> dt.date: + """ + Parameters: + - request: dt.date. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/date"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(dt.date, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_uuid( + self, *, request: uuid.UUID, request_options: typing.Optional[RequestOptions] = None + ) -> uuid.UUID: + """ + Parameters: + - request: uuid.UUID. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/uuid"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(uuid.UUID, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def get_and_return_base_64(self, *, request: str, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters: + - request: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/base64"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncPrimitiveClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_string( + self, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + Parameters: + - request: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/string"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_int(self, *, request: int, request_options: typing.Optional[RequestOptions] = None) -> int: + """ + Parameters: + - request: int. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/integer"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(int, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_long( + self, *, request: int, request_options: typing.Optional[RequestOptions] = None + ) -> int: + """ + Parameters: + - request: int. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/long"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(int, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_double( + self, *, request: float, request_options: typing.Optional[RequestOptions] = None + ) -> float: + """ + Parameters: + - request: float. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/double"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(float, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_bool( + self, *, request: bool, request_options: typing.Optional[RequestOptions] = None + ) -> bool: + """ + Parameters: + - request: bool. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/boolean"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(bool, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_datetime( + self, *, request: dt.datetime, request_options: typing.Optional[RequestOptions] = None + ) -> dt.datetime: + """ + Parameters: + - request: dt.datetime. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/datetime"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(dt.datetime, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_date( + self, *, request: dt.date, request_options: typing.Optional[RequestOptions] = None + ) -> dt.date: + """ + Parameters: + - request: dt.date. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/date"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(dt.date, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_uuid( + self, *, request: uuid.UUID, request_options: typing.Optional[RequestOptions] = None + ) -> uuid.UUID: + """ + Parameters: + - request: uuid.UUID. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/uuid"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(uuid.UUID, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def get_and_return_base_64( + self, *, request: str, request_options: typing.Optional[RequestOptions] = None + ) -> str: + """ + Parameters: + - request: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "primitive/base64"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/client.py new file mode 100644 index 00000000000..da0f09ad3fe --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/endpoints/resources/union/client.py @@ -0,0 +1,116 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.jsonable_encoder import jsonable_encoder +from .....core.remove_none_from_dict import remove_none_from_dict +from .....core.request_options import RequestOptions +from ....types.resources.union.types.animal import Animal + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class UnionClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_and_return_union( + self, *, request: Animal, request_options: typing.Optional[RequestOptions] = None + ) -> Animal: + """ + Parameters: + - request: Animal. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "union"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(Animal, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncUnionClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_and_return_union( + self, *, request: Animal, request_options: typing.Optional[RequestOptions] = None + ) -> Animal: + """ + Parameters: + - request: Animal. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "union"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(Animal, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/__init__.py new file mode 100644 index 00000000000..57de0a862e9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import BadObjectRequestInfo +from .errors import BadRequestBody + +__all__ = ["BadObjectRequestInfo", "BadRequestBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/__init__.py new file mode 100644 index 00000000000..04eaf8e383b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .bad_request_body import BadRequestBody + +__all__ = ["BadRequestBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/bad_request_body.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/bad_request_body.py new file mode 100644 index 00000000000..7ca134935a1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/errors/bad_request_body.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ....core.api_error import ApiError +from ..types.bad_object_request_info import BadObjectRequestInfo + + +class BadRequestBody(ApiError): + def __init__(self, body: BadObjectRequestInfo): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/__init__.py new file mode 100644 index 00000000000..b6788a57056 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .bad_object_request_info import BadObjectRequestInfo + +__all__ = ["BadObjectRequestInfo"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/bad_object_request_info.py new file mode 100644 index 00000000000..3c7ba19955b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ....core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class BadObjectRequestInfo(pydantic.BaseModel): + message: str + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/client.py new file mode 100644 index 00000000000..13d5bacd2c9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/inlined_requests/client.py @@ -0,0 +1,144 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions +from ..general_errors.errors.bad_request_body import BadRequestBody +from ..general_errors.types.bad_object_request_info import BadObjectRequestInfo +from ..types.resources.object.types.object_with_optional_field import ObjectWithOptionalField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class InlinedRequestsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def post_with_object_bodyand_response( + self, + *, + string: str, + integer: int, + nested_object: ObjectWithOptionalField, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + POST with custom object in request body, response is an object + + Parameters: + - string: str. + + - integer: int. + + - nested_object: ObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "req-bodies/object"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"string": string, "integer": integer, "NestedObject": nested_object}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"string": string, "integer": integer, "NestedObject": nested_object}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestBody(pydantic.parse_obj_as(BadObjectRequestInfo, _response.json())) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncInlinedRequestsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def post_with_object_bodyand_response( + self, + *, + string: str, + integer: int, + nested_object: ObjectWithOptionalField, + request_options: typing.Optional[RequestOptions] = None, + ) -> ObjectWithOptionalField: + """ + POST with custom object in request body, response is an object + + Parameters: + - string: str. + + - integer: int. + + - nested_object: ObjectWithOptionalField. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "req-bodies/object"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder({"string": string, "integer": integer, "NestedObject": nested_object}) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder({"string": string, "integer": integer, "NestedObject": nested_object}), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestBody(pydantic.parse_obj_as(BadObjectRequestInfo, _response.json())) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/client.py new file mode 100644 index 00000000000..0b1118c1e45 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_auth/client.py @@ -0,0 +1,125 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions +from ..general_errors.errors.bad_request_body import BadRequestBody +from ..general_errors.types.bad_object_request_info import BadObjectRequestInfo + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class NoAuthClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def post_with_no_auth( + self, *, request: typing.Any, request_options: typing.Optional[RequestOptions] = None + ) -> bool: + """ + POST request with no auth + + Parameters: + - request: typing.Any. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "no-auth"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(bool, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestBody(pydantic.parse_obj_as(BadObjectRequestInfo, _response.json())) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncNoAuthClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def post_with_no_auth( + self, *, request: typing.Any, request_options: typing.Optional[RequestOptions] = None + ) -> bool: + """ + POST request with no auth + + Parameters: + - request: typing.Any. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "no-auth"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request) + if request_options is None or request_options.get("additional_body_parameters") is None + else { + **jsonable_encoder(request), + **(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))), + }, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(bool, _response.json()) # type: ignore + if _response.status_code == 400: + raise BadRequestBody(pydantic.parse_obj_as(BadObjectRequestInfo, _response.json())) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/client.py new file mode 100644 index 00000000000..a99d4b1c85e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/no_req_body/client.py @@ -0,0 +1,169 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions +from ..types.resources.object.types.object_with_optional_field import ObjectWithOptionalField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class NoReqBodyClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_with_no_request_body( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "no-req-body"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + def post_with_no_request_body(self, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "no-req-body"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {}))) + if request_options is not None + else None, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncNoReqBodyClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_with_no_request_body( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ObjectWithOptionalField: + """ + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "GET", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "no-req-body"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(ObjectWithOptionalField, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + async def post_with_no_request_body(self, *, request_options: typing.Optional[RequestOptions] = None) -> str: + """ + Parameters: + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "no-req-body"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {}))) + if request_options is not None + else None, + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return pydantic.parse_obj_as(str, _response.json()) # type: ignore + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/__init__.py new file mode 100644 index 00000000000..f3ea2659bb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/__init__.py @@ -0,0 +1,2 @@ +# This file was auto-generated by Fern from our API Definition. + diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/client.py new file mode 100644 index 00000000000..a159f6205b0 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/req_with_headers/client.py @@ -0,0 +1,122 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +import urllib.parse +from json.decoder import JSONDecodeError + +from ...core.api_error import ApiError +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from ...core.jsonable_encoder import jsonable_encoder +from ...core.remove_none_from_dict import remove_none_from_dict +from ...core.request_options import RequestOptions + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ReqWithHeadersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def get_with_custom_header( + self, + *, + request: str, + x_test_service_header: str, + x_test_endpoint_header: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Parameters: + - request: str. + + - x_test_service_header: str. + + - x_test_endpoint_header: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "test-headers/custom-header"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + "X-TEST-SERVICE-HEADER": x_test_service_header, + "X-TEST-ENDPOINT-HEADER": x_test_endpoint_header, + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) + + +class AsyncReqWithHeadersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def get_with_custom_header( + self, + *, + request: str, + x_test_service_header: str, + x_test_endpoint_header: str, + request_options: typing.Optional[RequestOptions] = None, + ) -> None: + """ + Parameters: + - request: str. + + - x_test_service_header: str. + + - x_test_endpoint_header: str. + + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. + """ + _response = await self._client_wrapper.httpx_client.request( + "POST", + urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "test-headers/custom-header"), + params=jsonable_encoder( + request_options.get("additional_query_parameters") if request_options is not None else None + ), + json=jsonable_encoder(request), + headers=jsonable_encoder( + remove_none_from_dict( + { + **self._client_wrapper.get_headers(), + "X-TEST-SERVICE-HEADER": x_test_service_header, + "X-TEST-ENDPOINT-HEADER": x_test_endpoint_header, + **(request_options.get("additional_headers", {}) if request_options is not None else {}), + } + ) + ), + timeout=request_options.get("timeout_in_seconds") + if request_options is not None and request_options.get("timeout_in_seconds") is not None + else 60, + retries=0, + max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore + ) + if 200 <= _response.status_code < 300: + return + try: + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, body=_response.text) + raise ApiError(status_code=_response.status_code, body=_response_json) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/__init__.py new file mode 100644 index 00000000000..b54f8fbcd4c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/__init__.py @@ -0,0 +1,47 @@ +# This file was auto-generated by Fern from our API Definition. + +from .resources import ( + Animal, + Animal_Cat, + Animal_Dog, + Cat, + Dog, + ErrorWithEnumBody, + ErrorWithUnionBody, + NestedObjectWithOptionalField, + NestedObjectWithOptionalFieldError, + NestedObjectWithRequiredField, + NestedObjectWithRequiredFieldError, + ObjectWithMapOfMap, + ObjectWithOptionalField, + ObjectWithOptionalFieldError, + ObjectWithRequiredField, + ObjectWithRequiredFieldError, + WeatherReport, + enum, + object, + union, +) + +__all__ = [ + "Animal", + "Animal_Cat", + "Animal_Dog", + "Cat", + "Dog", + "ErrorWithEnumBody", + "ErrorWithUnionBody", + "NestedObjectWithOptionalField", + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredField", + "NestedObjectWithRequiredFieldError", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredField", + "ObjectWithRequiredFieldError", + "WeatherReport", + "enum", + "object", + "union", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/__init__.py new file mode 100644 index 00000000000..ef45ef4850d --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/__init__.py @@ -0,0 +1,39 @@ +# This file was auto-generated by Fern from our API Definition. + +from . import enum, object, union +from .enum import ErrorWithEnumBody, WeatherReport +from .object import ( + NestedObjectWithOptionalField, + NestedObjectWithOptionalFieldError, + NestedObjectWithRequiredField, + NestedObjectWithRequiredFieldError, + ObjectWithMapOfMap, + ObjectWithOptionalField, + ObjectWithOptionalFieldError, + ObjectWithRequiredField, + ObjectWithRequiredFieldError, +) +from .union import Animal, Animal_Cat, Animal_Dog, Cat, Dog, ErrorWithUnionBody + +__all__ = [ + "Animal", + "Animal_Cat", + "Animal_Dog", + "Cat", + "Dog", + "ErrorWithEnumBody", + "ErrorWithUnionBody", + "NestedObjectWithOptionalField", + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredField", + "NestedObjectWithRequiredFieldError", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredField", + "ObjectWithRequiredFieldError", + "WeatherReport", + "enum", + "object", + "union", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/__init__.py new file mode 100644 index 00000000000..b1c48999a72 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import WeatherReport +from .errors import ErrorWithEnumBody + +__all__ = ["ErrorWithEnumBody", "WeatherReport"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/__init__.py new file mode 100644 index 00000000000..f5945e36d9d --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .error_with_enum_body import ErrorWithEnumBody + +__all__ = ["ErrorWithEnumBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/error_with_enum_body.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/error_with_enum_body.py new file mode 100644 index 00000000000..b38481a1017 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/errors/error_with_enum_body.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.api_error import ApiError +from ..types.weather_report import WeatherReport + + +class ErrorWithEnumBody(ApiError): + def __init__(self, body: WeatherReport): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/__init__.py new file mode 100644 index 00000000000..7a47d1fefc6 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .weather_report import WeatherReport + +__all__ = ["WeatherReport"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/weather_report.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/weather_report.py new file mode 100644 index 00000000000..0f2fc3aee2a --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/enum/types/weather_report.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class WeatherReport(str, enum.Enum): + SUNNY = "SUNNY" + CLOUDY = "CLOUDY" + RAINING = "RAINING" + SNOWING = "SNOWING" + + def visit( + self, + sunny: typing.Callable[[], T_Result], + cloudy: typing.Callable[[], T_Result], + raining: typing.Callable[[], T_Result], + snowing: typing.Callable[[], T_Result], + ) -> T_Result: + if self is WeatherReport.SUNNY: + return sunny() + if self is WeatherReport.CLOUDY: + return cloudy() + if self is WeatherReport.RAINING: + return raining() + if self is WeatherReport.SNOWING: + return snowing() diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/__init__.py new file mode 100644 index 00000000000..3b74145a251 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/__init__.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import ( + NestedObjectWithOptionalField, + NestedObjectWithRequiredField, + ObjectWithMapOfMap, + ObjectWithOptionalField, + ObjectWithRequiredField, +) +from .errors import ( + NestedObjectWithOptionalFieldError, + NestedObjectWithRequiredFieldError, + ObjectWithOptionalFieldError, + ObjectWithRequiredFieldError, +) + +__all__ = [ + "NestedObjectWithOptionalField", + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredField", + "NestedObjectWithRequiredFieldError", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredField", + "ObjectWithRequiredFieldError", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/__init__.py new file mode 100644 index 00000000000..7e7e4c63aa8 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/__init__.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from .nested_object_with_optional_field_error import NestedObjectWithOptionalFieldError +from .nested_object_with_required_field_error import NestedObjectWithRequiredFieldError +from .object_with_optional_field_error import ObjectWithOptionalFieldError +from .object_with_required_field_error import ObjectWithRequiredFieldError + +__all__ = [ + "NestedObjectWithOptionalFieldError", + "NestedObjectWithRequiredFieldError", + "ObjectWithOptionalFieldError", + "ObjectWithRequiredFieldError", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_optional_field_error.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_optional_field_error.py new file mode 100644 index 00000000000..06f5bab4ae9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_optional_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.api_error import ApiError +from ..types.nested_object_with_optional_field import NestedObjectWithOptionalField + + +class NestedObjectWithOptionalFieldError(ApiError): + def __init__(self, body: NestedObjectWithOptionalField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_required_field_error.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_required_field_error.py new file mode 100644 index 00000000000..f97ea3f6d2c --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/nested_object_with_required_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.api_error import ApiError +from ..types.nested_object_with_required_field import NestedObjectWithRequiredField + + +class NestedObjectWithRequiredFieldError(ApiError): + def __init__(self, body: NestedObjectWithRequiredField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_optional_field_error.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_optional_field_error.py new file mode 100644 index 00000000000..0b1067ca30e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_optional_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.api_error import ApiError +from ..types.object_with_optional_field import ObjectWithOptionalField + + +class ObjectWithOptionalFieldError(ApiError): + def __init__(self, body: ObjectWithOptionalField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_required_field_error.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_required_field_error.py new file mode 100644 index 00000000000..cb158d3b8df --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/errors/object_with_required_field_error.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.api_error import ApiError +from ..types.object_with_required_field import ObjectWithRequiredField + + +class ObjectWithRequiredFieldError(ApiError): + def __init__(self, body: ObjectWithRequiredField): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/__init__.py new file mode 100644 index 00000000000..616060b4b00 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/__init__.py @@ -0,0 +1,15 @@ +# This file was auto-generated by Fern from our API Definition. + +from .nested_object_with_optional_field import NestedObjectWithOptionalField +from .nested_object_with_required_field import NestedObjectWithRequiredField +from .object_with_map_of_map import ObjectWithMapOfMap +from .object_with_optional_field import ObjectWithOptionalField +from .object_with_required_field import ObjectWithRequiredField + +__all__ = [ + "NestedObjectWithOptionalField", + "NestedObjectWithRequiredField", + "ObjectWithMapOfMap", + "ObjectWithOptionalField", + "ObjectWithRequiredField", +] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py new file mode 100644 index 00000000000..4ed4201e63b --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_optional_field.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ......core.datetime_utils import serialize_datetime +from .object_with_optional_field import ObjectWithOptionalField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class NestedObjectWithOptionalField(pydantic.BaseModel): + 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} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py new file mode 100644 index 00000000000..a820ed0155f --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ......core.datetime_utils import serialize_datetime +from .object_with_optional_field import ObjectWithOptionalField + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class NestedObjectWithRequiredField(pydantic.BaseModel): + string: str + nested_object: ObjectWithOptionalField = pydantic.Field(alias="NestedObject") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_map_of_map.py new file mode 100644 index 00000000000..136dcc71a71 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ......core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ObjectWithMapOfMap(pydantic.BaseModel): + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_optional_field.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_optional_field.py new file mode 100644 index 00000000000..525b5d1ed6d --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_optional_field.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +import uuid + +from ......core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ObjectWithOptionalField(pydantic.BaseModel): + string: typing.Optional[str] = None + integer: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) + double: typing.Optional[float] = 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.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) + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_required_field.py new file mode 100644 index 00000000000..bdbef4001b1 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ......core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class ObjectWithRequiredField(pydantic.BaseModel): + string: str + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/__init__.py new file mode 100644 index 00000000000..30187ae029e --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/__init__.py @@ -0,0 +1,6 @@ +# This file was auto-generated by Fern from our API Definition. + +from .types import Animal, Animal_Cat, Animal_Dog, Cat, Dog +from .errors import ErrorWithUnionBody + +__all__ = ["Animal", "Animal_Cat", "Animal_Dog", "Cat", "Dog", "ErrorWithUnionBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/__init__.py new file mode 100644 index 00000000000..568a71fa3c4 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/__init__.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +from .error_with_union_body import ErrorWithUnionBody + +__all__ = ["ErrorWithUnionBody"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/error_with_union_body.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/error_with_union_body.py new file mode 100644 index 00000000000..6a424766648 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/errors/error_with_union_body.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from ......core.api_error import ApiError +from ..types.animal import Animal + + +class ErrorWithUnionBody(ApiError): + def __init__(self, body: Animal): + super().__init__(status_code=400, body=body) diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/__init__.py new file mode 100644 index 00000000000..44ff66be5d9 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/__init__.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +from .animal import Animal, Animal_Cat, Animal_Dog +from .cat import Cat +from .dog import Dog + +__all__ = ["Animal", "Animal_Cat", "Animal_Dog", "Cat", "Dog"] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/animal.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/animal.py new file mode 100644 index 00000000000..82bbdbef8ad --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/animal.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from .cat import Cat +from .dog import Dog + + +class Animal_Dog(Dog): + animal: typing.Literal["dog"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +class Animal_Cat(Cat): + animal: typing.Literal["cat"] + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + + +Animal = typing.Union[Animal_Dog, Animal_Cat] diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/cat.py new file mode 100644 index 00000000000..304ddbe3e19 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/cat.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ......core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class Cat(pydantic.BaseModel): + name: str + likes_to_meow: bool = pydantic.Field(alias="likesToMeow") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/dog.py new file mode 100644 index 00000000000..ee116c9b428 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/src/seed/resources/types/resources/union/types/dog.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from ......core.datetime_utils import serialize_datetime + +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + + +class Dog(pydantic.BaseModel): + name: str + likes_to_woof: bool = pydantic.Field(alias="likesToWoof") + + def json(self, **kwargs: typing.Any) -> str: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().json(**kwargs_with_defaults) + + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: + kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} + return super().dict(**kwargs_with_defaults) + + class Config: + frozen = True + smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow + json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/__init__.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_client.py b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_client.py new file mode 100644 index 00000000000..60a58e64c27 --- /dev/null +++ b/seed/python-sdk/exhaustive/pydantic-extra-fields/tests/test_client.py @@ -0,0 +1,6 @@ +import pytest + +# Get started with writing tests with pytest at https://docs.pytest.org +@pytest.mark.skip(reason="Unimplemented") +def test_client() -> None: + assert True == True diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/general_errors/types/bad_object_request_info.py index 5b73d73f36b..2f4c7b45585 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -22,4 +22,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 1028ba391f7..d3012228171 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 @@ -25,4 +25,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py index 62bee8eadb6..714b9d7be3c 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -25,4 +25,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_map_of_map.py index b56cf538ab1..67c1eb55e2f 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -9,7 +9,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -22,4 +22,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 d63a2b97842..c48dd3553c5 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 @@ -12,16 +12,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -35,4 +35,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_required_field.py index 70da66f924e..2a248b80877 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -22,4 +22,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/cat.py index 059cd940cda..249da7c8b32 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/cat.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/cat.py @@ -24,4 +24,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/dog.py index 847d9a007c3..2a2a6a63451 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/dog.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/resources/types/resources/union/types/dog.py @@ -24,4 +24,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/general_errors/types/bad_object_request_info.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/general_errors/types/bad_object_request_info.py index 4efd8af3173..3c7ba19955b 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/general_errors/types/bad_object_request_info.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/general_errors/types/bad_object_request_info.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 acf50c4ab21..4ed4201e63b 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py index c95accbe650..a820ed0155f 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/nested_object_with_required_field.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_map_of_map.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_map_of_map.py index 29f82505996..136dcc71a71 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_map_of_map.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_map_of_map.py @@ -12,7 +12,7 @@ class ObjectWithMapOfMap(pydantic.BaseModel): - map: typing.Dict[str, typing.Dict[str, str]] + map_: typing.Dict[str, typing.Dict[str, str]] = pydantic.Field(alias="map") def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -25,4 +25,6 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 63852d3133b..525b5d1ed6d 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 @@ -15,16 +15,16 @@ class ObjectWithOptionalField(pydantic.BaseModel): string: typing.Optional[str] = None integer: typing.Optional[int] = None - long: typing.Optional[int] = None + long_: typing.Optional[int] = pydantic.Field(alias="long", default=None) double: typing.Optional[float] = None - bool: typing.Optional[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.Optional[uuid.UUID] = 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]] = None - set: typing.Optional[typing.Set[str]] = None - map: typing.Optional[typing.Dict[int, str]] = 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) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_required_field.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_required_field.py index ca96bde6b8e..bdbef4001b1 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_required_field.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/object/types/object_with_required_field.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/animal.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/animal.py index c712f31c405..c4a305a19af 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/animal.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/animal.py @@ -62,6 +62,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/cat.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/cat.py index b8dba54f623..304ddbe3e19 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/cat.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/cat.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/dog.py b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/dog.py index 02da77f9c66..ee116c9b428 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/dog.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/resources/types/resources/union/types/dog.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/extends/src/seed/types/docs.py b/seed/python-sdk/extends/src/seed/types/docs.py index 66594cc7c9a..7788e166ce8 100644 --- a/seed/python-sdk/extends/src/seed/types/docs.py +++ b/seed/python-sdk/extends/src/seed/types/docs.py @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/extends/src/seed/types/example_type.py b/seed/python-sdk/extends/src/seed/types/example_type.py index 48b8e0f3f1c..a654af3acfa 100644 --- a/seed/python-sdk/extends/src/seed/types/example_type.py +++ b/seed/python-sdk/extends/src/seed/types/example_type.py @@ -6,6 +6,11 @@ from ..core.datetime_utils import serialize_datetime from .docs import Docs +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class ExampleType(Docs): """ @@ -31,4 +36,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/extends/src/seed/types/json.py b/seed/python-sdk/extends/src/seed/types/json.py index 6a6b558b5aa..b970396bdb8 100644 --- a/seed/python-sdk/extends/src/seed/types/json.py +++ b/seed/python-sdk/extends/src/seed/types/json.py @@ -6,6 +6,11 @@ from ..core.datetime_utils import serialize_datetime from .docs import Docs +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class Json(Docs): """ @@ -31,4 +36,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/extends/src/seed/types/nested_type.py b/seed/python-sdk/extends/src/seed/types/nested_type.py index 5f6f5d8d4af..b5b4e9138ed 100644 --- a/seed/python-sdk/extends/src/seed/types/nested_type.py +++ b/seed/python-sdk/extends/src/seed/types/nested_type.py @@ -6,6 +6,11 @@ from ..core.datetime_utils import serialize_datetime from .json import Json +try: + import pydantic.v1 as pydantic # type: ignore +except ImportError: + import pydantic # type: ignore + class NestedType(Json): """ @@ -32,4 +37,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/file-upload/src/seed/resources/service/types/my_object.py b/seed/python-sdk/file-upload/src/seed/resources/service/types/my_object.py index 7d982d16509..ae115d3ce6e 100644 --- a/seed/python-sdk/file-upload/src/seed/resources/service/types/my_object.py +++ b/seed/python-sdk/file-upload/src/seed/resources/service/types/my_object.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/imdb/src/seed/resources/imdb/types/create_movie_request.py b/seed/python-sdk/imdb/src/seed/resources/imdb/types/create_movie_request.py index 1d3a908b5a7..f5b6957b078 100644 --- a/seed/python-sdk/imdb/src/seed/resources/imdb/types/create_movie_request.py +++ b/seed/python-sdk/imdb/src/seed/resources/imdb/types/create_movie_request.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/imdb/src/seed/resources/imdb/types/movie.py b/seed/python-sdk/imdb/src/seed/resources/imdb/types/movie.py index ac651da1f67..725994f1770 100644 --- a/seed/python-sdk/imdb/src/seed/resources/imdb/types/movie.py +++ b/seed/python-sdk/imdb/src/seed/resources/imdb/types/movie.py @@ -31,4 +31,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/literal/src/seed/resources/reference/types/send_request.py b/seed/python-sdk/literal/src/seed/resources/reference/types/send_request.py index 080b3e02a47..7a27df70d79 100644 --- a/seed/python-sdk/literal/src/seed/resources/reference/types/send_request.py +++ b/seed/python-sdk/literal/src/seed/resources/reference/types/send_request.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/literal/src/seed/types/send_response.py b/seed/python-sdk/literal/src/seed/types/send_response.py index e414728ccc6..f8347d6be00 100644 --- a/seed/python-sdk/literal/src/seed/types/send_response.py +++ b/seed/python-sdk/literal/src/seed/types/send_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/object/src/seed/types/name.py b/seed/python-sdk/object/src/seed/types/name.py index 52d55ef53e0..8f0cd4547cd 100644 --- a/seed/python-sdk/object/src/seed/types/name.py +++ b/seed/python-sdk/object/src/seed/types/name.py @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/object/src/seed/types/type.py b/seed/python-sdk/object/src/seed/types/type.py index 51e3695f0c1..7ed5a73b839 100644 --- a/seed/python-sdk/object/src/seed/types/type.py +++ b/seed/python-sdk/object/src/seed/types/type.py @@ -92,4 +92,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 6c1ab4db253..de6d242b026 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 @@ -35,4 +35,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 dd063496b6d..8beccc94a74 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 @@ -58,6 +58,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/objects-with-imports/src/seed/resources/file/types/file.py b/seed/python-sdk/objects-with-imports/src/seed/resources/file/types/file.py index cc7c3fd2c0b..47c5017280e 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/resources/file/types/file.py +++ b/seed/python-sdk/objects-with-imports/src/seed/resources/file/types/file.py @@ -38,4 +38,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 57dbefe358e..bea78f222a9 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 @@ -42,4 +42,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 ef84b6f6635..48c52389258 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 @@ -52,4 +52,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/query-parameters/src/seed/resources/user/types/nested_user.py b/seed/python-sdk/query-parameters/src/seed/resources/user/types/nested_user.py index 84ad389a666..f29752c0466 100644 --- a/seed/python-sdk/query-parameters/src/seed/resources/user/types/nested_user.py +++ b/seed/python-sdk/query-parameters/src/seed/resources/user/types/nested_user.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/query-parameters/src/seed/resources/user/types/user.py b/seed/python-sdk/query-parameters/src/seed/resources/user/types/user.py index 957293a6477..515f012e27d 100644 --- a/seed/python-sdk/query-parameters/src/seed/resources/user/types/user.py +++ b/seed/python-sdk/query-parameters/src/seed/resources/user/types/user.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/package.py b/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/package.py index 4c3c17e9e6a..3121417f9f6 100644 --- a/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/package.py +++ b/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/package.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/record.py b/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/record.py index 95b4fc0ce96..70f1ce4494e 100644 --- a/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/record.py +++ b/seed/python-sdk/reserved-keywords/src/seed/resources/package/types/record.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/seed.yml b/seed/python-sdk/seed.yml index a55d3a3d69a..b4271f387bc 100644 --- a/seed/python-sdk/seed.yml +++ b/seed/python-sdk/seed.yml @@ -39,6 +39,10 @@ fixtures: pydantic_config: version: v1 outputFolder: pydantic-v1 + - customConfig: + pydantic_config: + extra_fields: "allow" + outputFolder: pydantic-extra-fields - customConfig: extra_dependencies: boto3: 1.28.57 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 6e91c90ae5d..98b0c9e1be4 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_and_tree_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_and_tree_value.py index 1ea49493c76..ee25e1ab9d6 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_and_tree_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/binary_tree_node_and_tree_value.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 370139482c1..f2247377a9f 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 @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 38392e46cef..c6fcff2bb93 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 @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/debug_key_value_pairs.py b/seed/python-sdk/trace/src/seed/resources/commons/types/debug_key_value_pairs.py index e75aca66496..1c3ac4988e3 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/debug_key_value_pairs.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/debug_key_value_pairs.py @@ -28,6 +28,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/debug_map_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/debug_map_value.py index 23679ed5874..bbc1a354c22 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/debug_map_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/debug_map_value.py @@ -28,6 +28,7 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_and_list_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_and_list_value.py index 9b810246628..0be8b684ef0 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_and_list_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/doubly_linked_list_node_and_list_value.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 187c3deb99d..83b31054664 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 @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 eb6dc5363ec..c71042f54c6 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 @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/file_info.py b/seed/python-sdk/trace/src/seed/resources/commons/types/file_info.py index 0d1331ef8a4..39b244c3413 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/file_info.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/file_info.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 65d905feea5..524b9fbf659 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 @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/key_value_pair.py b/seed/python-sdk/trace/src/seed/resources/commons/types/key_value_pair.py index 030f10c93cd..9552fce0984 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/key_value_pair.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/key_value_pair.py @@ -28,6 +28,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 6502a33ba7f..cb290f2daa5 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 @@ -32,6 +32,7 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/map_type.py b/seed/python-sdk/trace/src/seed/resources/commons/types/map_type.py index 396bdb6ea4e..48460213fe7 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/map_type.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/map_type.py @@ -29,6 +29,7 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/map_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/map_value.py index d036920c6a4..237a076ee4d 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/map_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/map_value.py @@ -28,6 +28,7 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_and_list_value.py b/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_and_list_value.py index 6ef104edbba..aa28450f63d 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_and_list_value.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/singly_linked_list_node_and_list_value.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 61890ef7b8f..09de34a833d 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 @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 eb2cfab2e86..a3183aca137 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 @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/test_case.py b/seed/python-sdk/trace/src/seed/resources/commons/types/test_case.py index beba2b5d1d1..2216459ffbd 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/test_case.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/test_case.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/commons/types/test_case_with_expected_result.py b/seed/python-sdk/trace/src/seed/resources/commons/types/test_case_with_expected_result.py index 9877f752fdb..f274dc9013b 100644 --- a/seed/python-sdk/trace/src/seed/resources/commons/types/test_case_with_expected_result.py +++ b/seed/python-sdk/trace/src/seed/resources/commons/types/test_case_with_expected_result.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_request.py b/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_request.py index f52a4e748a9..7a68e3b32a4 100644 --- a/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_request.py +++ b/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_response.py b/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_response.py index 15654a55840..735fae17b20 100644 --- a/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_response.py +++ b/seed/python-sdk/trace/src/seed/resources/lang_server/types/lang_server_response.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/migration/types/migration.py b/seed/python-sdk/trace/src/seed/resources/migration/types/migration.py index b41f9ff9268..e54fa4e6a25 100644 --- a/seed/python-sdk/trace/src/seed/resources/migration/types/migration.py +++ b/seed/python-sdk/trace/src/seed/resources/migration/types/migration.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist.py b/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist.py index ec768c0fcb1..5757b247d17 100644 --- a/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist.py +++ b/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist_create_request.py b/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist_create_request.py index eeb8edcda6c..501523d5c0e 100644 --- a/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist_create_request.py +++ b/seed/python-sdk/trace/src/seed/resources/playlist/types/playlist_create_request.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/playlist/types/update_playlist_request.py b/seed/python-sdk/trace/src/seed/resources/playlist/types/update_playlist_request.py index fc1aa676b43..67bf787acc5 100644 --- a/seed/python-sdk/trace/src/seed/resources/playlist/types/update_playlist_request.py +++ b/seed/python-sdk/trace/src/seed/resources/playlist/types/update_playlist_request.py @@ -30,4 +30,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/create_problem_request.py b/seed/python-sdk/trace/src/seed/resources/problem/types/create_problem_request.py index c2f0b7bea28..683c41c2370 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/create_problem_request.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/create_problem_request.py @@ -38,4 +38,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/generic_create_problem_error.py b/seed/python-sdk/trace/src/seed/resources/problem/types/generic_create_problem_error.py index e2f9db46d4b..eb156ef277b 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/generic_create_problem_error.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/generic_create_problem_error.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/get_default_starter_files_response.py b/seed/python-sdk/trace/src/seed/resources/problem/types/get_default_starter_files_response.py index a672447c8bb..45221212498 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/get_default_starter_files_response.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/get_default_starter_files_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/problem_description.py b/seed/python-sdk/trace/src/seed/resources/problem/types/problem_description.py index c26879521bc..0f6711a5832 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/problem_description.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/problem_description.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/problem_files.py b/seed/python-sdk/trace/src/seed/resources/problem/types/problem_files.py index 01e6f252200..2a65992af57 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/problem_files.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/problem_files.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/problem_info.py b/seed/python-sdk/trace/src/seed/resources/problem/types/problem_info.py index 663daab1c64..c50f1b562af 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/problem_info.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/problem_info.py @@ -42,4 +42,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/update_problem_response.py b/seed/python-sdk/trace/src/seed/resources/problem/types/update_problem_response.py index 8fd64ed0a9e..30c12753a69 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/update_problem_response.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/update_problem_response.py @@ -26,4 +26,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/problem/types/variable_type_and_name.py b/seed/python-sdk/trace/src/seed/resources/problem/types/variable_type_and_name.py index 1e102724310..5658830e59d 100644 --- a/seed/python-sdk/trace/src/seed/resources/problem/types/variable_type_and_name.py +++ b/seed/python-sdk/trace/src/seed/resources/problem/types/variable_type_and_name.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/building_executor_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/building_executor_response.py index 5d433569d76..08fddc648ba 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/building_executor_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/building_executor_response.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/compile_error.py b/seed/python-sdk/trace/src/seed/resources/submission/types/compile_error.py index 9cc9b87035e..ca32649dbbf 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/compile_error.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/compile_error.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/custom_test_cases_unsupported.py b/seed/python-sdk/trace/src/seed/resources/submission/types/custom_test_cases_unsupported.py index 644e15c4fd3..0ea45ea2945 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/custom_test_cases_unsupported.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/custom_test_cases_unsupported.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/errored_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/errored_response.py index 91f0bdd6354..7c582c4b495 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/errored_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/errored_response.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/exception_info.py b/seed/python-sdk/trace/src/seed/resources/submission/types/exception_info.py index 7fc9bd5810f..26ab3c927ae 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/exception_info.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/exception_info.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 2548adf1c35..391c3f242e4 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 @@ -31,4 +31,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 a76b1825624..9cb7564cea8 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 @@ -37,4 +37,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/existing_submission_executing.py b/seed/python-sdk/trace/src/seed/resources/submission/types/existing_submission_executing.py index 811c97e8b36..cd8a61004f7 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/existing_submission_executing.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/existing_submission_executing.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/expression_location.py b/seed/python-sdk/trace/src/seed/resources/submission/types/expression_location.py index 6324e1b02c3..69600adc567 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/expression_location.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/expression_location.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/finished_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/finished_response.py index 78e1f11f413..a25832f402a 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/finished_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/finished_response.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 bea6262767e..5ad63591ceb 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 @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 f60c2bc3dac..7da04d94bb3 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 @@ -31,4 +31,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 fb6647c4e43..52661d223e0 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 @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response.py index c9ca1a560e0..c4ef0295dd7 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response_v_2.py index 85564fa1a3b..c5d7e96595c 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/graded_response_v_2.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/graded_test_case_update.py b/seed/python-sdk/trace/src/seed/resources/submission/types/graded_test_case_update.py index da34e208c5e..a8a75036293 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/graded_test_case_update.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/graded_test_case_update.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 bd11547ca9a..f38ff4446cc 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/internal_error.py b/seed/python-sdk/trace/src/seed/resources/submission/types/internal_error.py index 60745e4c9e5..77aeb845bb7 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/internal_error.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/internal_error.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/invalid_request_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/invalid_request_response.py index 60e18cd41d5..026762814ee 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/invalid_request_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/invalid_request_response.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/lightweight_stackframe_information.py b/seed/python-sdk/trace/src/seed/resources/submission/types/lightweight_stackframe_information.py index ece9ffa4004..3dd44003fda 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/lightweight_stackframe_information.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/lightweight_stackframe_information.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 6729d406dc0..6968ea1adb0 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 @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_test_case_update.py b/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_test_case_update.py index a1fcfc2e849..ac945e3b9e1 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_test_case_update.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/recorded_test_case_update.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 7e8a63e014f..1ac26ef98fe 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 @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/running_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/running_response.py index 5012a710107..a4a404d89f2 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/running_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/running_response.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/runtime_error.py b/seed/python-sdk/trace/src/seed/resources/submission/types/runtime_error.py index e10e953eb95..425bc86177a 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/runtime_error.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/runtime_error.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/scope.py b/seed/python-sdk/trace/src/seed/resources/submission/types/scope.py index 7758e82f49b..02170a7d6a0 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/scope.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/scope.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/stack_frame.py b/seed/python-sdk/trace/src/seed/resources/submission/types/stack_frame.py index a8ee8de2a72..a3aabc8ad05 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/stack_frame.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/stack_frame.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 79dfde3602c..a1463a4093b 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 @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/stderr_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/stderr_response.py index 7b6444daff3..f6600e798ff 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/stderr_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/stderr_response.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/stdout_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/stdout_response.py index 93ad42ec9bf..645db0d3c21 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/stdout_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/stdout_response.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/stop_request.py b/seed/python-sdk/trace/src/seed/resources/submission/types/stop_request.py index 5d63f2c0409..03f676f1fe1 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/stop_request.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/stop_request.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/stopped_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/stopped_response.py index 89e71c9ba40..5daaff94b62 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/stopped_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/stopped_response.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/submission_file_info.py b/seed/python-sdk/trace/src/seed/resources/submission/types/submission_file_info.py index c66895f0e74..e1a46d3fcfe 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/submission_file_info.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/submission_file_info.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/submission_id_not_found.py b/seed/python-sdk/trace/src/seed/resources/submission/types/submission_id_not_found.py index dc7e4855b79..ee0b976ef0a 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/submission_id_not_found.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/submission_id_not_found.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 6ba911336c1..91143cd69b0 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 @@ -35,4 +35,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/terminated_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/terminated_response.py index b83d7818348..00e45d76f8c 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/terminated_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/terminated_response.py @@ -23,4 +23,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_hidden_grade.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_hidden_grade.py index ea9aa3043f1..e940b033df9 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_hidden_grade.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_hidden_grade.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 5c4181a3f9f..1bc20bfa0e4 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 @@ -31,4 +31,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result.py index 79d19be4c69..3e7abe7372d 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result_with_stdout.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result_with_stdout.py index d938231475e..43f8ece544a 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result_with_stdout.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_case_result_with_stdout.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_state.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_state.py index b445cdeabf1..017164f1958 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_state.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_state.py @@ -32,4 +32,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_status_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_status_v_2.py index defc9481894..85e63280b07 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_status_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_status_v_2.py @@ -32,4 +32,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_update.py b/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_update.py index 52e6b62824a..d068d3db289 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_update.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/test_submission_update.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 33421d8d3b5..8a7d49a7b4b 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 @@ -35,4 +35,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 93f005c2868..39ee067c109 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 @@ -37,4 +37,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 b610c0b845b..e5cbe62f831 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 @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 8ee6cd0679b..f0c5e0fd59d 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 @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/traced_file.py b/seed/python-sdk/trace/src/seed/resources/submission/types/traced_file.py index 45a3a4a71be..9ada86f2f78 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/traced_file.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/traced_file.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/traced_test_case.py b/seed/python-sdk/trace/src/seed/resources/submission/types/traced_test_case.py index f9287faeb63..7bac54316d4 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/traced_test_case.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/traced_test_case.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/unexpected_language_error.py b/seed/python-sdk/trace/src/seed/resources/submission/types/unexpected_language_error.py index 3b58022862b..5b0621f2462 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/unexpected_language_error.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/unexpected_language_error.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_files.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_files.py index 50fd99f9a47..6b631ca35fb 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_files.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_files.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_ran_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_ran_response.py index cef3374737e..180e24ef87d 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_ran_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_ran_response.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 0c967a09e0f..47d2fcdabb1 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 @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response.py index 23e246c3023..b31fb631830 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response.py @@ -27,4 +27,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response_v_2.py index bb89acafb41..e21ef813921 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_starter_files_response_v_2.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_state.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_state.py index 208941cd99b..45dde7d00c6 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_state.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_state.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_status_v_2.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_status_v_2.py index 3fea907d73a..a73c1ae89d0 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_status_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_status_v_2.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_update.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_update.py index f0fc7186423..036487236a9 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_update.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_submission_update.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 218f9ddf7b5..8de918f4e18 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 @@ -32,4 +32,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_traced_update.py b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_traced_update.py index 9203c3df3fc..bb717bd1aa2 100644 --- a/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_traced_update.py +++ b/seed/python-sdk/trace/src/seed/resources/submission/types/workspace_traced_update.py @@ -26,4 +26,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_custom_files.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_custom_files.py index 74e7f9f3cd5..da3583d0a73 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_custom_files.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_custom_files.py @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_test_case_template.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_test_case_template.py index eb94eccca33..6424e1982f6 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_test_case_template.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/basic_test_case_template.py @@ -32,4 +32,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/create_problem_request_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/create_problem_request_v_2.py index 239c164e0ca..2e948a7bc51 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/create_problem_request_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/create_problem_request_v_2.py @@ -37,4 +37,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/deep_equality_correctness_check.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/deep_equality_correctness_check.py index 63be399b32f..c3fc19f5a07 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/deep_equality_correctness_check.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/deep_equality_correctness_check.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/default_provided_file.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/default_provided_file.py index 006e13ea5cd..eb884c1bb1e 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/default_provided_file.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/default_provided_file.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/file_info_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/file_info_v_2.py index 3a9257ef4ea..d2aa969c34e 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/file_info_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/file_info_v_2.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/files.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/files.py index 6827c04aa46..04bebb63b2e 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/files.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/files.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 24fba373621..4d44390b55d 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation_for_multiple_languages.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation_for_multiple_languages.py index 149de95eab8..efaf26dff59 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation_for_multiple_languages.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/function_implementation_for_multiple_languages.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/generated_files.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/generated_files.py index dfaf3a6f7d0..3acb0678530 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/generated_files.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/generated_files.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_request.py index a4ac6522539..deb7a48d2c1 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_request.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_response.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_response.py index 3ffa2354f7e..cd065fa93d1 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_response.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_basic_solution_file_response.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_request.py index 78c53708221..f8ad9f90113 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_request.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_response.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_response.py index b636c86e057..c7bdd2db29a 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_response.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_function_signature_response.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 2054002fef3..5f28f602792 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 @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_template_file_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_template_file_request.py index 36f3f4cc48e..6293e76e5c2 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_template_file_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/get_generated_test_case_template_file_request.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/lightweight_problem_info_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/lightweight_problem_info_v_2.py index c76f72071c9..1dcf6818d92 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/lightweight_problem_info_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/lightweight_problem_info_v_2.py @@ -31,4 +31,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_definition.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_definition.py index f9245c48561..d80dc9d5cc6 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_definition.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_definition.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_signature.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_signature.py index d4e5b36a01d..c13b02882cf 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_signature.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/non_void_function_signature.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/parameter.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/parameter.py index 514da1019e6..c7c204aa512 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/parameter.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/parameter.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/problem_info_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/problem_info_v_2.py index 3479b3fc97d..2560abc4a81 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/problem_info_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/problem_info_v_2.py @@ -42,4 +42,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 e6bab4fa015..a3153e55efc 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 @@ -26,4 +26,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation.py index 0025ca03bef..f4bd983d78a 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation_description.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation_description.py index bf1ad67af9a..4599ac9a084 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation_description.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_implementation_description.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_metadata.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_metadata.py index 0fcda6d9f24..848c2eada14 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_metadata.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_metadata.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_template.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_template.py index c5bb18907f8..09505a744f7 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_template.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_template.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 10d1332ab0a..f4260fbc5e3 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 @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_with_actual_result_implementation.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_with_actual_result_implementation.py index 7b95255970b..e3042d4ac05 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_with_actual_result_implementation.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/test_case_with_actual_result_implementation.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition.py index 2fb75566ecb..41843051b5b 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition_that_takes_actual_result.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition_that_takes_actual_result.py index 83c05042128..9ee2430119c 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition_that_takes_actual_result.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_definition_that_takes_actual_result.py @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature.py index b337986ff4c..5326a0b9b97 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature_that_takes_actual_result.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature_that_takes_actual_result.py index f927d2d5c3d..74d84b66aef 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature_that_takes_actual_result.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/problem/types/void_function_signature_that_takes_actual_result.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_custom_files.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_custom_files.py index fc2b1ddc2bb..0e368403d40 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_custom_files.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_custom_files.py @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_test_case_template.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_test_case_template.py index a1aaaefe0a5..bccfd61820f 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_test_case_template.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/basic_test_case_template.py @@ -32,4 +32,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/create_problem_request_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/create_problem_request_v_2.py index 5f0d5419eb5..3dc5b23d5bc 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/create_problem_request_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/create_problem_request_v_2.py @@ -37,4 +37,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/deep_equality_correctness_check.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/deep_equality_correctness_check.py index 8aafa253662..47ac49999f2 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/deep_equality_correctness_check.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/deep_equality_correctness_check.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/default_provided_file.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/default_provided_file.py index 61a9a85f553..d1edcee836d 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/default_provided_file.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/default_provided_file.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/file_info_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/file_info_v_2.py index a0adf3d6d91..a3463a7d1e3 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/file_info_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/file_info_v_2.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/files.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/files.py index 74a4daa914a..26b93255b1b 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/files.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/files.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 51682d8e881..5e40bc60b5b 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 @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation_for_multiple_languages.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation_for_multiple_languages.py index 39bb0ac5ec2..f7d1c91ad6a 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation_for_multiple_languages.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/function_implementation_for_multiple_languages.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/generated_files.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/generated_files.py index 52715855753..b2ea8421e67 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/generated_files.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/generated_files.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_request.py index f67b0f0769f..f00a8e01f36 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_request.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_response.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_response.py index 9169342d0a8..fe32d28a8b5 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_response.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_basic_solution_file_response.py @@ -28,4 +28,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_request.py index 4504a8bd5ff..5d7e46b6063 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_request.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_response.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_response.py index 4452efbafbf..9366093991d 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_response.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_function_signature_response.py @@ -27,4 +27,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 7e8ce89cd45..f2d07a4f29b 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 @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_template_file_request.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_template_file_request.py index 3aa11854d59..5ad27527123 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_template_file_request.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/get_generated_test_case_template_file_request.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/lightweight_problem_info_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/lightweight_problem_info_v_2.py index 75d29e6ae99..5373d6c2a0b 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/lightweight_problem_info_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/lightweight_problem_info_v_2.py @@ -31,4 +31,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_definition.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_definition.py index 114c2997575..23749fcea89 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_definition.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_definition.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_signature.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_signature.py index a88a27910d7..93082e2c826 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_signature.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/non_void_function_signature.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/parameter.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/parameter.py index a854e2625cd..fc7dbc0390e 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/parameter.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/parameter.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/problem_info_v_2.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/problem_info_v_2.py index ac72ecc4f0b..57fd775db47 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/problem_info_v_2.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/problem_info_v_2.py @@ -42,4 +42,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 0e5afc67929..448aeaede4d 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 @@ -26,4 +26,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation.py index 7aa2ff92523..9993bab1e22 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation_description.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation_description.py index 14a27f2707f..50da7bb8a87 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation_description.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_implementation_description.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_metadata.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_metadata.py index 1151a683257..c837acca8ef 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_metadata.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_metadata.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_template.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_template.py index 19aa988b948..c8b25d69aee 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_template.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_template.py @@ -30,4 +30,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} 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 15897cbc9eb..75b1db2cd7f 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 @@ -33,4 +33,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_with_actual_result_implementation.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_with_actual_result_implementation.py index 77700796772..4180537799b 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_with_actual_result_implementation.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/test_case_with_actual_result_implementation.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition.py index 6c89677d611..1cd4ab5d093 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition.py @@ -28,4 +28,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition_that_takes_actual_result.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition_that_takes_actual_result.py index e28694b30f7..69675692a55 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition_that_takes_actual_result.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_definition_that_takes_actual_result.py @@ -33,4 +33,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature.py index 02919372e66..eb7939f2f76 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature.py @@ -26,4 +26,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature_that_takes_actual_result.py b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature_that_takes_actual_result.py index 3e9120936b9..f2f2367a6c3 100644 --- a/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature_that_takes_actual_result.py +++ b/seed/python-sdk/trace/src/seed/resources/v_2/resources/v_3/resources/problem/types/void_function_signature_that_takes_actual_result.py @@ -29,4 +29,5 @@ class Config: frozen = True smart_union = True allow_population_by_field_name = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/types/types/bar.py b/seed/python-sdk/unions/src/seed/resources/types/types/bar.py index 45a4fa7601d..b10cefa56bd 100644 --- a/seed/python-sdk/unions/src/seed/resources/types/types/bar.py +++ b/seed/python-sdk/unions/src/seed/resources/types/types/bar.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/types/types/foo.py b/seed/python-sdk/unions/src/seed/resources/types/types/foo.py index db37720be64..504a30e4312 100644 --- a/seed/python-sdk/unions/src/seed/resources/types/types/foo.py +++ b/seed/python-sdk/unions/src/seed/resources/types/types/foo.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/types/types/union_with_base_properties.py b/seed/python-sdk/unions/src/seed/resources/types/types/union_with_base_properties.py index 139b6429e8b..6938ee90b36 100644 --- a/seed/python-sdk/unions/src/seed/resources/types/types/union_with_base_properties.py +++ b/seed/python-sdk/unions/src/seed/resources/types/types/union_with_base_properties.py @@ -27,6 +27,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/types/types/union_with_literal.py b/seed/python-sdk/unions/src/seed/resources/types/types/union_with_literal.py index 51d4fd8fc2b..aac5343a072 100644 --- a/seed/python-sdk/unions/src/seed/resources/types/types/union_with_literal.py +++ b/seed/python-sdk/unions/src/seed/resources/types/types/union_with_literal.py @@ -27,6 +27,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/union/types/circle.py b/seed/python-sdk/unions/src/seed/resources/union/types/circle.py index ba2e82d4825..7bda0bccad6 100644 --- a/seed/python-sdk/unions/src/seed/resources/union/types/circle.py +++ b/seed/python-sdk/unions/src/seed/resources/union/types/circle.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/union/types/get_shape_request.py b/seed/python-sdk/unions/src/seed/resources/union/types/get_shape_request.py index 10d93428a5b..deed445397a 100644 --- a/seed/python-sdk/unions/src/seed/resources/union/types/get_shape_request.py +++ b/seed/python-sdk/unions/src/seed/resources/union/types/get_shape_request.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/union/types/shape.py b/seed/python-sdk/unions/src/seed/resources/union/types/shape.py index b407b4225b0..55429aed5a1 100644 --- a/seed/python-sdk/unions/src/seed/resources/union/types/shape.py +++ b/seed/python-sdk/unions/src/seed/resources/union/types/shape.py @@ -29,6 +29,7 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unions/src/seed/resources/union/types/square.py b/seed/python-sdk/unions/src/seed/resources/union/types/square.py index 6090508cf20..ce9a024f90b 100644 --- a/seed/python-sdk/unions/src/seed/resources/union/types/square.py +++ b/seed/python-sdk/unions/src/seed/resources/union/types/square.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime} diff --git a/seed/python-sdk/unknown/src/seed/resources/unknown/types/my_object.py b/seed/python-sdk/unknown/src/seed/resources/unknown/types/my_object.py index 343eb772d26..949659f7ec0 100644 --- a/seed/python-sdk/unknown/src/seed/resources/unknown/types/my_object.py +++ b/seed/python-sdk/unknown/src/seed/resources/unknown/types/my_object.py @@ -25,4 +25,5 @@ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: class Config: frozen = True smart_union = True + extra = pydantic.Extra.allow json_encoders = {dt.datetime: serialize_datetime}