From 8c0b38f59c3727bd0171a0fa07779726b1c620bf Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Mon, 1 Jun 2026 08:00:28 -0400 Subject: [PATCH 1/8] fix(deps): bump perl-base from sid to fix perl CVEs in generator and seed containers (#16145) Add perl-base and perl from Debian sid to resolve: - CVE-2026-48959 - CVE-2026-48961 - CVE-2026-9538 - CVE-2026-48962 - CVE-2026-42497 Affected containers: typescript-sdk-generator, python-sdk-generator, pydantic-model-v2-generator, ts-seed. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- docker/seed/Dockerfile.ts | 13 +++++++++++++ generators/python-v2/pydantic-model/Dockerfile | 1 + generators/python-v2/sdk/Dockerfile | 1 + generators/python/sdk/Dockerfile | 1 + generators/typescript/sdk/cli/Dockerfile | 1 + 5 files changed, 17 insertions(+) diff --git a/docker/seed/Dockerfile.ts b/docker/seed/Dockerfile.ts index d07e3b44d5b9..7d4dc0f4f770 100644 --- a/docker/seed/Dockerfile.ts +++ b/docker/seed/Dockerfile.ts @@ -42,6 +42,19 @@ RUN apt-get update \ && apt-get -y autoremove \ && rm -rf /var/lib/apt/lists/* +# Update perl-base to fix CVE-2026-48959, CVE-2026-48961, CVE-2026-9538, CVE-2026-48962, CVE-2026-42497 +RUN echo "Types: deb" > /etc/apt/sources.list.d/sid.sources \ + && echo "URIs: http://deb.debian.org/debian" >> /etc/apt/sources.list.d/sid.sources \ + && echo "Suites: sid" >> /etc/apt/sources.list.d/sid.sources \ + && echo "Components: main" >> /etc/apt/sources.list.d/sid.sources \ + && echo "Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg" >> /etc/apt/sources.list.d/sid.sources \ + && echo 'Package: *\nPin: release n=sid\nPin-Priority: 100' > /etc/apt/preferences.d/sid-low \ + && apt-get update \ + && apt-get install -y --no-install-recommends -t sid \ + perl-base perl \ + && rm -f /etc/apt/sources.list.d/sid.sources /etc/apt/preferences.d/sid-low \ + && rm -rf /var/lib/apt/lists/* + # Upgrade bundled npm to 11.14.1 to pick up patched transitive dependencies # (picomatch 4.0.4, minimatch 10.2.5, tar 7.5.13). # node:24.16.0 ships npm 11.12.1 which still vendors picomatch 4.0.3 and diff --git a/generators/python-v2/pydantic-model/Dockerfile b/generators/python-v2/pydantic-model/Dockerfile index 4d76126dc028..b6302483274c 100644 --- a/generators/python-v2/pydantic-model/Dockerfile +++ b/generators/python-v2/pydantic-model/Dockerfile @@ -20,6 +20,7 @@ RUN echo "Types: deb" > /etc/apt/sources.list.d/sid.sources \ && apt-get install -y --no-install-recommends -t sid \ libkrb5-3 libkrb5support0 libk5crypto3 libgssapi-krb5-2 \ curl libcurl4t64 libgnutls30t64 \ + perl-base perl \ && rm -f /etc/apt/sources.list.d/sid.sources /etc/apt/preferences.d/sid-low \ && rm -rf /var/lib/apt/lists/* RUN rm -rf /usr/local/lib/node_modules /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack /opt/yarn-* diff --git a/generators/python-v2/sdk/Dockerfile b/generators/python-v2/sdk/Dockerfile index c93c3c54afaf..fcafced291ba 100644 --- a/generators/python-v2/sdk/Dockerfile +++ b/generators/python-v2/sdk/Dockerfile @@ -18,6 +18,7 @@ RUN echo "Types: deb" > /etc/apt/sources.list.d/sid.sources \ && apt-get install -y --no-install-recommends -t sid \ libkrb5-3 libkrb5support0 libk5crypto3 libgssapi-krb5-2 \ curl libcurl4t64 libgnutls30t64 \ + perl-base perl \ && rm -f /etc/apt/sources.list.d/sid.sources /etc/apt/preferences.d/sid-low \ && rm -rf /var/lib/apt/lists/* # Patch brace-expansion to 5.0.6 (GHSA-jxxr-4gwj-5jf2; node:24.16 vendors 5.0.5). diff --git a/generators/python/sdk/Dockerfile b/generators/python/sdk/Dockerfile index 0ac2e9a5e43c..1b3b552ac2fd 100644 --- a/generators/python/sdk/Dockerfile +++ b/generators/python/sdk/Dockerfile @@ -31,6 +31,7 @@ RUN echo "Types: deb" > /etc/apt/sources.list.d/sid.sources \ libkrb5-3 libkrb5support0 libk5crypto3 libgssapi-krb5-2 \ curl libcurl4t64 libgnutls30t64 \ libexpat1 \ + perl-base perl \ && rm -f /etc/apt/sources.list.d/sid.sources /etc/apt/preferences.d/sid-low \ && rm -rf /var/lib/apt/lists/* RUN node --version diff --git a/generators/typescript/sdk/cli/Dockerfile b/generators/typescript/sdk/cli/Dockerfile index 5bfb1c1c6752..7d4f3c378747 100644 --- a/generators/typescript/sdk/cli/Dockerfile +++ b/generators/typescript/sdk/cli/Dockerfile @@ -56,6 +56,7 @@ RUN echo "Types: deb" > /etc/apt/sources.list.d/sid.sources \ libkrb5-3 libkrb5support0 libk5crypto3 libgssapi-krb5-2 \ curl libcurl4t64 libgnutls30t64 \ libexpat1 \ + perl-base perl \ && rm -f /etc/apt/sources.list.d/sid.sources /etc/apt/preferences.d/sid-low \ && rm -rf /var/lib/apt/lists/* RUN git config --global user.email "115122769+fern-api[bot]@users.noreply.github.com" && \ From bc2ba6a8350da55b35d9b866d176112d60748aee Mon Sep 17 00:00:00 2001 From: Danny Sheridan <83524670+dannysheridan@users.noreply.github.com> Date: Mon, 1 Jun 2026 08:24:26 -0700 Subject: [PATCH 2/8] feat(cli): prompt for optional description when creating a token interactively (#16146) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../src/commands/org/token/create/command.ts | 18 +++++++++++++++++- .../unreleased/prompt-token-description.yml | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 packages/cli/cli/changes/unreleased/prompt-token-description.yml diff --git a/packages/cli/cli-v2/src/commands/org/token/create/command.ts b/packages/cli/cli-v2/src/commands/org/token/create/command.ts index 7be51c85e0db..cb47f732f23f 100644 --- a/packages/cli/cli-v2/src/commands/org/token/create/command.ts +++ b/packages/cli/cli-v2/src/commands/org/token/create/command.ts @@ -1,5 +1,7 @@ import { createVenusService } from "@fern-api/core"; import { CliError } from "@fern-api/task-context"; +import chalk from "chalk"; +import inquirer from "inquirer"; import type { Argv } from "yargs"; import type { Context } from "../../../../context/Context.js"; import type { GlobalArgs } from "../../../../context/GlobalArgs.js"; @@ -44,12 +46,26 @@ export class CreateTokenCommand { } const auth0OrgId = orgLookup.body.auth0Id; + let description = args.description; + if (description == null && context.isTTY) { + const { desc } = await inquirer.prompt<{ desc: string }>([ + { + type: "input", + name: "desc", + message: `Description ${chalk.dim("(optional, press Enter to skip)")}:` + } + ]); + if (desc.trim().length > 0) { + description = desc.trim(); + } + } + const response = await withSpinner({ message: `Creating token for organization "${args.org}"`, operation: () => venus.apiKeys.create({ organizationId: auth0OrgId, - description: args.description + description }) }); diff --git a/packages/cli/cli/changes/unreleased/prompt-token-description.yml b/packages/cli/cli/changes/unreleased/prompt-token-description.yml new file mode 100644 index 000000000000..03b4ef41e265 --- /dev/null +++ b/packages/cli/cli/changes/unreleased/prompt-token-description.yml @@ -0,0 +1,3 @@ +- summary: | + Prompt for an optional description when creating a token interactively via `fern org token create`. + type: feat From 0163b1c41c4df92dc4464d773daa56cebd1b5aab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Jun 2026 15:28:36 +0000 Subject: [PATCH 3/8] chore(cli): release 5.43.0 --- .../{unreleased => 5.43.0}/prompt-token-description.yml | 0 packages/cli/cli/versions.yml | 7 +++++++ 2 files changed, 7 insertions(+) rename packages/cli/cli/changes/{unreleased => 5.43.0}/prompt-token-description.yml (100%) diff --git a/packages/cli/cli/changes/unreleased/prompt-token-description.yml b/packages/cli/cli/changes/5.43.0/prompt-token-description.yml similarity index 100% rename from packages/cli/cli/changes/unreleased/prompt-token-description.yml rename to packages/cli/cli/changes/5.43.0/prompt-token-description.yml diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index ab28ce5c443f..8d9517964c90 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,4 +1,11 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 5.43.0 + changelogEntry: + - summary: | + Prompt for an optional description when creating a token interactively via `fern org token create`. + type: feat + createdAt: "2026-06-01" + irVersion: 66 - version: 5.42.0 changelogEntry: - summary: | From 5ba24f4f0ffc0d94953b5f6c494e448481aec615 Mon Sep 17 00:00:00 2001 From: Fern Support <126544928+fern-support@users.noreply.github.com> Date: Mon, 1 Jun 2026 11:51:51 -0400 Subject: [PATCH 4/8] chore(seed): update all seed snapshots (#16147) Co-authored-by: patrickthornton <70873350+patrickthornton@users.noreply.github.com> --- .../deps_with_min_python_version/poetry.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/seed/python-sdk/exhaustive/deps_with_min_python_version/poetry.lock b/seed/python-sdk/exhaustive/deps_with_min_python_version/poetry.lock index 2bcddb6c5a25..4ca1b46795f9 100644 --- a/seed/python-sdk/exhaustive/deps_with_min_python_version/poetry.lock +++ b/seed/python-sdk/exhaustive/deps_with_min_python_version/poetry.lock @@ -993,18 +993,18 @@ tiktoken = ">=0.7.0,<1.0.0" [[package]] name = "langchain-protocol" -version = "0.0.15" +version = "0.0.16" description = "Python bindings for the LangChain agent streaming protocol" optional = false python-versions = "<4.0.0,>=3.10.0" groups = ["dev"] files = [ - {file = "langchain_protocol-0.0.15-py3-none-any.whl", hash = "sha256:461eb794358f83d5e42635a5797799ffec7b4702314e34edf73ac21e75d3ef79"}, - {file = "langchain_protocol-0.0.15.tar.gz", hash = "sha256:9ab2d11ee73944754f10e037e717098d3a6796f0e58afa9cadda6154e7655ade"}, + {file = "langchain_protocol-0.0.16-py3-none-any.whl", hash = "sha256:3658c142c5d0fb3a023a4be442ce4c15c6d626aab6135eb79a76dc64ad19c3c3"}, + {file = "langchain_protocol-0.0.16.tar.gz", hash = "sha256:806c7cdd951b1c4f692fa40fce60821ff0f221d4360e27673ddf2c2b99c2b7ff"}, ] [package.dependencies] -typing-extensions = ">=4.7.0,<5.0.0" +typing-extensions = ">=4.13.0,<5.0.0" [[package]] name = "langgraph" @@ -1076,14 +1076,14 @@ orjson = ">=3.11.5" [[package]] name = "langsmith" -version = "0.8.6" +version = "0.8.8" description = "Client library to connect to the LangSmith Observability and Evaluation Platform." optional = false python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "langsmith-0.8.6-py3-none-any.whl", hash = "sha256:b304888ea5ec5fe397db24f0bf474b0c8e472fb23ee36a2007e9837f6ff29cc1"}, - {file = "langsmith-0.8.6.tar.gz", hash = "sha256:a46fd3403c2de3a9c34f72ebb7b2e45872627671adcc67c6a4c571520b6931cc"}, + {file = "langsmith-0.8.8-py3-none-any.whl", hash = "sha256:9d60d724c0d187c036e184b3ffdf9fa5c6822aa0bb88144a5fb898e79be645af"}, + {file = "langsmith-0.8.8.tar.gz", hash = "sha256:9d00e54f54d833c1914003527ff03ad0364741034330da72f0adbeaba852b6cf"}, ] [package.dependencies] From 2d48e2779181f1cd0227d2ed7c9bbd585bf9665f Mon Sep 17 00:00:00 2001 From: Fern Support <126544928+fern-support@users.noreply.github.com> Date: Mon, 1 Jun 2026 12:10:02 -0400 Subject: [PATCH 5/8] chore(seed): update all seed snapshots (#16148) Co-authored-by: dsinghvi <10870189+dsinghvi@users.noreply.github.com> From 1a158fdb315b5ba08567342a2906eaa00cd7413e Mon Sep 17 00:00:00 2001 From: Naman Anand Date: Mon, 1 Jun 2026 22:58:07 +0530 Subject: [PATCH 6/8] feat(rust): forward-compatible discriminated unions (#16142) feat(rust-sdk): forward-compatible discriminated unions --- .../types_event_message.rs | 13 ++- .../types_flexible_value.rs | 11 +++ .../types_response.rs | 13 ++- .../types_search_result.rs | 11 +++ .../types_string_or_number.rs | 13 ++- .../snapshots/union-types/types_animal.rs | 11 +++ .../union-types/types_payment_method.rs | 13 ++- .../snapshots/union-types/types_shape.rs | 11 +++ .../snapshots/union-types/types_vehicle.rs | 14 ++++ .../rust/model/src/union/UnionGenerator.ts | 78 ++++++++++++++++++ .../unreleased/forward-compatible-unions.yml | 13 +++ .../.fern/metadata.json | 3 +- .../src/api/types/ast_container_value.rs | 11 +++ .../src/api/types/ast_field_value.rs | 11 +++ .../circular-references/.fern/metadata.json | 3 +- .../src/api/types/ast_container_value.rs | 11 +++ .../src/api/types/ast_field_value.rs | 11 +++ .../no-custom-config/.fern/metadata.json | 3 +- .../src/api/types/commons_types_data.rs | 13 ++- .../src/api/types/commons_types_event_info.rs | 11 +++ .../src/api/types/types_exception.rs | 13 ++- .../src/api/types/types_metadata.rs | 17 ++++ .../src/api/types/types_test.rs | 13 ++- .../readme-config/.fern/metadata.json | 3 +- .../src/api/types/commons_types_data.rs | 13 ++- .../src/api/types/commons_types_event_info.rs | 11 +++ .../src/api/types/types_exception.rs | 13 ++- .../src/api/types/types_metadata.rs | 17 ++++ .../readme-config/src/api/types/types_test.rs | 13 ++- seed/rust-sdk/exhaustive/.fern/metadata.json | 3 +- .../src/api/types/types_union_animal.rs | 13 ++- seed/rust-sdk/literal/.fern/metadata.json | 3 +- .../types/inlined_discriminated_literal.rs | 13 ++- seed/rust-sdk/mixed-case/.fern/metadata.json | 3 +- .../src/api/types/service_resource.rs | 14 ++++ .../nullable-optional/.fern/metadata.json | 3 +- .../nullable_optional_notification_method.rs | 13 ++- .../types/nullable_optional_search_result.rs | 13 ++- seed/rust-sdk/nullable/.fern/metadata.json | 3 +- .../nullable/src/api/types/nullable_status.rs | 13 ++- .../property-access/.fern/metadata.json | 3 +- .../api/types/user_or_admin_discriminated.rs | 19 ++++- .../with-wire-tests/.fern/metadata.json | 3 +- .../src/api/types/completions_stream_event.rs | 13 ++- ...mpletions_stream_event_context_protocol.rs | 13 ++- ...tions_stream_event_discriminant_in_data.rs | 13 ++- .../.fern/metadata.json | 3 +- .../api/types/stream_data_context_response.rs | 13 ++- ...a_context_with_envelope_schema_response.rs | 11 +++ .../api/types/stream_no_context_response.rs | 13 ++- .../stream_protocol_collision_response.rs | 11 +++ .../stream_protocol_no_collision_response.rs | 11 +++ ...ream_protocol_with_flat_schema_response.rs | 13 ++- .../stream_x_fern_streaming_union_request.rs | 28 ++++--- ...m_x_fern_streaming_union_stream_request.rs | 28 ++++--- .../src/api/types/union_stream_request.rs | 13 ++- seed/rust-sdk/trace/.fern/metadata.json | 3 +- .../trace/src/api/types/admin_test.rs | 13 ++- .../api/types/commons_debug_variable_value.rs | 11 +++ .../src/api/types/commons_variable_type.rs | 11 +++ .../src/api/types/commons_variable_value.rs | 11 +++ ...aylist_playlist_id_not_found_error_body.rs | 13 ++- .../api/types/problem_create_problem_error.rs | 13 ++- .../types/problem_create_problem_response.rs | 11 +++ .../problem_problem_description_board.rs | 11 +++ .../src/api/types/submission_actual_result.rs | 11 +++ .../types/submission_code_execution_update.rs | 11 +++ .../src/api/types/submission_error_info.rs | 13 ++- .../src/api/types/submission_exception_v_2.rs | 13 ++- .../types/submission_invalid_request_cause.rs | 13 ++- .../types/submission_submission_request.rs | 13 ++- .../types/submission_submission_response.rs | 11 +++ ...mission_submission_status_for_test_case.rs | 11 +++ .../types/submission_submission_status_v_2.rs | 11 +++ .../types/submission_submission_type_state.rs | 11 +++ .../api/types/submission_test_case_grade.rs | 11 +++ .../submission_test_submission_status.rs | 11 +++ .../submission_test_submission_update_info.rs | 11 +++ .../submission_workspace_submission_status.rs | 11 +++ ...ission_workspace_submission_update_info.rs | 11 +++ .../v_2_problem_assert_correctness_check.rs | 11 +++ .../src/api/types/v_2_problem_custom_files.rs | 11 +++ .../types/v_2_problem_function_signature.rs | 11 +++ .../types/v_2_problem_test_case_function.rs | 11 +++ ...t_case_implementation_description_board.rs | 13 ++- ...blem_test_case_implementation_reference.rs | 11 +++ ..._2_v_3_problem_assert_correctness_check.rs | 11 +++ .../api/types/v_2_v_3_problem_custom_files.rs | 11 +++ .../v_2_v_3_problem_function_signature.rs | 11 +++ .../v_2_v_3_problem_test_case_function.rs | 11 +++ ...t_case_implementation_description_board.rs | 13 ++- ...blem_test_case_implementation_reference.rs | 11 +++ .../.fern/metadata.json | 3 +- .../src/api/types/bigunion_big_union.rs | 80 ++++++++++++------- .../src/api/types/types_union.rs | 13 ++- .../types/types_union_with_base_properties.rs | 16 +++- .../types/types_union_with_discriminant.rs | 13 ++- .../types_union_with_duplicate_primitive.rs | 13 ++- .../types/types_union_with_duplicate_types.rs | 13 ++- .../src/api/types/types_union_with_literal.rs | 16 +++- ...types_union_with_multiple_no_properties.rs | 13 ++- .../types/types_union_with_no_properties.rs | 13 ++- .../types/types_union_with_optional_time.rs | 13 ++- .../api/types/types_union_with_primitive.rs | 13 ++- .../types_union_with_same_number_types.rs | 11 +++ .../types_union_with_same_string_types.rs | 13 ++- .../types/types_union_with_single_element.rs | 13 ++- .../api/types/types_union_with_sub_types.rs | 13 ++- .../src/api/types/types_union_with_time.rs | 13 ++- .../src/api/types/types_union_without_key.rs | 13 ++- .../src/api/types/union_shape.rs | 14 ++++ seed/rust-sdk/unions/.fern/metadata.json | 3 +- .../src/api/types/bigunion_big_union.rs | 80 ++++++++++++------- .../unions/src/api/types/types_union.rs | 13 ++- .../types/types_union_with_base_properties.rs | 16 +++- .../types/types_union_with_discriminant.rs | 13 ++- .../types_union_with_duplicate_primitive.rs | 13 ++- .../types/types_union_with_duplicate_types.rs | 13 ++- ...es_union_with_duplicative_discriminants.rs | 13 ++- .../src/api/types/types_union_with_literal.rs | 16 +++- ...types_union_with_multiple_no_properties.rs | 13 ++- .../types/types_union_with_no_properties.rs | 13 ++- .../types_union_with_nullable_reference.rs | 13 ++- .../types_union_with_optional_reference.rs | 13 ++- .../types/types_union_with_optional_time.rs | 13 ++- .../api/types/types_union_with_primitive.rs | 13 ++- .../types_union_with_same_number_types.rs | 11 +++ .../types_union_with_same_string_types.rs | 13 ++- .../types/types_union_with_single_element.rs | 13 ++- .../api/types/types_union_with_sub_types.rs | 13 ++- .../src/api/types/types_union_with_time.rs | 13 ++- .../src/api/types/types_union_without_key.rs | 13 ++- .../unions/src/api/types/union_shape.rs | 14 ++++ 133 files changed, 1577 insertions(+), 179 deletions(-) create mode 100644 generators/rust/sdk/changes/unreleased/forward-compatible-unions.yml diff --git a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_event_message.rs b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_event_message.rs index 62c2a9ee69b5..649ca6b595a3 100644 --- a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_event_message.rs +++ b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_event_message.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum EventMessage { #[serde(rename = "payload")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum EventMessage { Raw { value: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl EventMessage { @@ -24,4 +31,8 @@ impl EventMessage { pub fn raw(value: String) -> Self { Self::Raw { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_flexible_value.rs b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_flexible_value.rs index d08e05eb9652..f55cc32c9ddb 100644 --- a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_flexible_value.rs +++ b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_flexible_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum FlexibleValue { #[serde(rename = "string")] #[non_exhaustive] @@ -32,6 +33,12 @@ pub enum FlexibleValue { StringList { value: Vec, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl FlexibleValue { @@ -54,4 +61,8 @@ impl FlexibleValue { pub fn string_list(value: Vec) -> Self { Self::StringList { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_response.rs b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_response.rs index ca05f581b9d8..35d58ce99218 100644 --- a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_response.rs +++ b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_response.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Response { #[serde(rename = "success")] #[non_exhaustive] @@ -22,6 +23,12 @@ pub enum Response { #[serde(skip_serializing_if = "Option::is_none")] details: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Response { @@ -36,4 +43,8 @@ impl Response { pub fn error_with_details(error: String, code: i64, details: Vec) -> Self { Self::Error { error, code, details: Some(details) } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_search_result.rs b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_search_result.rs index 132631a22e23..c6af193bb3a0 100644 --- a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_search_result.rs +++ b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_search_result.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SearchResult { #[serde(rename = "user")] #[non_exhaustive] @@ -40,6 +41,12 @@ pub enum SearchResult { #[serde(skip_serializing_if = "Option::is_none")] parent_id: Option, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SearchResult { @@ -58,4 +65,8 @@ impl SearchResult { pub fn category_with_parent_id(id: String, name: String, description: String, parent_id: String) -> Self { Self::Category { id, name, description, parent_id: Some(parent_id) } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_string_or_number.rs b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_string_or_number.rs index 19ff3cc20017..6923b07ce6bd 100644 --- a/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_string_or_number.rs +++ b/generators/rust/model/src/__test__/snapshots/undiscriminated-union-types/types_string_or_number.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum StringOrNumber { #[serde(rename = "string")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum StringOrNumber { Number { value: i64, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StringOrNumber { @@ -24,4 +31,8 @@ impl StringOrNumber { pub fn number(value: i64) -> Self { Self::Number { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/union-types/types_animal.rs b/generators/rust/model/src/__test__/snapshots/union-types/types_animal.rs index 6a11217fbddd..c190201b365f 100644 --- a/generators/rust/model/src/__test__/snapshots/union-types/types_animal.rs +++ b/generators/rust/model/src/__test__/snapshots/union-types/types_animal.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Animal { #[serde(rename = "dog")] #[non_exhaustive] @@ -37,6 +38,12 @@ pub enum Animal { #[serde(with = "crate::core::number_serializers::option")] wing_span: Option, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Animal { @@ -55,4 +62,8 @@ impl Animal { pub fn bird_with_wing_span(name: String, can_fly: bool, wing_span: f64) -> Self { Self::Bird { name, can_fly, wing_span: Some(wing_span) } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/union-types/types_payment_method.rs b/generators/rust/model/src/__test__/snapshots/union-types/types_payment_method.rs index 3d1e8a98a398..290f810ec26a 100644 --- a/generators/rust/model/src/__test__/snapshots/union-types/types_payment_method.rs +++ b/generators/rust/model/src/__test__/snapshots/union-types/types_payment_method.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum PaymentMethod { #[serde(rename = "cash")] #[non_exhaustive] @@ -24,6 +25,12 @@ pub enum PaymentMethod { #[serde(default)] routing_number: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl PaymentMethod { @@ -38,4 +45,8 @@ impl PaymentMethod { pub fn bank_transfer(account_number: String, routing_number: String) -> Self { Self::BankTransfer { account_number, routing_number } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/union-types/types_shape.rs b/generators/rust/model/src/__test__/snapshots/union-types/types_shape.rs index f2b4c7e142d0..330222d683e2 100644 --- a/generators/rust/model/src/__test__/snapshots/union-types/types_shape.rs +++ b/generators/rust/model/src/__test__/snapshots/union-types/types_shape.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "kind")] +#[non_exhaustive] pub enum Shape { #[serde(rename = "circle")] #[non_exhaustive] @@ -25,6 +26,12 @@ pub enum Shape { Square { value: f64, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Shape { @@ -39,4 +46,8 @@ impl Shape { pub fn square(value: f64) -> Self { Self::Square { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/generators/rust/model/src/__test__/snapshots/union-types/types_vehicle.rs b/generators/rust/model/src/__test__/snapshots/union-types/types_vehicle.rs index 0d057cc286d4..5d083a7adc4f 100644 --- a/generators/rust/model/src/__test__/snapshots/union-types/types_vehicle.rs +++ b/generators/rust/model/src/__test__/snapshots/union-types/types_vehicle.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "vehicle_type")] +#[non_exhaustive] pub enum Vehicle { #[serde(rename = "car")] #[non_exhaustive] @@ -40,6 +41,12 @@ pub enum Vehicle { manufacturer: String, year: i64, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Vehicle { @@ -55,11 +62,16 @@ impl Vehicle { Self::Truck { payload_capacity, axles, id, manufacturer, year } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::Car { id, .. } => id, Self::Motorcycle { id, .. } => id, Self::Truck { id, .. } => id, + Self::__Unknown(_) => panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly"), } } @@ -68,6 +80,7 @@ impl Vehicle { Self::Car { manufacturer, .. } => manufacturer, Self::Motorcycle { manufacturer, .. } => manufacturer, Self::Truck { manufacturer, .. } => manufacturer, + Self::__Unknown(_) => panic!("get_manufacturer() called on __Unknown variant; inspect the raw JSON value directly"), } } @@ -76,6 +89,7 @@ impl Vehicle { Self::Car { year, .. } => year, Self::Motorcycle { year, .. } => year, Self::Truck { year, .. } => year, + Self::__Unknown(_) => panic!("get_year() called on __Unknown variant; inspect the raw JSON value directly"), } } } diff --git a/generators/rust/model/src/union/UnionGenerator.ts b/generators/rust/model/src/union/UnionGenerator.ts index 66a8a6b7af7b..859ff44d1f19 100644 --- a/generators/rust/model/src/union/UnionGenerator.ts +++ b/generators/rust/model/src/union/UnionGenerator.ts @@ -22,6 +22,16 @@ import { import { isFieldRecursive } from "../utils/recursiveTypeUtils.js"; import { canDeriveHashAndEq, canDerivePartialEq, generateFieldAttributes, hasHashMapFields, hasHashSetFields } from "../utils/structUtils.js"; +/** + * Name of the forward-compatible catch-all variant. Generated discriminated unions + * include this variant so unknown discriminant values deserialize into a wrapper + * holding the raw JSON instead of erroring. The double-underscore prefix matches + * the convention used by forward-compatible enums (`__Unknown`) and reduces the + * chance of colliding with a user-declared discriminant. + */ +const UNKNOWN_VARIANT_NAME = "__Unknown"; +const UNKNOWN_CONSTRUCTOR_NAME = "unknown"; + export class UnionGenerator { private readonly typeDeclaration: FernIr.TypeDeclaration; private readonly unionTypeDeclaration: FernIr.UnionTypeDeclaration; @@ -37,6 +47,18 @@ export class UnionGenerator { this.context = context; } + /** + * Discriminated unions are forward-compatible by default. A trailing + * `__Unknown(serde_json::Value)` variant marked `#[serde(untagged)]` acts as a + * fallback so unrecognized discriminant values (e.g. variants added server-side + * after this SDK was generated) deserialize into the raw JSON payload instead + * of failing. This matches the behavior already provided for multi-variant + * enums in this generator and the C#/Java/TypeScript SDKs. + */ + private isForwardCompatible(): boolean { + return true; + } + public generate(): RustFile { const typeName = this.context.getUniqueTypeNameForDeclaration(this.typeDeclaration); const filename = this.context.getUniqueFilenameForType(this.typeDeclaration); @@ -139,12 +161,33 @@ export class UnionGenerator { } this.generateUnionVariant(writer, unionType); }); + + if (this.isForwardCompatible()) { + if (this.unionTypeDeclaration.types.length > 0) { + writer.newLine(); + } + this.generateUnknownVariant(writer); + } }); // Generate implementation block if needed this.generateImplementationBlock(writer, typeName); } + /** + * Generate the forward-compatible catch-all variant. Annotated with + * `#[serde(untagged)]` so serde tries each tagged variant first and falls back + * to this variant for unrecognized discriminant values, preserving the raw JSON + * payload as `serde_json::Value`. + */ + private generateUnknownVariant(writer: rust.Writer): void { + writer.writeLine(" /// Catch-all variant for unrecognized discriminant values."); + writer.writeLine(" /// If the server sends a discriminant not recognized by the current SDK"); + writer.writeLine(" /// version, the raw payload is captured here so callers can still inspect it."); + writer.writeLine(" #[serde(untagged)]"); + writer.writeLine(` ${UNKNOWN_VARIANT_NAME}(serde_json::Value),`); + } + private generateUnionAttributes(): rust.Attribute[] { const attributes: rust.Attribute[] = []; @@ -167,6 +210,13 @@ export class UnionGenerator { const discriminantField = getWireValue(this.unionTypeDeclaration.discriminant); attributes.push(Attribute.serde.tag(discriminantField)); + if (this.isForwardCompatible()) { + // Enum-level #[non_exhaustive] forces callers to include a catch-all + // pattern in `match` expressions, so adding new typed variants in the + // future is non-breaking. + attributes.push(Attribute.nonExhaustive()); + } + return attributes; } @@ -201,6 +251,12 @@ export class UnionGenerator { } private needsDeriveHashAndEq(): boolean { + // The forward-compatible `__Unknown(serde_json::Value)` variant doesn't + // support Hash or Eq, so unions with that variant can't derive them. + if (this.isForwardCompatible()) { + return false; + } + // Check if all variant types and base properties can support Hash and Eq derives const isTypeSupportsHashAndEq = canDeriveHashAndEq(this.unionTypeDeclaration.baseProperties, this.context); @@ -478,6 +534,19 @@ export class UnionGenerator { }); }); + // Generate a constructor for the forward-compatible catch-all variant so + // callers can wrap a raw JSON payload (the `#[non_exhaustive]` enum attribute + // prevents direct construction outside the crate). + if (this.isForwardCompatible()) { + if (needsNewline) { + writer.newLine(); + } + writer.writeBlock(`pub fn ${UNKNOWN_CONSTRUCTOR_NAME}(value: serde_json::Value) -> Self`, () => { + writer.writeLine(`Self::${UNKNOWN_VARIANT_NAME}(value)`); + }); + needsNewline = true; + } + // Generate getter methods for base properties if (this.unionTypeDeclaration.baseProperties.length > 0) { this.unionTypeDeclaration.baseProperties.forEach((property) => { @@ -497,6 +566,15 @@ export class UnionGenerator { writer.writeLine(` Self::${variantName} { ${fieldName}, .. } => ${fieldName},`); }); + if (this.isForwardCompatible()) { + // Base properties aren't typed on the catch-all variant. Callers that + // need to read them on an unknown variant should pattern-match on + // `__Unknown(value)` directly and inspect the raw JSON. + writer.writeLine( + ` Self::${UNKNOWN_VARIANT_NAME}(_) => panic!("${methodName}() called on ${UNKNOWN_VARIANT_NAME} variant; inspect the raw JSON value directly"),` + ); + } + writer.writeLine(" }"); }); }); diff --git a/generators/rust/sdk/changes/unreleased/forward-compatible-unions.yml b/generators/rust/sdk/changes/unreleased/forward-compatible-unions.yml new file mode 100644 index 000000000000..f31393c89632 --- /dev/null +++ b/generators/rust/sdk/changes/unreleased/forward-compatible-unions.yml @@ -0,0 +1,13 @@ +# yaml-language-server: $schema=../../../../../fern-changes-yml.schema.json + +- summary: | + Discriminated unions are now forward-compatible. Each generated `enum` carries + `#[non_exhaustive]` and a final `__Unknown(serde_json::Value)` variant marked + `#[serde(untagged)]`. Unknown discriminant values (e.g. variants introduced + server-side after this SDK was generated) deserialize into `__Unknown` + instead of erroring, preserving the raw JSON payload for inspection and + round-trip serialization. + + Forward-compatible unions can no longer derive `Eq`/`Hash` because + `serde_json::Value` doesn't implement them. `PartialEq` is still derived. + type: feat diff --git a/seed/rust-sdk/circular-references-advanced/.fern/metadata.json b/seed/rust-sdk/circular-references-advanced/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/circular-references-advanced/.fern/metadata.json +++ b/seed/rust-sdk/circular-references-advanced/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/circular-references-advanced/src/api/types/ast_container_value.rs b/seed/rust-sdk/circular-references-advanced/src/api/types/ast_container_value.rs index 44cb42f61ffb..eff91d17b476 100644 --- a/seed/rust-sdk/circular-references-advanced/src/api/types/ast_container_value.rs +++ b/seed/rust-sdk/circular-references-advanced/src/api/types/ast_container_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum ContainerValue { #[serde(rename = "list")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum ContainerValue { #[serde(rename = "optional")] #[non_exhaustive] Optional { value: Option> }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl ContainerValue { @@ -20,4 +27,8 @@ impl ContainerValue { pub fn optional(value: Option>) -> Self { Self::Optional { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/circular-references-advanced/src/api/types/ast_field_value.rs b/seed/rust-sdk/circular-references-advanced/src/api/types/ast_field_value.rs index d446efa7ad25..8110b144fc6e 100644 --- a/seed/rust-sdk/circular-references-advanced/src/api/types/ast_field_value.rs +++ b/seed/rust-sdk/circular-references-advanced/src/api/types/ast_field_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum FieldValue { #[serde(rename = "primitive_value")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum FieldValue { #[serde(rename = "container_value")] #[non_exhaustive] ContainerValue { value: Box }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl FieldValue { @@ -28,4 +35,8 @@ impl FieldValue { pub fn container_value(value: Box) -> Self { Self::ContainerValue { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/circular-references/.fern/metadata.json b/seed/rust-sdk/circular-references/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/circular-references/.fern/metadata.json +++ b/seed/rust-sdk/circular-references/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/circular-references/src/api/types/ast_container_value.rs b/seed/rust-sdk/circular-references/src/api/types/ast_container_value.rs index 44cb42f61ffb..eff91d17b476 100644 --- a/seed/rust-sdk/circular-references/src/api/types/ast_container_value.rs +++ b/seed/rust-sdk/circular-references/src/api/types/ast_container_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum ContainerValue { #[serde(rename = "list")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum ContainerValue { #[serde(rename = "optional")] #[non_exhaustive] Optional { value: Option> }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl ContainerValue { @@ -20,4 +27,8 @@ impl ContainerValue { pub fn optional(value: Option>) -> Self { Self::Optional { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/circular-references/src/api/types/ast_field_value.rs b/seed/rust-sdk/circular-references/src/api/types/ast_field_value.rs index d446efa7ad25..8110b144fc6e 100644 --- a/seed/rust-sdk/circular-references/src/api/types/ast_field_value.rs +++ b/seed/rust-sdk/circular-references/src/api/types/ast_field_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum FieldValue { #[serde(rename = "primitive_value")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum FieldValue { #[serde(rename = "container_value")] #[non_exhaustive] ContainerValue { value: Box }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl FieldValue { @@ -28,4 +35,8 @@ impl FieldValue { pub fn container_value(value: Box) -> Self { Self::ContainerValue { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json b/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json +++ b/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_data.rs b/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_data.rs index 8607a569be5d..27dfafe09f3a 100644 --- a/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_data.rs +++ b/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_data.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Data { #[serde(rename = "string")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Data { #[serde(rename = "base64")] #[non_exhaustive] Base64 { value: Vec }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Data { @@ -20,4 +27,8 @@ impl Data { pub fn base64(value: Vec) -> Self { Self::Base64 { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_event_info.rs b/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_event_info.rs index b9985c0e59a7..ee983692ec57 100644 --- a/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_event_info.rs +++ b/seed/rust-sdk/examples/no-custom-config/src/api/types/commons_types_event_info.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum EventInfo { #[serde(rename = "metadata")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum EventInfo { #[serde(rename = "tag")] #[non_exhaustive] Tag { value: Tag }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl EventInfo { @@ -23,4 +30,8 @@ impl EventInfo { pub fn tag(value: Tag) -> Self { Self::Tag { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/no-custom-config/src/api/types/types_exception.rs b/seed/rust-sdk/examples/no-custom-config/src/api/types/types_exception.rs index 069f4cdec356..6e4856edd3cb 100644 --- a/seed/rust-sdk/examples/no-custom-config/src/api/types/types_exception.rs +++ b/seed/rust-sdk/examples/no-custom-config/src/api/types/types_exception.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Exception { #[serde(rename = "generic")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum Exception { #[serde(rename = "timeout")] #[non_exhaustive] Timeout {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Exception { @@ -38,4 +45,8 @@ impl Exception { pub fn timeout() -> Self { Self::Timeout {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/no-custom-config/src/api/types/types_metadata.rs b/seed/rust-sdk/examples/no-custom-config/src/api/types/types_metadata.rs index 1683816f60d5..f218878aff9c 100644 --- a/seed/rust-sdk/examples/no-custom-config/src/api/types/types_metadata.rs +++ b/seed/rust-sdk/examples/no-custom-config/src/api/types/types_metadata.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Metadata2 { #[serde(rename = "html")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum Metadata2 { extra: HashMap, tags: HashSet, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Metadata2 { @@ -29,10 +36,17 @@ impl Metadata2 { Self::Markdown { value, extra, tags } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_extra(&self) -> &HashMap { match self { Self::Html { extra, .. } => extra, Self::Markdown { extra, .. } => extra, + Self::__Unknown(_) => panic!( + "get_extra() called on __Unknown variant; inspect the raw JSON value directly" + ), } } @@ -40,6 +54,9 @@ impl Metadata2 { match self { Self::Html { tags, .. } => tags, Self::Markdown { tags, .. } => tags, + Self::__Unknown(_) => panic!( + "get_tags() called on __Unknown variant; inspect the raw JSON value directly" + ), } } } diff --git a/seed/rust-sdk/examples/no-custom-config/src/api/types/types_test.rs b/seed/rust-sdk/examples/no-custom-config/src/api/types/types_test.rs index 08012d9df493..6e1cab5108b1 100644 --- a/seed/rust-sdk/examples/no-custom-config/src/api/types/types_test.rs +++ b/seed/rust-sdk/examples/no-custom-config/src/api/types/types_test.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Test { #[serde(rename = "and")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Test { #[serde(rename = "or")] #[non_exhaustive] Or { value: bool }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Test { @@ -20,4 +27,8 @@ impl Test { pub fn or(value: bool) -> Self { Self::Or { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/readme-config/.fern/metadata.json b/seed/rust-sdk/examples/readme-config/.fern/metadata.json index 05fc731f1686..90e072664b84 100644 --- a/seed/rust-sdk/examples/readme-config/.fern/metadata.json +++ b/seed/rust-sdk/examples/readme-config/.fern/metadata.json @@ -16,8 +16,7 @@ ] }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_data.rs b/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_data.rs index 8607a569be5d..27dfafe09f3a 100644 --- a/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_data.rs +++ b/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_data.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Data { #[serde(rename = "string")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Data { #[serde(rename = "base64")] #[non_exhaustive] Base64 { value: Vec }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Data { @@ -20,4 +27,8 @@ impl Data { pub fn base64(value: Vec) -> Self { Self::Base64 { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_event_info.rs b/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_event_info.rs index b9985c0e59a7..ee983692ec57 100644 --- a/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_event_info.rs +++ b/seed/rust-sdk/examples/readme-config/src/api/types/commons_types_event_info.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum EventInfo { #[serde(rename = "metadata")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum EventInfo { #[serde(rename = "tag")] #[non_exhaustive] Tag { value: Tag }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl EventInfo { @@ -23,4 +30,8 @@ impl EventInfo { pub fn tag(value: Tag) -> Self { Self::Tag { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/readme-config/src/api/types/types_exception.rs b/seed/rust-sdk/examples/readme-config/src/api/types/types_exception.rs index 069f4cdec356..6e4856edd3cb 100644 --- a/seed/rust-sdk/examples/readme-config/src/api/types/types_exception.rs +++ b/seed/rust-sdk/examples/readme-config/src/api/types/types_exception.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Exception { #[serde(rename = "generic")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum Exception { #[serde(rename = "timeout")] #[non_exhaustive] Timeout {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Exception { @@ -38,4 +45,8 @@ impl Exception { pub fn timeout() -> Self { Self::Timeout {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/examples/readme-config/src/api/types/types_metadata.rs b/seed/rust-sdk/examples/readme-config/src/api/types/types_metadata.rs index 1683816f60d5..f218878aff9c 100644 --- a/seed/rust-sdk/examples/readme-config/src/api/types/types_metadata.rs +++ b/seed/rust-sdk/examples/readme-config/src/api/types/types_metadata.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Metadata2 { #[serde(rename = "html")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum Metadata2 { extra: HashMap, tags: HashSet, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Metadata2 { @@ -29,10 +36,17 @@ impl Metadata2 { Self::Markdown { value, extra, tags } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_extra(&self) -> &HashMap { match self { Self::Html { extra, .. } => extra, Self::Markdown { extra, .. } => extra, + Self::__Unknown(_) => panic!( + "get_extra() called on __Unknown variant; inspect the raw JSON value directly" + ), } } @@ -40,6 +54,9 @@ impl Metadata2 { match self { Self::Html { tags, .. } => tags, Self::Markdown { tags, .. } => tags, + Self::__Unknown(_) => panic!( + "get_tags() called on __Unknown variant; inspect the raw JSON value directly" + ), } } } diff --git a/seed/rust-sdk/examples/readme-config/src/api/types/types_test.rs b/seed/rust-sdk/examples/readme-config/src/api/types/types_test.rs index 08012d9df493..6e1cab5108b1 100644 --- a/seed/rust-sdk/examples/readme-config/src/api/types/types_test.rs +++ b/seed/rust-sdk/examples/readme-config/src/api/types/types_test.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Test { #[serde(rename = "and")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Test { #[serde(rename = "or")] #[non_exhaustive] Or { value: bool }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Test { @@ -20,4 +27,8 @@ impl Test { pub fn or(value: bool) -> Self { Self::Or { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/exhaustive/.fern/metadata.json b/seed/rust-sdk/exhaustive/.fern/metadata.json index 81b536667fc2..c1161c13aa09 100644 --- a/seed/rust-sdk/exhaustive/.fern/metadata.json +++ b/seed/rust-sdk/exhaustive/.fern/metadata.json @@ -6,8 +6,7 @@ "enableWireTests": true }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/exhaustive/src/api/types/types_union_animal.rs b/seed/rust-sdk/exhaustive/src/api/types/types_union_animal.rs index dba44b3b0c7c..854f855dae3c 100644 --- a/seed/rust-sdk/exhaustive/src/api/types/types_union_animal.rs +++ b/seed/rust-sdk/exhaustive/src/api/types/types_union_animal.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "animal")] +#[non_exhaustive] pub enum Animal { #[serde(rename = "dog")] #[non_exhaustive] @@ -22,6 +23,12 @@ pub enum Animal { #[serde(default)] likes_to_meow: bool, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Animal { @@ -38,4 +45,8 @@ impl Animal { likes_to_meow, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/literal/.fern/metadata.json b/seed/rust-sdk/literal/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/literal/.fern/metadata.json +++ b/seed/rust-sdk/literal/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/literal/src/api/types/inlined_discriminated_literal.rs b/seed/rust-sdk/literal/src/api/types/inlined_discriminated_literal.rs index 4a1df8683b1e..cfc0a461de70 100644 --- a/seed/rust-sdk/literal/src/api/types/inlined_discriminated_literal.rs +++ b/seed/rust-sdk/literal/src/api/types/inlined_discriminated_literal.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum DiscriminatedLiteral { #[serde(rename = "customName")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum DiscriminatedLiteral { #[serde(rename = "literalGeorge")] #[non_exhaustive] LiteralGeorge { value: bool }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl DiscriminatedLiteral { @@ -36,4 +43,8 @@ impl DiscriminatedLiteral { pub fn literal_george(value: bool) -> Self { Self::LiteralGeorge { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/mixed-case/.fern/metadata.json b/seed/rust-sdk/mixed-case/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/mixed-case/.fern/metadata.json +++ b/seed/rust-sdk/mixed-case/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/mixed-case/src/api/types/service_resource.rs b/seed/rust-sdk/mixed-case/src/api/types/service_resource.rs index 05ebf4dd5723..c0e85b6fa0d1 100644 --- a/seed/rust-sdk/mixed-case/src/api/types/service_resource.rs +++ b/seed/rust-sdk/mixed-case/src/api/types/service_resource.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "resource_type")] +#[non_exhaustive] pub enum Resource { #[serde(rename = "user")] #[non_exhaustive] @@ -17,6 +18,12 @@ pub enum Resource { name: String, status: ResourceStatus, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Resource { @@ -28,10 +35,17 @@ impl Resource { Self::Organization { name, status } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_status(&self) -> &ResourceStatus { match self { Self::User { status, .. } => status, Self::Organization { status, .. } => status, + Self::__Unknown(_) => panic!( + "get_status() called on __Unknown variant; inspect the raw JSON value directly" + ), } } } diff --git a/seed/rust-sdk/nullable-optional/.fern/metadata.json b/seed/rust-sdk/nullable-optional/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/nullable-optional/.fern/metadata.json +++ b/seed/rust-sdk/nullable-optional/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_notification_method.rs b/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_notification_method.rs index e80217fe7796..fe8914b8c5af 100644 --- a/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_notification_method.rs +++ b/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_notification_method.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum NotificationMethod { #[serde(rename = "email")] #[non_exhaustive] @@ -42,6 +43,12 @@ pub enum NotificationMethod { #[serde(skip_serializing_if = "Option::is_none")] badge: Option, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl NotificationMethod { @@ -98,4 +105,8 @@ impl NotificationMethod { badge: Some(badge), } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_search_result.rs b/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_search_result.rs index edecec666962..d1a33392ba81 100644 --- a/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_search_result.rs +++ b/seed/rust-sdk/nullable-optional/src/api/types/nullable_optional_search_result.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SearchResult { #[serde(rename = "user")] #[non_exhaustive] @@ -31,6 +32,12 @@ pub enum SearchResult { #[serde(skip_serializing_if = "Option::is_none")] tags: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SearchResult { @@ -83,4 +90,8 @@ impl SearchResult { tags: Some(tags), } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/nullable/.fern/metadata.json b/seed/rust-sdk/nullable/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/nullable/.fern/metadata.json +++ b/seed/rust-sdk/nullable/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/nullable/src/api/types/nullable_status.rs b/seed/rust-sdk/nullable/src/api/types/nullable_status.rs index 99b5b797f934..5f9c8019ce7a 100644 --- a/seed/rust-sdk/nullable/src/api/types/nullable_status.rs +++ b/seed/rust-sdk/nullable/src/api/types/nullable_status.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Status { #[serde(rename = "active")] #[non_exhaustive] @@ -22,6 +23,12 @@ pub enum Status { #[serde(with = "crate::core::flexible_datetime::offset::option")] value: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Status { @@ -36,4 +43,8 @@ impl Status { pub fn soft_deleted(value: Option>) -> Self { Self::SoftDeleted { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/property-access/.fern/metadata.json b/seed/rust-sdk/property-access/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/property-access/.fern/metadata.json +++ b/seed/rust-sdk/property-access/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/property-access/src/api/types/user_or_admin_discriminated.rs b/seed/rust-sdk/property-access/src/api/types/user_or_admin_discriminated.rs index 816238b4b86e..51524b0b80d8 100644 --- a/seed/rust-sdk/property-access/src/api/types/user_or_admin_discriminated.rs +++ b/seed/rust-sdk/property-access/src/api/types/user_or_admin_discriminated.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UserOrAdminDiscriminated { #[serde(rename = "user")] #[non_exhaustive] @@ -23,6 +24,12 @@ pub enum UserOrAdminDiscriminated { #[serde(rename = "empty")] #[non_exhaustive] Empty {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UserOrAdminDiscriminated { @@ -38,11 +45,18 @@ impl UserOrAdminDiscriminated { Self::Empty {} } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_normal(&self) -> &str { match self { Self::User { normal, .. } => normal, Self::Admin { normal, .. } => normal, Self::Empty { normal, .. } => normal, + Self::__Unknown(_) => panic!( + "get_normal() called on __Unknown variant; inspect the raw JSON value directly" + ), } } @@ -51,6 +65,9 @@ impl UserOrAdminDiscriminated { Self::User { foo, .. } => foo, Self::Admin { foo, .. } => foo, Self::Empty { foo, .. } => foo, + Self::__Unknown(_) => { + panic!("get_foo() called on __Unknown variant; inspect the raw JSON value directly") + } } } } diff --git a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json index f92fe43bfdc3..48c7c96fb8fc 100644 --- a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json +++ b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json @@ -8,8 +8,7 @@ "packageVersion": "0.1.0" }, "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event.rs b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event.rs index f0055ac9837b..2be7694868ca 100644 --- a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event.rs +++ b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamEvent { #[serde(rename = "completion")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum StreamEvent { #[serde(flatten)] data: ErrorEvent, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamEvent { @@ -26,4 +33,8 @@ impl StreamEvent { pub fn error(data: ErrorEvent) -> Self { Self::Error { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_context_protocol.rs b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_context_protocol.rs index 92b9008e020c..ada392128e49 100644 --- a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_context_protocol.rs +++ b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_context_protocol.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamEventContextProtocol { #[serde(rename = "completion")] #[non_exhaustive] @@ -25,6 +26,12 @@ pub enum StreamEventContextProtocol { #[serde(default)] name: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamEventContextProtocol { @@ -39,4 +46,8 @@ impl StreamEventContextProtocol { pub fn event(event: String, name: String) -> Self { Self::Event { event, name } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_discriminant_in_data.rs b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_discriminant_in_data.rs index da93310960d2..de3c97535472 100644 --- a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_discriminant_in_data.rs +++ b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/src/api/types/completions_stream_event_discriminant_in_data.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum StreamEventDiscriminantInData { #[serde(rename = "group.created")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum StreamEventDiscriminantInData { #[serde(default)] group_id: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamEventDiscriminantInData { @@ -30,4 +37,8 @@ impl StreamEventDiscriminantInData { pub fn group_deleted(offset: String, group_id: String) -> Self { Self::GroupDeleted { offset, group_id } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json b/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json +++ b/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_response.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_response.rs index b762cc85b1d8..c3bd8bc4aea4 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_response.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_response.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamDataContextResponse { #[serde(rename = "heartbeat")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum StreamDataContextResponse { #[serde(flatten)] data: DataContextEntityEvent, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamDataContextResponse { @@ -26,4 +33,8 @@ impl StreamDataContextResponse { pub fn entity(data: DataContextEntityEvent) -> Self { Self::Entity { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_with_envelope_schema_response.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_with_envelope_schema_response.rs index a420583031fd..f67359ff2373 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_with_envelope_schema_response.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_data_context_with_envelope_schema_response.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamDataContextWithEnvelopeSchemaResponse { #[serde(rename = "heartbeat")] #[non_exhaustive] @@ -30,6 +31,12 @@ pub enum StreamDataContextWithEnvelopeSchemaResponse { #[serde(flatten)] data: ProtocolObjectEvent, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamDataContextWithEnvelopeSchemaResponse { @@ -48,4 +55,8 @@ impl StreamDataContextWithEnvelopeSchemaResponse { pub fn object_data(data: ProtocolObjectEvent) -> Self { Self::ObjectData { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_no_context_response.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_no_context_response.rs index f8c7f6182402..9a6ea707a861 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_no_context_response.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_no_context_response.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamNoContextResponse { #[serde(rename = "heartbeat")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum StreamNoContextResponse { #[serde(flatten)] data: DataContextEntityEvent, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamNoContextResponse { @@ -26,4 +33,8 @@ impl StreamNoContextResponse { pub fn entity(data: DataContextEntityEvent) -> Self { Self::Entity { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_collision_response.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_collision_response.rs index c1bfe4f92baa..ecf5b84eed32 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_collision_response.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_collision_response.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamProtocolCollisionResponse { #[serde(rename = "heartbeat")] #[non_exhaustive] @@ -30,6 +31,12 @@ pub enum StreamProtocolCollisionResponse { #[serde(default)] data: ObjectPayloadWithEventField, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamProtocolCollisionResponse { @@ -48,4 +55,8 @@ impl StreamProtocolCollisionResponse { pub fn object_data(data: ObjectPayloadWithEventField) -> Self { Self::ObjectData { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_no_collision_response.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_no_collision_response.rs index 11d103436229..159d8923cde5 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_no_collision_response.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_no_collision_response.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamProtocolNoCollisionResponse { #[serde(rename = "heartbeat")] #[non_exhaustive] @@ -30,6 +31,12 @@ pub enum StreamProtocolNoCollisionResponse { #[serde(flatten)] data: ProtocolObjectEvent, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamProtocolNoCollisionResponse { @@ -48,4 +55,8 @@ impl StreamProtocolNoCollisionResponse { pub fn object_data(data: ProtocolObjectEvent) -> Self { Self::ObjectData { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_with_flat_schema_response.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_with_flat_schema_response.rs index 83f98c582ba1..20dbde2cc826 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_with_flat_schema_response.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_protocol_with_flat_schema_response.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "event")] +#[non_exhaustive] pub enum StreamProtocolWithFlatSchemaResponse { #[serde(rename = "heartbeat")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum StreamProtocolWithFlatSchemaResponse { #[serde(flatten)] data: DataContextEntityEvent, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamProtocolWithFlatSchemaResponse { @@ -26,4 +33,8 @@ impl StreamProtocolWithFlatSchemaResponse { pub fn entity(data: DataContextEntityEvent) -> Self { Self::Entity { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_request.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_request.rs index b16ce0e07dfa..2c36e4e6142e 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_request.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_request.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum StreamXFernStreamingUnionRequest { #[serde(rename = "message")] #[non_exhaustive] @@ -26,6 +27,12 @@ pub enum StreamXFernStreamingUnionRequest { data: UnionStreamCompactVariant, stream_response: bool, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamXFernStreamingUnionRequest { @@ -50,17 +57,16 @@ impl StreamXFernStreamingUnionRequest { } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_stream_response(&self) -> &bool { match self { - Self::Message { - stream_response, .. - } => stream_response, - Self::Interrupt { - stream_response, .. - } => stream_response, - Self::Compact { - stream_response, .. - } => stream_response, - } + Self::Message { stream_response, .. } => stream_response, + Self::Interrupt { stream_response, .. } => stream_response, + Self::Compact { stream_response, .. } => stream_response, + Self::__Unknown(_) => panic!("get_stream_response() called on __Unknown variant; inspect the raw JSON value directly"), + } } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_stream_request.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_stream_request.rs index 8b70d2d26fce..78790f937a37 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_stream_request.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/stream_x_fern_streaming_union_stream_request.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum StreamXFernStreamingUnionStreamRequest { #[serde(rename = "message")] #[non_exhaustive] @@ -26,6 +27,12 @@ pub enum StreamXFernStreamingUnionStreamRequest { data: UnionStreamCompactVariant, stream_response: bool, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl StreamXFernStreamingUnionStreamRequest { @@ -50,17 +57,16 @@ impl StreamXFernStreamingUnionStreamRequest { } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_stream_response(&self) -> &bool { match self { - Self::Message { - stream_response, .. - } => stream_response, - Self::Interrupt { - stream_response, .. - } => stream_response, - Self::Compact { - stream_response, .. - } => stream_response, - } + Self::Message { stream_response, .. } => stream_response, + Self::Interrupt { stream_response, .. } => stream_response, + Self::Compact { stream_response, .. } => stream_response, + Self::__Unknown(_) => panic!("get_stream_response() called on __Unknown variant; inspect the raw JSON value directly"), + } } } diff --git a/seed/rust-sdk/server-sent-events-openapi/src/api/types/union_stream_request.rs b/seed/rust-sdk/server-sent-events-openapi/src/api/types/union_stream_request.rs index 3f475b83abec..96c3f1864d36 100644 --- a/seed/rust-sdk/server-sent-events-openapi/src/api/types/union_stream_request.rs +++ b/seed/rust-sdk/server-sent-events-openapi/src/api/types/union_stream_request.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionStreamRequest { #[serde(rename = "message")] #[non_exhaustive] @@ -23,6 +24,12 @@ pub enum UnionStreamRequest { #[serde(flatten)] data: UnionStreamCompactVariant, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionStreamRequest { @@ -37,4 +44,8 @@ impl UnionStreamRequest { pub fn compact(data: UnionStreamCompactVariant) -> Self { Self::Compact { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/.fern/metadata.json b/seed/rust-sdk/trace/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/trace/.fern/metadata.json +++ b/seed/rust-sdk/trace/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/trace/src/api/types/admin_test.rs b/seed/rust-sdk/trace/src/api/types/admin_test.rs index 08012d9df493..6e1cab5108b1 100644 --- a/seed/rust-sdk/trace/src/api/types/admin_test.rs +++ b/seed/rust-sdk/trace/src/api/types/admin_test.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Test { #[serde(rename = "and")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Test { #[serde(rename = "or")] #[non_exhaustive] Or { value: bool }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Test { @@ -20,4 +27,8 @@ impl Test { pub fn or(value: bool) -> Self { Self::Or { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/commons_debug_variable_value.rs b/seed/rust-sdk/trace/src/api/types/commons_debug_variable_value.rs index a0774daec8ac..f83344564a37 100644 --- a/seed/rust-sdk/trace/src/api/types/commons_debug_variable_value.rs +++ b/seed/rust-sdk/trace/src/api/types/commons_debug_variable_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum DebugVariableValue { #[serde(rename = "integerValue")] #[non_exhaustive] @@ -86,6 +87,12 @@ pub enum DebugVariableValue { #[serde(default)] stringified_value: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl DebugVariableValue { @@ -159,4 +166,8 @@ impl DebugVariableValue { stringified_value, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/commons_variable_type.rs b/seed/rust-sdk/trace/src/api/types/commons_variable_type.rs index 68b0e21c8d12..022ccf2ca271 100644 --- a/seed/rust-sdk/trace/src/api/types/commons_variable_type.rs +++ b/seed/rust-sdk/trace/src/api/types/commons_variable_type.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum VariableType { #[serde(rename = "integerType")] #[non_exhaustive] @@ -53,6 +54,12 @@ pub enum VariableType { #[serde(rename = "doublyLinkedListType")] #[non_exhaustive] DoublyLinkedListType {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl VariableType { @@ -111,4 +118,8 @@ impl VariableType { is_fixed_length: Some(is_fixed_length), } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/commons_variable_value.rs b/seed/rust-sdk/trace/src/api/types/commons_variable_value.rs index 2bf3b2a4ac6a..3a4acc25be96 100644 --- a/seed/rust-sdk/trace/src/api/types/commons_variable_value.rs +++ b/seed/rust-sdk/trace/src/api/types/commons_variable_value.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum VariableValue { #[serde(rename = "integerValue")] #[non_exhaustive] @@ -59,6 +60,12 @@ pub enum VariableValue { #[serde(rename = "nullValue")] #[non_exhaustive] NullValue {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl VariableValue { @@ -105,4 +112,8 @@ impl VariableValue { pub fn null_value() -> Self { Self::NullValue {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/playlist_playlist_id_not_found_error_body.rs b/seed/rust-sdk/trace/src/api/types/playlist_playlist_id_not_found_error_body.rs index 606131b072dc..d75207dbf051 100644 --- a/seed/rust-sdk/trace/src/api/types/playlist_playlist_id_not_found_error_body.rs +++ b/seed/rust-sdk/trace/src/api/types/playlist_playlist_id_not_found_error_body.rs @@ -1,15 +1,26 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum PlaylistIdNotFoundErrorBody { #[serde(rename = "playlistId")] #[non_exhaustive] PlaylistId { value: PlaylistId }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl PlaylistIdNotFoundErrorBody { pub fn playlist_id(value: PlaylistId) -> Self { Self::PlaylistId { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/problem_create_problem_error.rs b/seed/rust-sdk/trace/src/api/types/problem_create_problem_error.rs index db8cafbafd1b..98fe74ac9252 100644 --- a/seed/rust-sdk/trace/src/api/types/problem_create_problem_error.rs +++ b/seed/rust-sdk/trace/src/api/types/problem_create_problem_error.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "_type")] +#[non_exhaustive] pub enum CreateProblemError { #[serde(rename = "generic")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum CreateProblemError { #[serde(default)] stacktrace: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl CreateProblemError { @@ -23,4 +30,8 @@ impl CreateProblemError { stacktrace, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/problem_create_problem_response.rs b/seed/rust-sdk/trace/src/api/types/problem_create_problem_response.rs index 0ea3a1247ecf..6a3867863bbf 100644 --- a/seed/rust-sdk/trace/src/api/types/problem_create_problem_response.rs +++ b/seed/rust-sdk/trace/src/api/types/problem_create_problem_response.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum CreateProblemResponse { #[serde(rename = "success")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum CreateProblemResponse { #[serde(rename = "error")] #[non_exhaustive] Error { value: CreateProblemError }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl CreateProblemResponse { @@ -20,4 +27,8 @@ impl CreateProblemResponse { pub fn error(value: CreateProblemError) -> Self { Self::Error { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/problem_problem_description_board.rs b/seed/rust-sdk/trace/src/api/types/problem_problem_description_board.rs index f5c46e79dd42..f191c60182d7 100644 --- a/seed/rust-sdk/trace/src/api/types/problem_problem_description_board.rs +++ b/seed/rust-sdk/trace/src/api/types/problem_problem_description_board.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum ProblemDescriptionBoard { #[serde(rename = "html")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum ProblemDescriptionBoard { #[serde(rename = "testCaseId")] #[non_exhaustive] TestCaseId { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl ProblemDescriptionBoard { @@ -28,4 +35,8 @@ impl ProblemDescriptionBoard { pub fn test_case_id(value: String) -> Self { Self::TestCaseId { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_actual_result.rs b/seed/rust-sdk/trace/src/api/types/submission_actual_result.rs index c70c6a3b475f..7995b37db56a 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_actual_result.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_actual_result.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum ActualResult { #[serde(rename = "value")] #[non_exhaustive] @@ -17,6 +18,12 @@ pub enum ActualResult { #[serde(rename = "exceptionV2")] #[non_exhaustive] ExceptionV2 { value: ExceptionV2 }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl ActualResult { @@ -31,4 +38,8 @@ impl ActualResult { pub fn exception_v2(value: ExceptionV2) -> Self { Self::ExceptionV2 { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_code_execution_update.rs b/seed/rust-sdk/trace/src/api/types/submission_code_execution_update.rs index 73f9903e2943..d086e326809d 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_code_execution_update.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_code_execution_update.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum CodeExecutionUpdate { #[serde(rename = "buildingExecutor")] #[non_exhaustive] @@ -120,6 +121,12 @@ pub enum CodeExecutionUpdate { #[serde(default)] submission_id: SubmissionId, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl CodeExecutionUpdate { @@ -248,4 +255,8 @@ impl CodeExecutionUpdate { test_case_id: Some(test_case_id), } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_error_info.rs b/seed/rust-sdk/trace/src/api/types/submission_error_info.rs index 64f046774790..20d7fe10cc1e 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_error_info.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_error_info.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum ErrorInfo { #[serde(rename = "compileError")] #[non_exhaustive] @@ -24,6 +25,12 @@ pub enum ErrorInfo { #[serde(default)] exception_info: ExceptionInfo, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl ErrorInfo { @@ -38,4 +45,8 @@ impl ErrorInfo { pub fn internal_error(exception_info: ExceptionInfo) -> Self { Self::InternalError { exception_info } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_exception_v_2.rs b/seed/rust-sdk/trace/src/api/types/submission_exception_v_2.rs index 3adaa7702e26..cc592eb89b01 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_exception_v_2.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_exception_v_2.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum ExceptionV2 { #[serde(rename = "generic")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum ExceptionV2 { #[serde(rename = "timeout")] #[non_exhaustive] Timeout {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl ExceptionV2 { @@ -23,4 +30,8 @@ impl ExceptionV2 { pub fn timeout() -> Self { Self::Timeout {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_invalid_request_cause.rs b/seed/rust-sdk/trace/src/api/types/submission_invalid_request_cause.rs index bd3f2b94db11..3d24bd8a1870 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_invalid_request_cause.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_invalid_request_cause.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum InvalidRequestCause { #[serde(rename = "submissionIdNotFound")] #[non_exhaustive] @@ -30,6 +31,12 @@ pub enum InvalidRequestCause { #[serde(rename = "actualLanguage")] actual_language: Language, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl InvalidRequestCause { @@ -55,4 +62,8 @@ impl InvalidRequestCause { actual_language, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_submission_request.rs b/seed/rust-sdk/trace/src/api/types/submission_submission_request.rs index f4ce1e42afe0..81cb86e5675b 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_submission_request.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_submission_request.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SubmissionRequest { #[serde(rename = "initializeProblemRequest")] #[non_exhaustive] @@ -61,6 +62,12 @@ pub enum SubmissionRequest { #[serde(default)] submission_id: SubmissionId, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SubmissionRequest { @@ -167,4 +174,8 @@ impl SubmissionRequest { user_id: Some(user_id), } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_submission_response.rs b/seed/rust-sdk/trace/src/api/types/submission_submission_response.rs index 2f7d65863cd9..de9fe03af83f 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_submission_response.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_submission_response.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SubmissionResponse { #[serde(rename = "serverInitialized")] #[non_exhaustive] @@ -29,6 +30,12 @@ pub enum SubmissionResponse { #[serde(rename = "terminated")] #[non_exhaustive] Terminated {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SubmissionResponse { @@ -55,4 +62,8 @@ impl SubmissionResponse { pub fn terminated() -> Self { Self::Terminated {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_submission_status_for_test_case.rs b/seed/rust-sdk/trace/src/api/types/submission_submission_status_for_test_case.rs index 92efa9d68ae5..20eb18a951c5 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_submission_status_for_test_case.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_submission_status_for_test_case.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SubmissionStatusForTestCase { #[serde(rename = "graded")] #[non_exhaustive] @@ -22,6 +23,12 @@ pub enum SubmissionStatusForTestCase { #[serde(default)] trace_responses_size: i64, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SubmissionStatusForTestCase { @@ -39,4 +46,8 @@ impl SubmissionStatusForTestCase { trace_responses_size, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_submission_status_v_2.rs b/seed/rust-sdk/trace/src/api/types/submission_submission_status_v_2.rs index 0f08fb86ac83..a3db0ad5fdd9 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_submission_status_v_2.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_submission_status_v_2.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SubmissionStatusV2 { #[serde(rename = "test")] #[non_exhaustive] @@ -24,6 +25,12 @@ pub enum SubmissionStatusV2 { #[serde(default)] updates: Vec, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SubmissionStatusV2 { @@ -44,4 +51,8 @@ impl SubmissionStatusV2 { pub fn workspace(updates: Vec) -> Self { Self::Workspace { updates } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_submission_type_state.rs b/seed/rust-sdk/trace/src/api/types/submission_submission_type_state.rs index f8587d015338..0650844c4844 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_submission_type_state.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_submission_type_state.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum SubmissionTypeState { #[serde(rename = "test")] #[non_exhaustive] @@ -21,6 +22,12 @@ pub enum SubmissionTypeState { #[serde(rename = "workspace")] #[non_exhaustive] Workspace { status: WorkspaceSubmissionStatus }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl SubmissionTypeState { @@ -41,4 +48,8 @@ impl SubmissionTypeState { pub fn workspace(status: WorkspaceSubmissionStatus) -> Self { Self::Workspace { status } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_test_case_grade.rs b/seed/rust-sdk/trace/src/api/types/submission_test_case_grade.rs index 3344753cfe42..0c810a500683 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_test_case_grade.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_test_case_grade.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseGrade { #[serde(rename = "hidden")] #[non_exhaustive] @@ -23,6 +24,12 @@ pub enum TestCaseGrade { #[serde(default)] stdout: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseGrade { @@ -66,4 +73,8 @@ impl TestCaseGrade { stdout, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_test_submission_status.rs b/seed/rust-sdk/trace/src/api/types/submission_test_submission_status.rs index f8f3147bede2..c954a8fdf0c4 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_test_submission_status.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_test_submission_status.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestSubmissionStatus { #[serde(rename = "stopped")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum TestSubmissionStatus { TestCaseIdToState { value: HashMap, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestSubmissionStatus { @@ -38,4 +45,8 @@ impl TestSubmissionStatus { pub fn test_case_id_to_state(value: HashMap) -> Self { Self::TestCaseIdToState { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_test_submission_update_info.rs b/seed/rust-sdk/trace/src/api/types/submission_test_submission_update_info.rs index 854dba887594..a24309aa34af 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_test_submission_update_info.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_test_submission_update_info.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestSubmissionUpdateInfo { #[serde(rename = "running")] #[non_exhaustive] @@ -38,6 +39,12 @@ pub enum TestSubmissionUpdateInfo { #[serde(rename = "finished")] #[non_exhaustive] Finished {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestSubmissionUpdateInfo { @@ -70,4 +77,8 @@ impl TestSubmissionUpdateInfo { pub fn finished() -> Self { Self::Finished {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_status.rs b/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_status.rs index 7f9564a3d218..26b430a60a0c 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_status.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_status.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum WorkspaceSubmissionStatus { #[serde(rename = "stopped")] #[non_exhaustive] @@ -28,6 +29,12 @@ pub enum WorkspaceSubmissionStatus { #[serde(flatten)] data: WorkspaceRunDetails, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl WorkspaceSubmissionStatus { @@ -50,4 +57,8 @@ impl WorkspaceSubmissionStatus { pub fn traced(data: WorkspaceRunDetails) -> Self { Self::Traced { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_update_info.rs b/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_update_info.rs index 202f013b3f72..fecfaa53706b 100644 --- a/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_update_info.rs +++ b/seed/rust-sdk/trace/src/api/types/submission_workspace_submission_update_info.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum WorkspaceSubmissionUpdateInfo { #[serde(rename = "running")] #[non_exhaustive] @@ -37,6 +38,12 @@ pub enum WorkspaceSubmissionUpdateInfo { #[serde(rename = "finished")] #[non_exhaustive] Finished {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl WorkspaceSubmissionUpdateInfo { @@ -69,4 +76,8 @@ impl WorkspaceSubmissionUpdateInfo { pub fn finished() -> Self { Self::Finished {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_problem_assert_correctness_check.rs b/seed/rust-sdk/trace/src/api/types/v_2_problem_assert_correctness_check.rs index 54a0a24f4366..24ed731c1a2b 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_problem_assert_correctness_check.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_problem_assert_correctness_check.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum AssertCorrectnessCheck { #[serde(rename = "deepEquality")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum AssertCorrectnessCheck { #[serde(default)] code: FunctionImplementationForMultipleLanguages, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl AssertCorrectnessCheck { @@ -38,4 +45,8 @@ impl AssertCorrectnessCheck { code, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_problem_custom_files.rs b/seed/rust-sdk/trace/src/api/types/v_2_problem_custom_files.rs index d0d0acc91a3e..bf744988f30b 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_problem_custom_files.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_problem_custom_files.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum CustomFiles { #[serde(rename = "basic")] #[non_exhaustive] @@ -21,6 +22,12 @@ pub enum CustomFiles { #[serde(rename = "custom")] #[non_exhaustive] Custom { value: HashMap }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl CustomFiles { @@ -41,4 +48,8 @@ impl CustomFiles { pub fn custom(value: HashMap) -> Self { Self::Custom { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_problem_function_signature.rs b/seed/rust-sdk/trace/src/api/types/v_2_problem_function_signature.rs index 84ad355e48b0..7a8fdf3379b6 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_problem_function_signature.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_problem_function_signature.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum FunctionSignature { #[serde(rename = "void")] #[non_exhaustive] @@ -25,6 +26,12 @@ pub enum FunctionSignature { #[serde(rename = "actualResultType")] actual_result_type: VariableType, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl FunctionSignature { @@ -45,4 +52,8 @@ impl FunctionSignature { actual_result_type, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_function.rs b/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_function.rs index 36ef3a1991fd..c5d461aee26e 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_function.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_function.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseFunction { #[serde(rename = "withActualResult")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum TestCaseFunction { #[serde(default)] code: FunctionImplementationForMultipleLanguages, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseFunction { @@ -39,4 +46,8 @@ impl TestCaseFunction { ) -> Self { Self::Custom { parameters, code } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_description_board.rs b/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_description_board.rs index 276ef95b5b59..d87c4f1da83e 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_description_board.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_description_board.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseImplementationDescriptionBoard { #[serde(rename = "html")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum TestCaseImplementationDescriptionBoard { #[serde(rename = "paramId")] #[non_exhaustive] ParamId { value: ParameterId }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseImplementationDescriptionBoard { @@ -20,4 +27,8 @@ impl TestCaseImplementationDescriptionBoard { pub fn param_id(value: ParameterId) -> Self { Self::ParamId { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_reference.rs b/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_reference.rs index 73609b5faaaa..fc9eff4ba76f 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_reference.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_problem_test_case_implementation_reference.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseImplementationReference { #[serde(rename = "templateId")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum TestCaseImplementationReference { #[serde(flatten)] data: TestCaseImplementation, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseImplementationReference { @@ -23,4 +30,8 @@ impl TestCaseImplementationReference { pub fn implementation(data: TestCaseImplementation) -> Self { Self::Implementation { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_assert_correctness_check.rs b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_assert_correctness_check.rs index a0903662cb0a..792575647507 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_assert_correctness_check.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_assert_correctness_check.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum AssertCorrectnessCheck2 { #[serde(rename = "deepEquality")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum AssertCorrectnessCheck2 { #[serde(default)] code: FunctionImplementationForMultipleLanguages2, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl AssertCorrectnessCheck2 { @@ -38,4 +45,8 @@ impl AssertCorrectnessCheck2 { code, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_custom_files.rs b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_custom_files.rs index 4c6eb8323c5e..e3300b46a112 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_custom_files.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_custom_files.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum CustomFiles2 { #[serde(rename = "basic")] #[non_exhaustive] @@ -21,6 +22,12 @@ pub enum CustomFiles2 { #[serde(rename = "custom")] #[non_exhaustive] Custom { value: HashMap }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl CustomFiles2 { @@ -41,4 +48,8 @@ impl CustomFiles2 { pub fn custom(value: HashMap) -> Self { Self::Custom { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_function_signature.rs b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_function_signature.rs index 1722cd738b74..ae88f2d0a6fc 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_function_signature.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_function_signature.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum FunctionSignature2 { #[serde(rename = "void")] #[non_exhaustive] @@ -25,6 +26,12 @@ pub enum FunctionSignature2 { #[serde(rename = "actualResultType")] actual_result_type: VariableType, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl FunctionSignature2 { @@ -45,4 +52,8 @@ impl FunctionSignature2 { actual_result_type, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_function.rs b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_function.rs index 6044f85d5c3b..385379c41d26 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_function.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_function.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseFunction2 { #[serde(rename = "withActualResult")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum TestCaseFunction2 { #[serde(default)] code: FunctionImplementationForMultipleLanguages2, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseFunction2 { @@ -39,4 +46,8 @@ impl TestCaseFunction2 { ) -> Self { Self::Custom { parameters, code } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_description_board.rs b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_description_board.rs index b94dc2b42a46..56f6915038d0 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_description_board.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_description_board.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseImplementationDescriptionBoard2 { #[serde(rename = "html")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum TestCaseImplementationDescriptionBoard2 { #[serde(rename = "paramId")] #[non_exhaustive] ParamId { value: ParameterId2 }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseImplementationDescriptionBoard2 { @@ -20,4 +27,8 @@ impl TestCaseImplementationDescriptionBoard2 { pub fn param_id(value: ParameterId2) -> Self { Self::ParamId { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_reference.rs b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_reference.rs index acdd5349f6cf..1ab0101f7b10 100644 --- a/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_reference.rs +++ b/seed/rust-sdk/trace/src/api/types/v_2_v_3_problem_test_case_implementation_reference.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum TestCaseImplementationReference2 { #[serde(rename = "templateId")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum TestCaseImplementationReference2 { #[serde(flatten)] data: TestCaseImplementation2, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl TestCaseImplementationReference2 { @@ -23,4 +30,8 @@ impl TestCaseImplementationReference2 { pub fn implementation(data: TestCaseImplementation2) -> Self { Self::Implementation { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/.fern/metadata.json b/seed/rust-sdk/unions-with-local-date/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/unions-with-local-date/.fern/metadata.json +++ b/seed/rust-sdk/unions-with-local-date/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/bigunion_big_union.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/bigunion_big_union.rs index a15d531df5be..762f22a3e728 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/bigunion_big_union.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/bigunion_big_union.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum BigUnion { #[serde(rename = "normalSweet")] #[non_exhaustive] @@ -466,6 +467,12 @@ pub enum BigUnion { #[serde(with = "crate::core::flexible_datetime::offset::option")] archived_at: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl BigUnion { @@ -875,6 +882,10 @@ impl BigUnion { } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::NormalSweet { id, .. } => id, @@ -906,6 +917,9 @@ impl BigUnion { Self::PotableBad { id, .. } => id, Self::TriangularRepair { id, .. } => id, Self::GaseousRoad { id, .. } => id, + Self::__Unknown(_) => { + panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly") + } } } @@ -940,40 +954,44 @@ impl BigUnion { Self::PotableBad { created_at, .. } => created_at, Self::TriangularRepair { created_at, .. } => created_at, Self::GaseousRoad { created_at, .. } => created_at, + Self::__Unknown(_) => panic!( + "get_created_at() called on __Unknown variant; inspect the raw JSON value directly" + ), } } pub fn get_archived_at(&self) -> &Option> { match self { - Self::NormalSweet { archived_at, .. } => archived_at, - Self::ThankfulFactor { archived_at, .. } => archived_at, - Self::JumboEnd { archived_at, .. } => archived_at, - Self::HastyPain { archived_at, .. } => archived_at, - Self::MistySnow { archived_at, .. } => archived_at, - Self::DistinctFailure { archived_at, .. } => archived_at, - Self::PracticalPrinciple { archived_at, .. } => archived_at, - Self::LimpingStep { archived_at, .. } => archived_at, - Self::VibrantExcitement { archived_at, .. } => archived_at, - Self::ActiveDiamond { archived_at, .. } => archived_at, - Self::PopularLimit { archived_at, .. } => archived_at, - Self::FalseMirror { archived_at, .. } => archived_at, - Self::PrimaryBlock { archived_at, .. } => archived_at, - Self::RotatingRatio { archived_at, .. } => archived_at, - Self::ColorfulCover { archived_at, .. } => archived_at, - Self::DisloyalValue { archived_at, .. } => archived_at, - Self::GruesomeCoach { archived_at, .. } => archived_at, - Self::TotalWork { archived_at, .. } => archived_at, - Self::HarmoniousPlay { archived_at, .. } => archived_at, - Self::UniqueStress { archived_at, .. } => archived_at, - Self::UnwillingSmoke { archived_at, .. } => archived_at, - Self::FrozenSleep { archived_at, .. } => archived_at, - Self::DiligentDeal { archived_at, .. } => archived_at, - Self::AttractiveScript { archived_at, .. } => archived_at, - Self::HoarseMouse { archived_at, .. } => archived_at, - Self::CircularCard { archived_at, .. } => archived_at, - Self::PotableBad { archived_at, .. } => archived_at, - Self::TriangularRepair { archived_at, .. } => archived_at, - Self::GaseousRoad { archived_at, .. } => archived_at, - } + Self::NormalSweet { archived_at, .. } => archived_at, + Self::ThankfulFactor { archived_at, .. } => archived_at, + Self::JumboEnd { archived_at, .. } => archived_at, + Self::HastyPain { archived_at, .. } => archived_at, + Self::MistySnow { archived_at, .. } => archived_at, + Self::DistinctFailure { archived_at, .. } => archived_at, + Self::PracticalPrinciple { archived_at, .. } => archived_at, + Self::LimpingStep { archived_at, .. } => archived_at, + Self::VibrantExcitement { archived_at, .. } => archived_at, + Self::ActiveDiamond { archived_at, .. } => archived_at, + Self::PopularLimit { archived_at, .. } => archived_at, + Self::FalseMirror { archived_at, .. } => archived_at, + Self::PrimaryBlock { archived_at, .. } => archived_at, + Self::RotatingRatio { archived_at, .. } => archived_at, + Self::ColorfulCover { archived_at, .. } => archived_at, + Self::DisloyalValue { archived_at, .. } => archived_at, + Self::GruesomeCoach { archived_at, .. } => archived_at, + Self::TotalWork { archived_at, .. } => archived_at, + Self::HarmoniousPlay { archived_at, .. } => archived_at, + Self::UniqueStress { archived_at, .. } => archived_at, + Self::UnwillingSmoke { archived_at, .. } => archived_at, + Self::FrozenSleep { archived_at, .. } => archived_at, + Self::DiligentDeal { archived_at, .. } => archived_at, + Self::AttractiveScript { archived_at, .. } => archived_at, + Self::HoarseMouse { archived_at, .. } => archived_at, + Self::CircularCard { archived_at, .. } => archived_at, + Self::PotableBad { archived_at, .. } => archived_at, + Self::TriangularRepair { archived_at, .. } => archived_at, + Self::GaseousRoad { archived_at, .. } => archived_at, + Self::__Unknown(_) => panic!("get_archived_at() called on __Unknown variant; inspect the raw JSON value directly"), + } } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union.rs index 35ceeb9ae8b9..b4486f766994 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Union { #[serde(rename = "foo")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Union { #[serde(rename = "bar")] #[non_exhaustive] Bar { bar: Bar }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Union { @@ -20,4 +27,8 @@ impl Union { pub fn bar(bar: Bar) -> Self { Self::Bar { bar } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_base_properties.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_base_properties.rs index 477c9c246724..af2847b9a853 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_base_properties.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_base_properties.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithBaseProperties { #[serde(rename = "integer")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum UnionWithBaseProperties { data: Foo, id: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithBaseProperties { @@ -33,11 +40,18 @@ impl UnionWithBaseProperties { Self::Foo { data, id } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::Integer { id, .. } => id, Self::String { id, .. } => id, Self::Foo { id, .. } => id, + Self::__Unknown(_) => { + panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly") + } } } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_discriminant.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_discriminant.rs index ba3ef07f582b..cc9e999998e6 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_discriminant.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_discriminant.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "_type")] +#[non_exhaustive] pub enum UnionWithDiscriminant { #[serde(rename = "foo")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum UnionWithDiscriminant { #[serde(rename = "bar")] #[non_exhaustive] Bar { bar: Bar }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDiscriminant { @@ -20,4 +27,8 @@ impl UnionWithDiscriminant { pub fn bar(bar: Bar) -> Self { Self::Bar { bar } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_primitive.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_primitive.rs index 727cea9ac40b..50d970ea7811 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_primitive.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_primitive.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithDuplicatePrimitive { #[serde(rename = "integer1")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum UnionWithDuplicatePrimitive { #[serde(rename = "string2")] #[non_exhaustive] String2 { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDuplicatePrimitive { @@ -36,4 +43,8 @@ impl UnionWithDuplicatePrimitive { pub fn string2(value: String) -> Self { Self::String2 { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_types.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_types.rs index 01c63d0f8f18..5242c58cc858 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_types.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_duplicate_types.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithDuplicateTypes { #[serde(rename = "foo1")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum UnionWithDuplicateTypes { #[serde(flatten)] data: Foo, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDuplicateTypes { @@ -26,4 +33,8 @@ impl UnionWithDuplicateTypes { pub fn foo2(data: Foo) -> Self { Self::Foo2 { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_literal.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_literal.rs index d89a8c96c79c..7370f4162528 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_literal.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_literal.rs @@ -1,11 +1,18 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithLiteral { #[serde(rename = "fern")] #[non_exhaustive] Fern { value: String, base: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithLiteral { @@ -13,9 +20,16 @@ impl UnionWithLiteral { Self::Fern { value, base } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_base(&self) -> &str { match self { Self::Fern { base, .. } => base, + Self::__Unknown(_) => panic!( + "get_base() called on __Unknown variant; inspect the raw JSON value directly" + ), } } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_multiple_no_properties.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_multiple_no_properties.rs index 279ca2d78ac5..d9fe82459f73 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_multiple_no_properties.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_multiple_no_properties.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithMultipleNoProperties { #[serde(rename = "foo")] #[non_exhaustive] @@ -17,6 +18,12 @@ pub enum UnionWithMultipleNoProperties { #[serde(rename = "empty2")] #[non_exhaustive] Empty2 {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithMultipleNoProperties { @@ -31,4 +38,8 @@ impl UnionWithMultipleNoProperties { pub fn empty2() -> Self { Self::Empty2 {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_no_properties.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_no_properties.rs index 05ae31ddb6a8..e9dfa8e69a6b 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_no_properties.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_no_properties.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithNoProperties { #[serde(rename = "foo")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum UnionWithNoProperties { #[serde(rename = "empty")] #[non_exhaustive] Empty {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithNoProperties { @@ -23,4 +30,8 @@ impl UnionWithNoProperties { pub fn empty() -> Self { Self::Empty {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_optional_time.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_optional_time.rs index 5bb565cd312c..c9de10ac24fd 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_optional_time.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_optional_time.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithOptionalTime { #[serde(rename = "date")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum UnionWithOptionalTime { #[serde(with = "crate::core::flexible_datetime::offset::option")] value: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithOptionalTime { @@ -24,4 +31,8 @@ impl UnionWithOptionalTime { pub fn datetime(value: Option>) -> Self { Self::Datetime { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_primitive.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_primitive.rs index 7a7799b94cb0..9e053c84d60c 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_primitive.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_primitive.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithPrimitive { #[serde(rename = "integer")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum UnionWithPrimitive { #[serde(rename = "string")] #[non_exhaustive] r#String { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithPrimitive { @@ -20,4 +27,8 @@ impl UnionWithPrimitive { pub fn string(value: String) -> Self { Self::r#String { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_number_types.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_number_types.rs index 402d11d3db73..0a65e3921e99 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_number_types.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_number_types.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSameNumberTypes { #[serde(rename = "positiveInt")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum UnionWithSameNumberTypes { #[serde(rename = "anyNumber")] #[non_exhaustive] AnyNumber { value: f64 }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSameNumberTypes { @@ -28,4 +35,8 @@ impl UnionWithSameNumberTypes { pub fn any_number(value: f64) -> Self { Self::AnyNumber { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_string_types.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_string_types.rs index ef8beefee7e4..e1b05092aa28 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_string_types.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_same_string_types.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSameStringTypes { #[serde(rename = "customFormat")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum UnionWithSameStringTypes { #[serde(rename = "patternString")] #[non_exhaustive] PatternString { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSameStringTypes { @@ -28,4 +35,8 @@ impl UnionWithSameStringTypes { pub fn pattern_string(value: String) -> Self { Self::PatternString { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_single_element.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_single_element.rs index 3769217cb468..9234e4dda2dd 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_single_element.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_single_element.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSingleElement { #[serde(rename = "foo")] #[non_exhaustive] @@ -9,10 +10,20 @@ pub enum UnionWithSingleElement { #[serde(flatten)] data: Foo, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSingleElement { pub fn foo(data: Foo) -> Self { Self::Foo { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_sub_types.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_sub_types.rs index 82a479490671..7bd821568a5a 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_sub_types.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_sub_types.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSubTypes { #[serde(rename = "foo")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum UnionWithSubTypes { #[serde(default)] age: i64, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSubTypes { @@ -26,4 +33,8 @@ impl UnionWithSubTypes { pub fn foo_extended(age: i64) -> Self { Self::FooExtended { age } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_time.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_time.rs index 73b97c0209b5..4434b0b43079 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_time.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_with_time.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithTime { #[serde(rename = "value")] #[non_exhaustive] @@ -17,6 +18,12 @@ pub enum UnionWithTime { #[serde(with = "crate::core::flexible_datetime::offset")] value: DateTime, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithTime { @@ -31,4 +38,8 @@ impl UnionWithTime { pub fn datetime(value: DateTime) -> Self { Self::Datetime { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_without_key.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_without_key.rs index 425f605cdf0a..bf170940ff99 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_without_key.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/types_union_without_key.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithoutKey { #[serde(rename = "foo")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum UnionWithoutKey { #[serde(flatten)] data: Bar, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithoutKey { @@ -26,4 +33,8 @@ impl UnionWithoutKey { pub fn bar(data: Bar) -> Self { Self::Bar { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions-with-local-date/src/api/types/union_shape.rs b/seed/rust-sdk/unions-with-local-date/src/api/types/union_shape.rs index e3254b3b07b1..a665d2ca40a9 100644 --- a/seed/rust-sdk/unions-with-local-date/src/api/types/union_shape.rs +++ b/seed/rust-sdk/unions-with-local-date/src/api/types/union_shape.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Shape { #[serde(rename = "circle")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum Shape { length: f64, id: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Shape { @@ -31,10 +38,17 @@ impl Shape { Self::Square { length, id } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::Circle { id, .. } => id, Self::Square { id, .. } => id, + Self::__Unknown(_) => { + panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly") + } } } } diff --git a/seed/rust-sdk/unions/.fern/metadata.json b/seed/rust-sdk/unions/.fern/metadata.json index d566e7c8be4d..b663fd7f2194 100644 --- a/seed/rust-sdk/unions/.fern/metadata.json +++ b/seed/rust-sdk/unions/.fern/metadata.json @@ -3,8 +3,7 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "ci", + "invokedBy": "manual", "requestedVersion": "0.0.1", - "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/unions/src/api/types/bigunion_big_union.rs b/seed/rust-sdk/unions/src/api/types/bigunion_big_union.rs index a15d531df5be..762f22a3e728 100644 --- a/seed/rust-sdk/unions/src/api/types/bigunion_big_union.rs +++ b/seed/rust-sdk/unions/src/api/types/bigunion_big_union.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum BigUnion { #[serde(rename = "normalSweet")] #[non_exhaustive] @@ -466,6 +467,12 @@ pub enum BigUnion { #[serde(with = "crate::core::flexible_datetime::offset::option")] archived_at: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl BigUnion { @@ -875,6 +882,10 @@ impl BigUnion { } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::NormalSweet { id, .. } => id, @@ -906,6 +917,9 @@ impl BigUnion { Self::PotableBad { id, .. } => id, Self::TriangularRepair { id, .. } => id, Self::GaseousRoad { id, .. } => id, + Self::__Unknown(_) => { + panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly") + } } } @@ -940,40 +954,44 @@ impl BigUnion { Self::PotableBad { created_at, .. } => created_at, Self::TriangularRepair { created_at, .. } => created_at, Self::GaseousRoad { created_at, .. } => created_at, + Self::__Unknown(_) => panic!( + "get_created_at() called on __Unknown variant; inspect the raw JSON value directly" + ), } } pub fn get_archived_at(&self) -> &Option> { match self { - Self::NormalSweet { archived_at, .. } => archived_at, - Self::ThankfulFactor { archived_at, .. } => archived_at, - Self::JumboEnd { archived_at, .. } => archived_at, - Self::HastyPain { archived_at, .. } => archived_at, - Self::MistySnow { archived_at, .. } => archived_at, - Self::DistinctFailure { archived_at, .. } => archived_at, - Self::PracticalPrinciple { archived_at, .. } => archived_at, - Self::LimpingStep { archived_at, .. } => archived_at, - Self::VibrantExcitement { archived_at, .. } => archived_at, - Self::ActiveDiamond { archived_at, .. } => archived_at, - Self::PopularLimit { archived_at, .. } => archived_at, - Self::FalseMirror { archived_at, .. } => archived_at, - Self::PrimaryBlock { archived_at, .. } => archived_at, - Self::RotatingRatio { archived_at, .. } => archived_at, - Self::ColorfulCover { archived_at, .. } => archived_at, - Self::DisloyalValue { archived_at, .. } => archived_at, - Self::GruesomeCoach { archived_at, .. } => archived_at, - Self::TotalWork { archived_at, .. } => archived_at, - Self::HarmoniousPlay { archived_at, .. } => archived_at, - Self::UniqueStress { archived_at, .. } => archived_at, - Self::UnwillingSmoke { archived_at, .. } => archived_at, - Self::FrozenSleep { archived_at, .. } => archived_at, - Self::DiligentDeal { archived_at, .. } => archived_at, - Self::AttractiveScript { archived_at, .. } => archived_at, - Self::HoarseMouse { archived_at, .. } => archived_at, - Self::CircularCard { archived_at, .. } => archived_at, - Self::PotableBad { archived_at, .. } => archived_at, - Self::TriangularRepair { archived_at, .. } => archived_at, - Self::GaseousRoad { archived_at, .. } => archived_at, - } + Self::NormalSweet { archived_at, .. } => archived_at, + Self::ThankfulFactor { archived_at, .. } => archived_at, + Self::JumboEnd { archived_at, .. } => archived_at, + Self::HastyPain { archived_at, .. } => archived_at, + Self::MistySnow { archived_at, .. } => archived_at, + Self::DistinctFailure { archived_at, .. } => archived_at, + Self::PracticalPrinciple { archived_at, .. } => archived_at, + Self::LimpingStep { archived_at, .. } => archived_at, + Self::VibrantExcitement { archived_at, .. } => archived_at, + Self::ActiveDiamond { archived_at, .. } => archived_at, + Self::PopularLimit { archived_at, .. } => archived_at, + Self::FalseMirror { archived_at, .. } => archived_at, + Self::PrimaryBlock { archived_at, .. } => archived_at, + Self::RotatingRatio { archived_at, .. } => archived_at, + Self::ColorfulCover { archived_at, .. } => archived_at, + Self::DisloyalValue { archived_at, .. } => archived_at, + Self::GruesomeCoach { archived_at, .. } => archived_at, + Self::TotalWork { archived_at, .. } => archived_at, + Self::HarmoniousPlay { archived_at, .. } => archived_at, + Self::UniqueStress { archived_at, .. } => archived_at, + Self::UnwillingSmoke { archived_at, .. } => archived_at, + Self::FrozenSleep { archived_at, .. } => archived_at, + Self::DiligentDeal { archived_at, .. } => archived_at, + Self::AttractiveScript { archived_at, .. } => archived_at, + Self::HoarseMouse { archived_at, .. } => archived_at, + Self::CircularCard { archived_at, .. } => archived_at, + Self::PotableBad { archived_at, .. } => archived_at, + Self::TriangularRepair { archived_at, .. } => archived_at, + Self::GaseousRoad { archived_at, .. } => archived_at, + Self::__Unknown(_) => panic!("get_archived_at() called on __Unknown variant; inspect the raw JSON value directly"), + } } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union.rs b/seed/rust-sdk/unions/src/api/types/types_union.rs index 35ceeb9ae8b9..b4486f766994 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Union { #[serde(rename = "foo")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum Union { #[serde(rename = "bar")] #[non_exhaustive] Bar { bar: Bar }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Union { @@ -20,4 +27,8 @@ impl Union { pub fn bar(bar: Bar) -> Self { Self::Bar { bar } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_base_properties.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_base_properties.rs index 477c9c246724..af2847b9a853 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_base_properties.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_base_properties.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithBaseProperties { #[serde(rename = "integer")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum UnionWithBaseProperties { data: Foo, id: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithBaseProperties { @@ -33,11 +40,18 @@ impl UnionWithBaseProperties { Self::Foo { data, id } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::Integer { id, .. } => id, Self::String { id, .. } => id, Self::Foo { id, .. } => id, + Self::__Unknown(_) => { + panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly") + } } } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_discriminant.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_discriminant.rs index ba3ef07f582b..cc9e999998e6 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_discriminant.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_discriminant.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "_type")] +#[non_exhaustive] pub enum UnionWithDiscriminant { #[serde(rename = "foo")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum UnionWithDiscriminant { #[serde(rename = "bar")] #[non_exhaustive] Bar { bar: Bar }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDiscriminant { @@ -20,4 +27,8 @@ impl UnionWithDiscriminant { pub fn bar(bar: Bar) -> Self { Self::Bar { bar } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_primitive.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_primitive.rs index 727cea9ac40b..50d970ea7811 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_primitive.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_primitive.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithDuplicatePrimitive { #[serde(rename = "integer1")] #[non_exhaustive] @@ -18,6 +19,12 @@ pub enum UnionWithDuplicatePrimitive { #[serde(rename = "string2")] #[non_exhaustive] String2 { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDuplicatePrimitive { @@ -36,4 +43,8 @@ impl UnionWithDuplicatePrimitive { pub fn string2(value: String) -> Self { Self::String2 { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_types.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_types.rs index 01c63d0f8f18..5242c58cc858 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_types.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_duplicate_types.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithDuplicateTypes { #[serde(rename = "foo1")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum UnionWithDuplicateTypes { #[serde(flatten)] data: Foo, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDuplicateTypes { @@ -26,4 +33,8 @@ impl UnionWithDuplicateTypes { pub fn foo2(data: Foo) -> Self { Self::Foo2 { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_duplicative_discriminants.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_duplicative_discriminants.rs index 726a2d9453c4..adba466fdf2f 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_duplicative_discriminants.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_duplicative_discriminants.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithDuplicativeDiscriminants { #[serde(rename = "firstItemType")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum UnionWithDuplicativeDiscriminants { #[serde(default)] title: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithDuplicativeDiscriminants { @@ -47,4 +54,8 @@ impl UnionWithDuplicativeDiscriminants { title, } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_literal.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_literal.rs index d89a8c96c79c..7370f4162528 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_literal.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_literal.rs @@ -1,11 +1,18 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithLiteral { #[serde(rename = "fern")] #[non_exhaustive] Fern { value: String, base: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithLiteral { @@ -13,9 +20,16 @@ impl UnionWithLiteral { Self::Fern { value, base } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_base(&self) -> &str { match self { Self::Fern { base, .. } => base, + Self::__Unknown(_) => panic!( + "get_base() called on __Unknown variant; inspect the raw JSON value directly" + ), } } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_multiple_no_properties.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_multiple_no_properties.rs index 279ca2d78ac5..d9fe82459f73 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_multiple_no_properties.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_multiple_no_properties.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithMultipleNoProperties { #[serde(rename = "foo")] #[non_exhaustive] @@ -17,6 +18,12 @@ pub enum UnionWithMultipleNoProperties { #[serde(rename = "empty2")] #[non_exhaustive] Empty2 {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithMultipleNoProperties { @@ -31,4 +38,8 @@ impl UnionWithMultipleNoProperties { pub fn empty2() -> Self { Self::Empty2 {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_no_properties.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_no_properties.rs index 05ae31ddb6a8..e9dfa8e69a6b 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_no_properties.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_no_properties.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithNoProperties { #[serde(rename = "foo")] #[non_exhaustive] @@ -13,6 +14,12 @@ pub enum UnionWithNoProperties { #[serde(rename = "empty")] #[non_exhaustive] Empty {}, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithNoProperties { @@ -23,4 +30,8 @@ impl UnionWithNoProperties { pub fn empty() -> Self { Self::Empty {} } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_nullable_reference.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_nullable_reference.rs index 260c1b56cc00..6fa07e02d205 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_nullable_reference.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_nullable_reference.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithNullableReference { #[serde(rename = "foo")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum UnionWithNullableReference { #[serde(rename = "bar")] #[non_exhaustive] Bar { value: Option }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithNullableReference { @@ -20,4 +27,8 @@ impl UnionWithNullableReference { pub fn bar(value: Option) -> Self { Self::Bar { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_optional_reference.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_optional_reference.rs index 5e592c051828..196548629f9a 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_optional_reference.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_optional_reference.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithOptionalReference { #[serde(rename = "foo")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum UnionWithOptionalReference { #[serde(rename = "bar")] #[non_exhaustive] Bar { value: Option }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithOptionalReference { @@ -20,4 +27,8 @@ impl UnionWithOptionalReference { pub fn bar(value: Option) -> Self { Self::Bar { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_optional_time.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_optional_time.rs index 5bb565cd312c..c9de10ac24fd 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_optional_time.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_optional_time.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithOptionalTime { #[serde(rename = "date")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum UnionWithOptionalTime { #[serde(with = "crate::core::flexible_datetime::offset::option")] value: Option>, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithOptionalTime { @@ -24,4 +31,8 @@ impl UnionWithOptionalTime { pub fn datetime(value: Option>) -> Self { Self::Datetime { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_primitive.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_primitive.rs index 7a7799b94cb0..9e053c84d60c 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_primitive.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_primitive.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithPrimitive { #[serde(rename = "integer")] #[non_exhaustive] @@ -10,6 +11,12 @@ pub enum UnionWithPrimitive { #[serde(rename = "string")] #[non_exhaustive] r#String { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithPrimitive { @@ -20,4 +27,8 @@ impl UnionWithPrimitive { pub fn string(value: String) -> Self { Self::r#String { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_same_number_types.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_same_number_types.rs index 402d11d3db73..0a65e3921e99 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_same_number_types.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_same_number_types.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSameNumberTypes { #[serde(rename = "positiveInt")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum UnionWithSameNumberTypes { #[serde(rename = "anyNumber")] #[non_exhaustive] AnyNumber { value: f64 }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSameNumberTypes { @@ -28,4 +35,8 @@ impl UnionWithSameNumberTypes { pub fn any_number(value: f64) -> Self { Self::AnyNumber { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_same_string_types.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_same_string_types.rs index ef8beefee7e4..e1b05092aa28 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_same_string_types.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_same_string_types.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSameStringTypes { #[serde(rename = "customFormat")] #[non_exhaustive] @@ -14,6 +15,12 @@ pub enum UnionWithSameStringTypes { #[serde(rename = "patternString")] #[non_exhaustive] PatternString { value: String }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSameStringTypes { @@ -28,4 +35,8 @@ impl UnionWithSameStringTypes { pub fn pattern_string(value: String) -> Self { Self::PatternString { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_single_element.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_single_element.rs index 3769217cb468..9234e4dda2dd 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_single_element.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_single_element.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSingleElement { #[serde(rename = "foo")] #[non_exhaustive] @@ -9,10 +10,20 @@ pub enum UnionWithSingleElement { #[serde(flatten)] data: Foo, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSingleElement { pub fn foo(data: Foo) -> Self { Self::Foo { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_sub_types.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_sub_types.rs index 82a479490671..7bd821568a5a 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_sub_types.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_sub_types.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithSubTypes { #[serde(rename = "foo")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum UnionWithSubTypes { #[serde(default)] age: i64, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithSubTypes { @@ -26,4 +33,8 @@ impl UnionWithSubTypes { pub fn foo_extended(age: i64) -> Self { Self::FooExtended { age } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_with_time.rs b/seed/rust-sdk/unions/src/api/types/types_union_with_time.rs index 73b97c0209b5..4434b0b43079 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_with_time.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_with_time.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithTime { #[serde(rename = "value")] #[non_exhaustive] @@ -17,6 +18,12 @@ pub enum UnionWithTime { #[serde(with = "crate::core::flexible_datetime::offset")] value: DateTime, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithTime { @@ -31,4 +38,8 @@ impl UnionWithTime { pub fn datetime(value: DateTime) -> Self { Self::Datetime { value } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/types_union_without_key.rs b/seed/rust-sdk/unions/src/api/types/types_union_without_key.rs index 425f605cdf0a..bf170940ff99 100644 --- a/seed/rust-sdk/unions/src/api/types/types_union_without_key.rs +++ b/seed/rust-sdk/unions/src/api/types/types_union_without_key.rs @@ -1,7 +1,8 @@ pub use crate::prelude::*; -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum UnionWithoutKey { #[serde(rename = "foo")] #[non_exhaustive] @@ -16,6 +17,12 @@ pub enum UnionWithoutKey { #[serde(flatten)] data: Bar, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl UnionWithoutKey { @@ -26,4 +33,8 @@ impl UnionWithoutKey { pub fn bar(data: Bar) -> Self { Self::Bar { data } } + + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } } diff --git a/seed/rust-sdk/unions/src/api/types/union_shape.rs b/seed/rust-sdk/unions/src/api/types/union_shape.rs index e3254b3b07b1..a665d2ca40a9 100644 --- a/seed/rust-sdk/unions/src/api/types/union_shape.rs +++ b/seed/rust-sdk/unions/src/api/types/union_shape.rs @@ -2,6 +2,7 @@ pub use crate::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[serde(tag = "type")] +#[non_exhaustive] pub enum Shape { #[serde(rename = "circle")] #[non_exhaustive] @@ -20,6 +21,12 @@ pub enum Shape { length: f64, id: String, }, + + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } impl Shape { @@ -31,10 +38,17 @@ impl Shape { Self::Square { length, id } } + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) + } + pub fn get_id(&self) -> &str { match self { Self::Circle { id, .. } => id, Self::Square { id, .. } => id, + Self::__Unknown(_) => { + panic!("get_id() called on __Unknown variant; inspect the raw JSON value directly") + } } } } From 22160d0059f494ea0b34071eb554207f676114b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Jun 2026 17:32:49 +0000 Subject: [PATCH 7/8] chore(rust): release 0.37.0 --- .../forward-compatible-unions.yml | 0 generators/rust/sdk/versions.yml | 15 +++++++++++++++ 2 files changed, 15 insertions(+) rename generators/rust/sdk/changes/{unreleased => 0.37.0}/forward-compatible-unions.yml (100%) diff --git a/generators/rust/sdk/changes/unreleased/forward-compatible-unions.yml b/generators/rust/sdk/changes/0.37.0/forward-compatible-unions.yml similarity index 100% rename from generators/rust/sdk/changes/unreleased/forward-compatible-unions.yml rename to generators/rust/sdk/changes/0.37.0/forward-compatible-unions.yml diff --git a/generators/rust/sdk/versions.yml b/generators/rust/sdk/versions.yml index 3664340a6448..e9d4092b23f2 100644 --- a/generators/rust/sdk/versions.yml +++ b/generators/rust/sdk/versions.yml @@ -1,4 +1,19 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json +- version: 0.37.0 + changelogEntry: + - summary: | + Discriminated unions are now forward-compatible. Each generated `enum` carries + `#[non_exhaustive]` and a final `__Unknown(serde_json::Value)` variant marked + `#[serde(untagged)]`. Unknown discriminant values (e.g. variants introduced + server-side after this SDK was generated) deserialize into `__Unknown` + instead of erroring, preserving the raw JSON payload for inspection and + round-trip serialization. + + Forward-compatible unions can no longer derive `Eq`/`Hash` because + `serde_json::Value` doesn't implement them. `PartialEq` is still derived. + type: feat + createdAt: "2026-06-01" + irVersion: 66 - version: 0.36.8 changelogEntry: - summary: | From 6ef1eab26ae85f441652544cc32a98b3b8520482 Mon Sep 17 00:00:00 2001 From: Fern Support <126544928+fern-support@users.noreply.github.com> Date: Mon, 1 Jun 2026 13:51:25 -0400 Subject: [PATCH 8/8] chore(seed): update all seed snapshots (#16154) Co-authored-by: iamnamananand996 <31537362+iamnamananand996@users.noreply.github.com> --- .../pydantic-v2-wrapped/.fern/metadata.json | 16 - .../pydantic-v2-wrapped/.fernignore | 2 - .../exhaustive/pydantic-v2-wrapped/README.md | 210 ----- .../pydantic-v2-wrapped/snippet.json | 785 ------------------ .../tests/custom/test_alias_serialization.py | 26 - .../tests/custom/test_client.py | 7 - .../tests/custom/test_discriminated_unions.py | 149 ---- .../tests/test_aiohttp_autodetect.py | 116 --- .../.fern/metadata.json | 3 +- .../circular-references/.fern/metadata.json | 3 +- .../no-custom-config/.fern/metadata.json | 3 +- .../readme-config/.fern/metadata.json | 3 +- seed/rust-sdk/exhaustive/.fern/metadata.json | 3 +- seed/rust-sdk/literal/.fern/metadata.json | 3 +- seed/rust-sdk/mixed-case/.fern/metadata.json | 3 +- .../nullable-optional/.fern/metadata.json | 3 +- seed/rust-sdk/nullable/.fern/metadata.json | 3 +- .../property-access/.fern/metadata.json | 3 +- .../with-wire-tests/.fern/metadata.json | 3 +- .../.fern/metadata.json | 3 +- seed/rust-sdk/trace/.fern/metadata.json | 3 +- .../.fern/metadata.json | 3 +- seed/rust-sdk/unions/.fern/metadata.json | 3 +- 23 files changed, 30 insertions(+), 1326 deletions(-) delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fern/metadata.json delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fernignore delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_alias_serialization.py delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_discriminated_unions.py delete mode 100644 seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_aiohttp_autodetect.py diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fern/metadata.json b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fern/metadata.json deleted file mode 100644 index a4b393e7581a..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fern/metadata.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "cliVersion": "DUMMY", - "generatorName": "fernapi/fern-python-sdk", - "generatorVersion": "local", - "generatorConfig": { - "pydantic_config": { - "version": "v2", - "wrapped_aliases": true - } - }, - "originGitCommit": "DUMMY", - "invokedBy": "ci", - "requestedVersion": "0.0.1", - "ciProvider": "github", - "sdkVersion": "0.0.1" -} \ No newline at end of file diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fernignore b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fernignore deleted file mode 100644 index 83a9b1540598..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/.fernignore +++ /dev/null @@ -1,2 +0,0 @@ -tests/custom/test_alias_serialization.py -tests/custom/test_discriminated_unions.py diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md deleted file mode 100644 index 70803b15b05a..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/README.md +++ /dev/null @@ -1,210 +0,0 @@ -# Seed Python Library - -[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Seed%2FPython) -[![pypi](https://img.shields.io/pypi/v/fern_exhaustive)](https://pypi.python.org/pypi/fern_exhaustive) - -The Seed Python library provides convenient access to the Seed APIs from Python. - -## Table of Contents - -- [Installation](#installation) -- [Reference](#reference) -- [Usage](#usage) -- [Async Client](#async-client) -- [Exception Handling](#exception-handling) -- [Pagination](#pagination) -- [Advanced](#advanced) - - [Access Raw Response Data](#access-raw-response-data) - - [Retries](#retries) - - [Timeouts](#timeouts) - - [Custom Client](#custom-client) -- [Contributing](#contributing) - -## Installation - -```sh -pip install fern_exhaustive -``` - -## Reference - -A full reference for this library is available [here](./reference.md). - -## Usage - -Instantiate and use the client with the following: - -```python -from seed import SeedExhaustive - -client = SeedExhaustive( - token="", - base_url="https://yourhost.com/path/to/api", -) - -client.endpoints.container.get_and_return_list_of_primitives( - request=[ - "string", - "string" - ], -) -``` - -## Async Client - -The SDK also exports an `async` client so that you can make non-blocking calls to our API. Note that if you are constructing an Async httpx client class to pass into this client, use `httpx.AsyncClient()` instead of `httpx.Client()` (e.g. for the `httpx_client` parameter of this client). - -```python -import asyncio - -from seed import AsyncSeedExhaustive - -client = AsyncSeedExhaustive( - token="", - base_url="https://yourhost.com/path/to/api", -) - - -async def main() -> None: - await client.endpoints.container.get_and_return_list_of_primitives( - request=[ - "string", - "string" - ], - ) - - -asyncio.run(main()) -``` - -## Exception Handling - -When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error -will be thrown. - -```python -from seed.core.api_error import ApiError - -try: - client.endpoints.container.get_and_return_list_of_primitives(...) -except ApiError as e: - print(e.status_code) - print(e.body) -``` - -## Pagination - -Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object. - -```python -from seed import SeedExhaustive - -client = SeedExhaustive( - token="", - base_url="https://yourhost.com/path/to/api", -) - -client.endpoints.pagination.list_items( - cursor="cursor", - limit=1, -) -``` - -```python -# You can also iterate through pages and access the typed response per page -pager = client.endpoints.pagination.list_items(...) -for page in pager.iter_pages(): - print(page.response) # access the typed response for each page - for item in page: - print(item) -``` - -## Advanced - -### Access Raw Response Data - -The SDK provides access to raw response data, including headers, through the `.with_raw_response` property. -The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes. - -```python -from seed import SeedExhaustive - -client = SeedExhaustive(...) -response = client.endpoints.container.with_raw_response.get_and_return_list_of_primitives(...) -print(response.headers) # access the response headers -print(response.status_code) # access the response status code -print(response.data) # access the underlying object -``` - -### Retries - -The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long -as the request is deemed retryable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). - -Which status codes are retried depends on the `retryStatusCodes` generator configuration: - -**`legacy`** (current default): retries on -- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) -- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict) -- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500) - -**`recommended`**: retries on -- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) -- [409](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409) (Conflict) -- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway) -- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable) -- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout) - -Use the `max_retries` request option to configure this behavior. - -```python -client.endpoints.container.get_and_return_list_of_primitives(..., request_options={ - "max_retries": 1 -}) -``` - -### Timeouts - -The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. - -```python -from seed import SeedExhaustive - -client = SeedExhaustive(..., timeout=20.0) - -# Override timeout for a specific method -client.endpoints.container.get_and_return_list_of_primitives(..., request_options={ - "timeout_in_seconds": 1 -}) -``` - -### Custom Client - -You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies -and transports. - -```python -import httpx -from seed import SeedExhaustive - -client = SeedExhaustive( - ..., - httpx_client=httpx.Client( - proxy="http://my.test.proxy.example.com", - transport=httpx.HTTPTransport(local_address="0.0.0.0"), - ), -) -``` - -## Contributing - -While we value open-source contributions to this SDK, this library is generated programmatically. -Additions made directly to this library would have to be moved over to our generation code, -otherwise they would be overwritten upon the next generated release. Feel free to open a PR as -a proof of concept, but know that we will not be able to merge it as-is. We suggest opening -an issue first to discuss with us! - -On the other hand, contributions to the README are always very welcome! diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json deleted file mode 100644 index 376075dc1050..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/snippet.json +++ /dev/null @@ -1,785 +0,0 @@ -{ - "types": {}, - "endpoints": [ - { - "example_identifier": "default", - "id": { - "path": "/container/list-of-primitives", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnListOfPrimitives" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_list_of_primitives(\n request=[\"string\", \"string\"],\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_list_of_primitives(\n request=[\"string\", \"string\"],\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/list-of-objects", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnListOfObjects" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_list_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ],\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_list_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ObjectWithRequiredField(\n string=\"string\",\n ),\n ],\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/set-of-primitives", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnSetOfPrimitives" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_set_of_primitives(\n request={\"string\"},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_set_of_primitives(\n request={\"string\"},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/set-of-objects", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnSetOfObjects" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_set_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n )\n ],\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_set_of_objects(\n request=[\n ObjectWithRequiredField(\n string=\"string\",\n )\n ],\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/map-prim-to-prim", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnMapPrimToPrim" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_map_prim_to_prim(\n request={\"string\": \"string\"},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_map_prim_to_prim(\n request={\"string\": \"string\"},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/map-prim-to-object", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnMapOfPrimToObject" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_map_of_prim_to_object(\n request={\n \"string\": ObjectWithRequiredField(\n string=\"string\",\n )\n },\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_map_of_prim_to_object(\n request={\n \"string\": ObjectWithRequiredField(\n string=\"string\",\n )\n },\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/map-prim-to-union", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnMapOfPrimToUndiscriminatedUnion" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_map_of_prim_to_undiscriminated_union(\n request={\"string\": 1.1},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_map_of_prim_to_undiscriminated_union(\n request={\"string\": 1.1},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/container/opt-objects", - "method": "POST", - "identifier_override": "endpoint_endpoints/container.getAndReturnOptional" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.container.get_and_return_optional(\n request=ObjectWithRequiredField(\n string=\"string\",\n ),\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithRequiredField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.container.get_and_return_optional(\n request=ObjectWithRequiredField(\n string=\"string\",\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/foo/bar", - "method": "POST", - "identifier_override": "endpoint_endpoints/content-type.postJsonPatchContentType" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.content_type.post_json_patch_content_type(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.content_type.post_json_patch_content_type(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/foo/baz", - "method": "POST", - "identifier_override": "endpoint_endpoints/content-type.postJsonPatchContentWithCharsetType" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.content_type.post_json_patch_content_with_charset_type(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.content_type.post_json_patch_content_with_charset_type(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/enum", - "method": "POST", - "identifier_override": "endpoint_endpoints/enum.getAndReturnEnum" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.enum.get_and_return_enum(\n request=\"SUNNY\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.enum.get_and_return_enum(\n request=\"SUNNY\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/http-methods/{id}", - "method": "GET", - "identifier_override": "endpoint_endpoints/http-methods.testGet" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_get(\n id=\"id\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_get(\n id=\"id\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/http-methods", - "method": "POST", - "identifier_override": "endpoint_endpoints/http-methods.testPost" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_post(\n string=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_post(\n string=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/http-methods/{id}", - "method": "PUT", - "identifier_override": "endpoint_endpoints/http-methods.testPut" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_put(\n id=\"id\",\n string=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_put(\n id=\"id\",\n string=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/http-methods/{id}", - "method": "PATCH", - "identifier_override": "endpoint_endpoints/http-methods.testPatch" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_patch(\n id=\"id\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_patch(\n id=\"id\",\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/http-methods/{id}", - "method": "DELETE", - "identifier_override": "endpoint_endpoints/http-methods.testDelete" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.http_methods.test_delete(\n id=\"id\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.http_methods.test_delete(\n id=\"id\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-with-optional-field", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithOptionalField" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_optional_field(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_optional_field(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-with-required-field", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithRequiredField" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_required_field(\n string=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_required_field(\n string=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-with-map-of-map", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithMapOfMap" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_map_of_map(\n map_={\"map\": {\"map\": \"map\"}},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_map_of_map(\n map_={\"map\": {\"map\": \"map\"}},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-nested-with-optional-field", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnNestedWithOptionalField" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_nested_with_optional_field(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_nested_with_optional_field(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-nested-with-required-field/{string}", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnNestedWithRequiredField" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_nested_with_required_field(\n string_=\"string\",\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_nested_with_required_field(\n string_=\"string\",\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-nested-with-required-field-list", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnNestedWithRequiredFieldAsList" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import (\n NestedObjectWithRequiredField,\n ObjectWithOptionalField,\n)\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_nested_with_required_field_as_list(\n request=[\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n ],\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import (\n NestedObjectWithRequiredField,\n ObjectWithOptionalField,\n)\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_nested_with_required_field_as_list(\n request=[\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n NestedObjectWithRequiredField(\n string=\"string\",\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n ),\n ],\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "BackslashExample", - "id": { - "path": "/object/get-and-return-with-unknown-field", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithUnknownField" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_unknown_field(\n unknown={\"$ref\": \"https://example.com/schema\"},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_unknown_field(\n unknown={\"$ref\": \"https://example.com/schema\"},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-with-documented-unknown-type", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithDocumentedUnknownType" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_documented_unknown_type(\n documented_unknown_type={\"key\": \"value\"},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_documented_unknown_type(\n documented_unknown_type={\"key\": \"value\"},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/object/get-and-return-map-of-documented-unknown-type", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnMapOfDocumentedUnknownType" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_map_of_documented_unknown_type(\n request={\"string\": {\"key\": \"value\"}},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_map_of_documented_unknown_type(\n request={\"string\": {\"key\": \"value\"}},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "PartialRequiredFields", - "id": { - "path": "/object/get-and-return-with-mixed-required-and-optional-fields", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithMixedRequiredAndOptionalFields" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_mixed_required_and_optional_fields(\n required_string=\"hello\",\n required_integer=0,\n optional_string=\"world\",\n required_long=0,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_mixed_required_and_optional_fields(\n required_string=\"hello\",\n required_integer=0,\n optional_string=\"world\",\n required_long=0,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "NestedObjectMissing", - "id": { - "path": "/object/get-and-return-with-required-nested-object", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithRequiredNestedObject" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\nfrom seed.types.object import (\n NestedObjectWithRequiredField,\n ObjectWithOptionalField,\n)\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_required_nested_object(\n required_string=\"hello\",\n required_object=NestedObjectWithRequiredField(\n string=\"nested\",\n nested_object=ObjectWithOptionalField(),\n ),\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import (\n NestedObjectWithRequiredField,\n ObjectWithOptionalField,\n)\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_required_nested_object(\n required_string=\"hello\",\n required_object=NestedObjectWithRequiredField(\n string=\"nested\",\n nested_object=ObjectWithOptionalField(),\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "DatetimeLikeStringExample", - "id": { - "path": "/object/get-and-return-with-datetime-like-string", - "method": "POST", - "identifier_override": "endpoint_endpoints/object.getAndReturnWithDatetimeLikeString" - }, - "snippet": { - "sync_client": "import datetime\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.object.get_and_return_with_datetime_like_string(\n datetime_like_string=\"2023-08-31T14:15:22Z\",\n actual_datetime=datetime.datetime.fromisoformat(\n \"2023-08-31 14:15:22+00:00\",\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.object.get_and_return_with_datetime_like_string(\n datetime_like_string=\"2023-08-31T14:15:22Z\",\n actual_datetime=datetime.datetime.fromisoformat(\n \"2023-08-31 14:15:22+00:00\",\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/pagination", - "method": "GET", - "identifier_override": "endpoint_endpoints/pagination.listItems" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nresponse = client.endpoints.pagination.list_items(\n cursor=\"cursor\",\n limit=1,\n)\nfor item in response:\n yield item\n# alternatively, you can paginate page-by-page\nfor page in response.iter_pages():\n yield page\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n response = await client.endpoints.pagination.list_items(\n cursor=\"cursor\",\n limit=1,\n )\n async for item in response:\n yield item\n\n # alternatively, you can paginate page-by-page\n async for page in response.iter_pages():\n yield page\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path/{param}", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithPath" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_path(\n param=\"param\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_path(\n param=\"param\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path/{param}", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithInlinePath" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_inline_path(\n param=\"param\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_inline_path(\n param=\"param\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithQuery" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_query(\n query=\"query\",\n number=1,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_query(\n query=\"query\",\n number=1,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithAllowMultipleQuery" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_allow_multiple_query(\n query=\"query\",\n number=1,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_allow_multiple_query(\n query=\"query\",\n number=1,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path-query/{param}", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithPathAndQuery" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_path_and_query(\n param=\"param\",\n query=\"query\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_path_and_query(\n param=\"param\",\n query=\"query\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path-query/{param}", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithInlinePathAndQuery" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_inline_path_and_query(\n param=\"param\",\n query=\"query\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_inline_path_and_query(\n param=\"param\",\n query=\"query\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path/{param}", - "method": "PUT", - "identifier_override": "endpoint_endpoints/params.modifyWithPath" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.modify_with_path(\n param=\"param\",\n request=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.modify_with_path(\n param=\"param\",\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path/{param}", - "method": "PUT", - "identifier_override": "endpoint_endpoints/params.modifyWithInlinePath" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.modify_with_inline_path(\n param=\"param\",\n request=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.modify_with_inline_path(\n param=\"param\",\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path/{param}", - "method": "POST", - "identifier_override": "endpoint_endpoints/params.uploadWithPath" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.upload_with_path(\n param=\"upload-path\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.upload_with_path(\n param=\"upload-path\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path-bool/{param}", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithBooleanPath" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_boolean_path(\n param=True,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_boolean_path(\n param=True,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/params/path/{param}", - "method": "GET", - "identifier_override": "endpoint_endpoints/params.getWithPathAndErrors" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.params.get_with_path_and_errors(\n param=\"param\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.params.get_with_path_and_errors(\n param=\"param\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/string", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnString" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_string(\n request=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_string(\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/integer", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnInt" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_int(\n request=1,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_int(\n request=1,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/long", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnLong" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_long(\n request=1000000,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_long(\n request=1000000,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/double", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnDouble" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_double(\n request=1.1,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_double(\n request=1.1,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/boolean", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnBool" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_bool(\n request=True,\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_bool(\n request=True,\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/datetime", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnDatetime" - }, - "snippet": { - "sync_client": "import datetime\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_datetime(\n request=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_datetime(\n request=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/date", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnDate" - }, - "snippet": { - "sync_client": "import datetime\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_date(\n request=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_date(\n request=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/uuid", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnUUID" - }, - "snippet": { - "sync_client": "import uuid\n\nfrom seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_uuid(\n request=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n)\n", - "async_client": "import asyncio\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_uuid(\n request=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/primitive/base64", - "method": "POST", - "identifier_override": "endpoint_endpoints/primitive.getAndReturnBase64" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.primitive.get_and_return_base64(\n request=\"SGVsbG8gd29ybGQh\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.primitive.get_and_return_base64(\n request=\"SGVsbG8gd29ybGQh\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/{id}", - "method": "PUT", - "identifier_override": "endpoint_endpoints/put.add" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.put.add(\n id=\"id\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.put.add(\n id=\"id\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/union", - "method": "POST", - "identifier_override": "endpoint_endpoints/union.getAndReturnUnion" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\nfrom seed.types.union import Animal_Dog\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.union.get_and_return_union(\n request=Animal_Dog(\n name=\"name\",\n likes_to_woof=True,\n ),\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.union import Animal_Dog\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.union.get_and_return_union(\n request=Animal_Dog(\n name=\"name\",\n likes_to_woof=True,\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/urls/MixedCase", - "method": "GET", - "identifier_override": "endpoint_endpoints/urls.withMixedCase" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.urls.with_mixed_case()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.urls.with_mixed_case()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/urls/no-ending-slash", - "method": "GET", - "identifier_override": "endpoint_endpoints/urls.noEndingSlash" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.urls.no_ending_slash()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.urls.no_ending_slash()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/urls/with-ending-slash/", - "method": "GET", - "identifier_override": "endpoint_endpoints/urls.withEndingSlash" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.urls.with_ending_slash()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.urls.with_ending_slash()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/urls/with_underscores", - "method": "GET", - "identifier_override": "endpoint_endpoints/urls.withUnderscores" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.endpoints.urls.with_underscores()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.endpoints.urls.with_underscores()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/req-bodies/object", - "method": "POST", - "identifier_override": "endpoint_inlined-requests.postWithObjectBodyandResponse" - }, - "snippet": { - "sync_client": "import datetime\nimport uuid\n\nfrom seed import SeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.inlined_requests.post_with_object_bodyand_response(\n string=\"string\",\n integer=1,\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n)\n", - "async_client": "import asyncio\nimport datetime\nimport uuid\n\nfrom seed import AsyncSeedExhaustive\nfrom seed.types.object import ObjectWithOptionalField\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.inlined_requests.post_with_object_bodyand_response(\n string=\"string\",\n integer=1,\n nested_object=ObjectWithOptionalField(\n string=\"string\",\n integer=1,\n long_=1000000,\n double=1.1,\n bool_=True,\n datetime=datetime.datetime.fromisoformat(\n \"2024-01-15 09:30:00+00:00\",\n ),\n date=datetime.date.fromisoformat(\n \"2023-01-15\",\n ),\n uuid_=uuid.UUID(\n \"d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32\",\n ),\n base64=\"SGVsbG8gd29ybGQh\",\n list_=[\"list\", \"list\"],\n set_={\"set\"},\n map_={1: \"map\"},\n bigint=1000000,\n ),\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/no-auth", - "method": "POST", - "identifier_override": "endpoint_no-auth.postWithNoAuth" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.no_auth.post_with_no_auth(\n request={\"key\": \"value\"},\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.no_auth.post_with_no_auth(\n request={\"key\": \"value\"},\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/no-req-body", - "method": "GET", - "identifier_override": "endpoint_no-req-body.getWithNoRequestBody" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.no_req_body.get_with_no_request_body()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.no_req_body.get_with_no_request_body()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/no-req-body", - "method": "POST", - "identifier_override": "endpoint_no-req-body.postWithNoRequestBody" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.no_req_body.post_with_no_request_body()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.no_req_body.post_with_no_request_body()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/test-headers/custom-header", - "method": "POST", - "identifier_override": "endpoint_req-with-headers.getWithCustomHeader" - }, - "snippet": { - "sync_client": "from seed import SeedExhaustive\n\nclient = SeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\nclient.req_with_headers.get_with_custom_header(\n x_test_service_header=\"X-TEST-SERVICE-HEADER\",\n x_test_endpoint_header=\"X-TEST-ENDPOINT-HEADER\",\n request=\"string\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedExhaustive\n\nclient = AsyncSeedExhaustive(\n token=\"YOUR_TOKEN\",\n base_url=\"https://yourhost.com/path/to/api\",\n)\n\n\nasync def main() -> None:\n await client.req_with_headers.get_with_custom_header(\n x_test_service_header=\"X-TEST-SERVICE-HEADER\",\n x_test_endpoint_header=\"X-TEST-ENDPOINT-HEADER\",\n request=\"string\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - } - ] -} \ No newline at end of file diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_alias_serialization.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_alias_serialization.py deleted file mode 100644 index f3f54f7b2651..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_alias_serialization.py +++ /dev/null @@ -1,26 +0,0 @@ -from seed.types import OptionalAlias -from seed.core import parse_obj_as - -def test_alias_serialization(): - alias = OptionalAlias.from_str("test") - assert alias.model_dump() == "test" - assert alias.dict() == "test" - assert alias.json() == '"test"' - - -def test_alias_serialization_with_none(): - alias = OptionalAlias.from_str(None) - assert alias.model_dump() is None - assert alias.dict() is None - assert alias.json() == 'null' - - -def test_alias_deserialization(): - alias = parse_obj_as(type_=OptionalAlias, object_="test") - assert alias.root == "test" - assert alias.get_as_str() == "test" - -def test_alias_deserialization_with_none(): - alias = parse_obj_as(type_=OptionalAlias, object_=None) - assert alias.root is None - assert alias.get_as_str() is None diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py deleted file mode 100644 index ab04ce6393ef..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_client.py +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_discriminated_unions.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_discriminated_unions.py deleted file mode 100644 index f3304c6925ac..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/custom/test_discriminated_unions.py +++ /dev/null @@ -1,149 +0,0 @@ -""" -Comprehensive tests for discriminated union feature. - -These tests validate that the Python SDK generator correctly emits -discriminated unions with Field(discriminator=...) for improved performance. -""" - -import pytest -import typing_extensions -from typing import get_args, get_origin - -try: - import pydantic - from pydantic import BaseModel, ValidationError - PYDANTIC_VERSION = int(pydantic.VERSION.split('.')[0]) -except ImportError: - pytest.skip("Pydantic is not installed", allow_module_level=True) - -from seed.types.union.types.animal import Animal, Animal_Dog, Animal_Cat - - -class PetOwner(BaseModel): - """Wrapper model to test union parsing in a Pydantic context.""" - owner_name: str - pet: Animal - - -class TestDiscriminatedUnionParsing: - """Test that discriminated unions parse correctly from JSON payloads.""" - - def test_parse_dog_variant(self): - """Test parsing a valid dog payload.""" - payload = { - "owner_name": "Alice", - "pet": { - "animal": "dog", - "name": "Buddy", - "likes_to_woof": True - } - } - - if PYDANTIC_VERSION >= 2: - owner = PetOwner.model_validate(payload) - else: - owner = PetOwner.parse_obj(payload) - - assert owner.owner_name == "Alice" - assert isinstance(owner.pet, Animal_Dog) - assert owner.pet.name == "Buddy" - assert owner.pet.likes_to_woof is True - assert owner.pet.animal == "dog" - - def test_parse_cat_variant(self): - """Test parsing a valid cat payload.""" - payload = { - "owner_name": "Bob", - "pet": { - "animal": "cat", - "name": "Whiskers", - "likes_to_meow": True - } - } - - if PYDANTIC_VERSION >= 2: - owner = PetOwner.model_validate(payload) - else: - owner = PetOwner.parse_obj(payload) - - assert owner.owner_name == "Bob" - assert isinstance(owner.pet, Animal_Cat) - assert owner.pet.name == "Whiskers" - assert owner.pet.likes_to_meow is True - assert owner.pet.animal == "cat" - - -class TestDiscriminatedUnionErrors: - """Test that discriminated unions raise appropriate errors for invalid payloads.""" - - def test_invalid_discriminator_value(self): - """Test that an invalid discriminator value raises ValidationError mentioning 'discriminator'.""" - payload = { - "owner_name": "Charlie", - "pet": { - "animal": "lizard", # Invalid discriminator value - "name": "Godzilla" - } - } - - with pytest.raises(ValidationError) as exc_info: - if PYDANTIC_VERSION >= 2: - PetOwner.model_validate(payload) - else: - PetOwner.parse_obj(payload) - - error_str = str(exc_info.value).lower() - assert "discriminator" in error_str or "animal" in error_str - - def test_missing_discriminator_field(self): - """Test that a missing discriminator field raises ValidationError.""" - payload = { - "owner_name": "Diana", - "pet": { - "name": "Mystery", - "likes_to_woof": True - } - } - - with pytest.raises(ValidationError) as exc_info: - if PYDANTIC_VERSION >= 2: - PetOwner.model_validate(payload) - else: - PetOwner.parse_obj(payload) - - error_str = str(exc_info.value).lower() - assert "animal" in error_str or "discriminator" in error_str - - -class TestDiscriminatedUnionSerialization: - """Test serialization of discriminated unions.""" - - def test_serialize_dog(self): - """Test that a Dog can be serialized correctly.""" - dog = Animal_Dog(name="Buddy", likes_to_woof=True) - owner = PetOwner(owner_name="Alice", pet=dog) - - if PYDANTIC_VERSION >= 2: - data = owner.model_dump() - else: - data = owner.dict() - - assert data["pet"]["animal"] == "dog" - assert data["pet"]["name"] == "Buddy" - woof_value = data["pet"].get("likes_to_woof", data["pet"].get("likesToWoof")) - assert woof_value is True - - def test_serialize_cat(self): - """Test that a Cat can be serialized correctly.""" - cat = Animal_Cat(name="Whiskers", likes_to_meow=True) - owner = PetOwner(owner_name="Bob", pet=cat) - - if PYDANTIC_VERSION >= 2: - data = owner.model_dump() - else: - data = owner.dict() - - assert data["pet"]["animal"] == "cat" - assert data["pet"]["name"] == "Whiskers" - meow_value = data["pet"].get("likes_to_meow", data["pet"].get("likesToMeow")) - assert meow_value is True diff --git a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_aiohttp_autodetect.py b/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_aiohttp_autodetect.py deleted file mode 100644 index 2d440bf488df..000000000000 --- a/seed/python-sdk/exhaustive/pydantic-v2-wrapped/tests/test_aiohttp_autodetect.py +++ /dev/null @@ -1,116 +0,0 @@ -import importlib -import sys -import unittest -from unittest import mock - -import httpx -import pytest - - -class TestMakeDefaultAsyncClientWithoutAiohttp(unittest.TestCase): - """Tests for _make_default_async_client when httpx_aiohttp is NOT installed.""" - - def test_returns_httpx_async_client(self) -> None: - """When httpx_aiohttp is not installed, returns plain httpx.AsyncClient.""" - with mock.patch.dict(sys.modules, {"httpx_aiohttp": None}): - from seed.client import _make_default_async_client - - client = _make_default_async_client(timeout=60, follow_redirects=True) - self.assertIsInstance(client, httpx.AsyncClient) - self.assertEqual(client.timeout.read, 60) - self.assertTrue(client.follow_redirects) - - def test_follow_redirects_none(self) -> None: - """When follow_redirects is None, omits it from httpx.AsyncClient.""" - with mock.patch.dict(sys.modules, {"httpx_aiohttp": None}): - from seed.client import _make_default_async_client - - client = _make_default_async_client(timeout=60, follow_redirects=None) - self.assertIsInstance(client, httpx.AsyncClient) - self.assertFalse(client.follow_redirects) - - def test_explicit_httpx_client_bypasses_autodetect(self) -> None: - """When user passes httpx_client explicitly, _make_default_async_client is not called.""" - - explicit_client = httpx.AsyncClient(timeout=120) - with mock.patch("seed.client._make_default_async_client") as mock_make: - # Replicate the generated conditional: httpx_client if httpx_client is not None else _make_default_async_client(...) - result = explicit_client if explicit_client is not None else mock_make(timeout=60, follow_redirects=True) - mock_make.assert_not_called() - self.assertIs(result, explicit_client) - - -@pytest.mark.aiohttp -class TestMakeDefaultAsyncClientWithAiohttp(unittest.TestCase): - """Tests for _make_default_async_client when httpx_aiohttp IS installed.""" - - def test_returns_aiohttp_client(self) -> None: - """When httpx_aiohttp is installed, returns HttpxAiohttpClient.""" - import httpx_aiohttp # type: ignore[import-not-found] - - from seed.client import _make_default_async_client - - client = _make_default_async_client(timeout=60, follow_redirects=True) - self.assertIsInstance(client, httpx_aiohttp.HttpxAiohttpClient) - self.assertEqual(client.timeout.read, 60) - self.assertTrue(client.follow_redirects) - - def test_follow_redirects_none(self) -> None: - """When httpx_aiohttp is installed and follow_redirects is None, omits it.""" - import httpx_aiohttp # type: ignore[import-not-found] - - from seed.client import _make_default_async_client - - client = _make_default_async_client(timeout=60, follow_redirects=None) - self.assertIsInstance(client, httpx_aiohttp.HttpxAiohttpClient) - self.assertFalse(client.follow_redirects) - - -class TestDefaultClientsWithoutAiohttp(unittest.TestCase): - """Tests for _default_clients.py convenience classes (no aiohttp).""" - - def test_default_async_httpx_client_defaults(self) -> None: - """DefaultAsyncHttpxClient applies SDK defaults.""" - from seed._default_clients import SDK_DEFAULT_TIMEOUT, DefaultAsyncHttpxClient - - client = DefaultAsyncHttpxClient() - self.assertIsInstance(client, httpx.AsyncClient) - self.assertEqual(client.timeout.read, SDK_DEFAULT_TIMEOUT) - self.assertTrue(client.follow_redirects) - - def test_default_async_httpx_client_overrides(self) -> None: - """DefaultAsyncHttpxClient allows overriding defaults.""" - from seed._default_clients import DefaultAsyncHttpxClient - - client = DefaultAsyncHttpxClient(timeout=30, follow_redirects=False) - self.assertEqual(client.timeout.read, 30) - self.assertFalse(client.follow_redirects) - - def test_default_aiohttp_client_raises_without_package(self) -> None: - """DefaultAioHttpClient raises RuntimeError when httpx_aiohttp not installed.""" - import seed._default_clients - - with mock.patch.dict(sys.modules, {"httpx_aiohttp": None}): - importlib.reload(seed._default_clients) - - with self.assertRaises(RuntimeError) as ctx: - seed._default_clients.DefaultAioHttpClient() - self.assertIn("pip install fern_exhaustive[aiohttp]", str(ctx.exception)) - - importlib.reload(seed._default_clients) - - -@pytest.mark.aiohttp -class TestDefaultClientsWithAiohttp(unittest.TestCase): - """Tests for _default_clients.py when httpx_aiohttp IS installed.""" - - def test_default_aiohttp_client_defaults(self) -> None: - """DefaultAioHttpClient works when httpx_aiohttp is installed.""" - import httpx_aiohttp # type: ignore[import-not-found] - - from seed._default_clients import SDK_DEFAULT_TIMEOUT, DefaultAioHttpClient - - client = DefaultAioHttpClient() - self.assertIsInstance(client, httpx_aiohttp.HttpxAiohttpClient) - self.assertEqual(client.timeout.read, SDK_DEFAULT_TIMEOUT) - self.assertTrue(client.follow_redirects) diff --git a/seed/rust-sdk/circular-references-advanced/.fern/metadata.json b/seed/rust-sdk/circular-references-advanced/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/circular-references-advanced/.fern/metadata.json +++ b/seed/rust-sdk/circular-references-advanced/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/circular-references/.fern/metadata.json b/seed/rust-sdk/circular-references/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/circular-references/.fern/metadata.json +++ b/seed/rust-sdk/circular-references/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json b/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json +++ b/seed/rust-sdk/examples/no-custom-config/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/examples/readme-config/.fern/metadata.json b/seed/rust-sdk/examples/readme-config/.fern/metadata.json index 90e072664b84..05fc731f1686 100644 --- a/seed/rust-sdk/examples/readme-config/.fern/metadata.json +++ b/seed/rust-sdk/examples/readme-config/.fern/metadata.json @@ -16,7 +16,8 @@ ] }, "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/exhaustive/.fern/metadata.json b/seed/rust-sdk/exhaustive/.fern/metadata.json index c1161c13aa09..81b536667fc2 100644 --- a/seed/rust-sdk/exhaustive/.fern/metadata.json +++ b/seed/rust-sdk/exhaustive/.fern/metadata.json @@ -6,7 +6,8 @@ "enableWireTests": true }, "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/literal/.fern/metadata.json b/seed/rust-sdk/literal/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/literal/.fern/metadata.json +++ b/seed/rust-sdk/literal/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/mixed-case/.fern/metadata.json b/seed/rust-sdk/mixed-case/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/mixed-case/.fern/metadata.json +++ b/seed/rust-sdk/mixed-case/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/nullable-optional/.fern/metadata.json b/seed/rust-sdk/nullable-optional/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/nullable-optional/.fern/metadata.json +++ b/seed/rust-sdk/nullable-optional/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/nullable/.fern/metadata.json b/seed/rust-sdk/nullable/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/nullable/.fern/metadata.json +++ b/seed/rust-sdk/nullable/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/property-access/.fern/metadata.json b/seed/rust-sdk/property-access/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/property-access/.fern/metadata.json +++ b/seed/rust-sdk/property-access/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json index 48c7c96fb8fc..f92fe43bfdc3 100644 --- a/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json +++ b/seed/rust-sdk/server-sent-event-examples/with-wire-tests/.fern/metadata.json @@ -8,7 +8,8 @@ "packageVersion": "0.1.0" }, "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json b/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json +++ b/seed/rust-sdk/server-sent-events-openapi/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/trace/.fern/metadata.json b/seed/rust-sdk/trace/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/trace/.fern/metadata.json +++ b/seed/rust-sdk/trace/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/unions-with-local-date/.fern/metadata.json b/seed/rust-sdk/unions-with-local-date/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/unions-with-local-date/.fern/metadata.json +++ b/seed/rust-sdk/unions-with-local-date/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file diff --git a/seed/rust-sdk/unions/.fern/metadata.json b/seed/rust-sdk/unions/.fern/metadata.json index b663fd7f2194..d566e7c8be4d 100644 --- a/seed/rust-sdk/unions/.fern/metadata.json +++ b/seed/rust-sdk/unions/.fern/metadata.json @@ -3,7 +3,8 @@ "generatorName": "fernapi/fern-rust-sdk", "generatorVersion": "local", "originGitCommit": "DUMMY", - "invokedBy": "manual", + "invokedBy": "ci", "requestedVersion": "0.0.1", + "ciProvider": "github", "sdkVersion": "0.0.1" } \ No newline at end of file