diff --git a/generators/python/sdk/versions.yml b/generators/python/sdk/versions.yml index d3a36b38d97b..69795d0d009a 100644 --- a/generators/python/sdk/versions.yml +++ b/generators/python/sdk/versions.yml @@ -1,5 +1,15 @@ # yaml-language-server: $schema=../../../fern-versions-yml.schema.json # For unreleased changes, use unreleased.yml +- version: 4.44.1 + changelogEntry: + - summary: | + Remove `oauth-token-override` config flag. OAuth token override is now always enabled for OAuth client + credentials flows, allowing users to authenticate with either client_id/client_secret OR a pre-generated + bearer token directly via the `token` parameter without any configuration. + type: fix + createdAt: "2025-12-09" + irVersion: 61 + - version: 4.44.0 changelogEntry: - summary: | diff --git a/generators/python/src/fern_python/generator_cli/generator_cli.py b/generators/python/src/fern_python/generator_cli/generator_cli.py index 6679e83d6a91..0fd02b4220c0 100644 --- a/generators/python/src/fern_python/generator_cli/generator_cli.py +++ b/generators/python/src/fern_python/generator_cli/generator_cli.py @@ -96,7 +96,6 @@ def generate_readme( github_installation_token: Optional[str] = None, pagination_enabled: Union[bool, None] = False, websocket_enabled: bool = False, - oauth_token_override: bool = False, ) -> str: readme_snippet_builder = ReadmeSnippetBuilder( ir=self._ir, @@ -104,7 +103,6 @@ def generate_readme( snippets=snippets, pagination_enabled=pagination_enabled, websocket_enabled=websocket_enabled, - oauth_token_override=oauth_token_override, generated_root_client=generated_root_client, api_error_reference=self._context.core_utilities.get_reference_to_api_error(as_snippet=True), endpoint_metadata=self._endpoint_metadata, diff --git a/generators/python/src/fern_python/generator_cli/readme_snippet_builder.py b/generators/python/src/fern_python/generator_cli/readme_snippet_builder.py index 58a4ae3a2842..48951c9eb858 100644 --- a/generators/python/src/fern_python/generator_cli/readme_snippet_builder.py +++ b/generators/python/src/fern_python/generator_cli/readme_snippet_builder.py @@ -44,7 +44,6 @@ def __init__( source_file_factory: SourceFileFactory, pagination_enabled: Optional[bool] = False, websocket_enabled: Optional[bool] = False, - oauth_token_override: Optional[bool] = False, ): self._ir = ir self._package_name = package_name @@ -54,7 +53,8 @@ def __init__( # flags and how many places need this context. self._pagination_enabled = pagination_enabled self._websocket_enabled = websocket_enabled - self._oauth_token_override = oauth_token_override + # Determine if OAuth client credentials is enabled from the IR + self._is_oauth_client_credentials = self._check_oauth_client_credentials(ir) self._source_file_factory = source_file_factory @@ -84,7 +84,7 @@ def build_readme_snippets(self) -> Dict[generatorcli.feature.FeatureId, List[str if self._websocket_enabled: snippets[ReadmeSnippetBuilder.WEBSOCKETS_FEATURE_ID] = self._build_websocket_snippets() - if self._oauth_token_override: + if self._is_oauth_client_credentials: snippets[ReadmeSnippetBuilder.OAUTH_TOKEN_OVERRIDE_FEATURE_ID] = self._build_oauth_token_override_snippets() snippets[ReadmeSnippetBuilder.ACCESS_RAW_RESPONSE_DATA_FEATURE_ID] = ( @@ -545,6 +545,18 @@ def _client_writer_credentials(writer: AST.NodeWriter) -> None: print(f"Failed to generate oauth token override snippets with exception {e}") return [] + def _check_oauth_client_credentials(self, ir: ir_types.IntermediateRepresentation) -> bool: + """Check if OAuth client credentials is configured in the IR.""" + if ir.auth is None: + return False + for scheme in ir.auth.schemes: + scheme_union = scheme.get_as_union() + if scheme_union.type == "oauth": + oauth_config = scheme_union.configuration.get_as_union() + if oauth_config.type == "clientCredentials": + return True + return False + def _build_endpoint_feature_map( self, ir: ir_types.IntermediateRepresentation ) -> Dict[generatorcli.feature.FeatureId, List[ir_types.EndpointId]]: diff --git a/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py b/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py index f3db767cc1e7..b9603999e366 100644 --- a/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py +++ b/generators/python/src/fern_python/generators/sdk/client_generator/root_client_generator.py @@ -155,13 +155,15 @@ def __init__( ) exported_client_class_name = self._context.get_class_name_for_exported_root_client() + oauth_union = self._oauth_scheme.configuration.get_as_union() if self._oauth_scheme is not None else None + is_oauth_client_credentials = oauth_union is not None and oauth_union.type == "clientCredentials" root_client_builder = RootClientGenerator.GeneratedRootClientBuilder( # HACK: This is a hack to get the module path for the root client to be from the root of the project module_path=self._context.get_module_path_in_project(()), class_name=self._context.get_class_name_for_exported_root_client(), async_class_name="Async" + exported_client_class_name, constructor_parameters=self._root_client_constructor_params, - oauth_token_override=self._oauth_scheme is not None and self._context.custom_config.oauth_token_override, + oauth_token_override=is_oauth_client_credentials, ) self._generated_root_client = root_client_builder.build() @@ -196,18 +198,13 @@ def _write_root_class_docstring(self, writer: AST.NodeWriter, *, is_async: bool) writer.write_line(self.ROOT_CLASS_DOCSTRING) oauth_union = self._oauth_scheme.configuration.get_as_union() if self._oauth_scheme is not None else None - is_oauth_override_client_credentials = ( - oauth_union is not None - and oauth_union.type == "clientCredentials" - and self._context.custom_config.oauth_token_override - ) + is_oauth_client_credentials = oauth_union is not None and oauth_union.type == "clientCredentials" - # For non client-credentials OAuth or when oauth_token_override is disabled, - # rely on the auto-generated parameter docstring. - if not is_oauth_override_client_credentials: + # For non client-credentials OAuth, rely on the auto-generated parameter docstring. + if not is_oauth_client_credentials: return - # Custom Parameters section for client-credentials + oauth_token_override + # Custom Parameters section for client-credentials OAuth with token override writer.write_line("") writer.write_line("Parameters") writer.write_line("----------") @@ -303,12 +300,8 @@ def _create_class_declaration( constructor_overloads = self._get_constructor_overloads(is_async=is_async) oauth_union = self._oauth_scheme.configuration.get_as_union() if self._oauth_scheme is not None else None - disable_param_docs = ( - oauth_union is not None - and oauth_union.type == "clientCredentials" - and self._context.custom_config.oauth_token_override - ) - write_parameter_docstring = not disable_param_docs + is_oauth_client_credentials = oauth_union is not None and oauth_union.type == "clientCredentials" + write_parameter_docstring = not is_oauth_client_credentials class_declaration = AST.ClassDeclaration( name=self._async_class_name if is_async else self._class_name, @@ -563,144 +556,65 @@ def write_default_environment(writer: AST.NodeWriter) -> None: if self._oauth_scheme is not None: oauth = self._oauth_scheme.configuration.get_as_union() - oauth_token_override = self._context.custom_config.oauth_token_override if oauth.type == "clientCredentials": - # When oauth_token_override is enabled, make client_id/client_secret optional + # For OAuth client credentials, make client_id/client_secret optional # so users can provide a token directly instead - if oauth_token_override: - # client_id is optional with env var fallback - parameters.append( - RootClientConstructorParameter( - constructor_parameter_name="client_id", - type_hint=AST.TypeHint.optional(AST.TypeHint.str_()), - initializer=( - AST.Expression( - AST.FunctionInvocation( - function_definition=AST.Reference( - import_=AST.ReferenceImport(module=AST.Module.built_in(("os",))), - qualified_name_excluding_import=("getenv",), - ), - args=[AST.Expression(f'"{oauth.client_id_env_var}"')], - ) + # client_id is optional with env var fallback + parameters.append( + RootClientConstructorParameter( + constructor_parameter_name="client_id", + type_hint=AST.TypeHint.optional(AST.TypeHint.str_()), + initializer=( + AST.Expression( + AST.FunctionInvocation( + function_definition=AST.Reference( + import_=AST.ReferenceImport(module=AST.Module.built_in(("os",))), + qualified_name_excluding_import=("getenv",), + ), + args=[AST.Expression(f'"{oauth.client_id_env_var}"')], ) - if oauth.client_id_env_var is not None - else AST.Expression("None") - ), - docs=RootClientGenerator.CLIENT_ID_CONSTRUCTOR_PARAMETER_DOCS, - # No validation_check - validation happens in constructor body + ) + if oauth.client_id_env_var is not None + else AST.Expression("None") ), - ) - # client_secret is optional with env var fallback - parameters.append( - RootClientConstructorParameter( - constructor_parameter_name="client_secret", - type_hint=AST.TypeHint.optional(AST.TypeHint.str_()), - initializer=( - AST.Expression( - AST.FunctionInvocation( - function_definition=AST.Reference( - import_=AST.ReferenceImport(module=AST.Module.built_in(("os",))), - qualified_name_excluding_import=("getenv",), - ), - args=[AST.Expression(f'"{oauth.client_secret_env_var}"')], - ) + docs=RootClientGenerator.CLIENT_ID_CONSTRUCTOR_PARAMETER_DOCS, + ), + ) + # client_secret is optional with env var fallback + parameters.append( + RootClientConstructorParameter( + constructor_parameter_name="client_secret", + type_hint=AST.TypeHint.optional(AST.TypeHint.str_()), + initializer=( + AST.Expression( + AST.FunctionInvocation( + function_definition=AST.Reference( + import_=AST.ReferenceImport(module=AST.Module.built_in(("os",))), + qualified_name_excluding_import=("getenv",), + ), + args=[AST.Expression(f'"{oauth.client_secret_env_var}"')], ) - if oauth.client_secret_env_var is not None - else AST.Expression("None") - ), - docs=RootClientGenerator.CLIENT_SECRET_CONSTRUCTOR_PARAMETER_DOCS, - # No validation_check - validation happens in constructor body - ), - ) - # Add the token parameter for direct token authentication - parameters.append( - RootClientConstructorParameter( - constructor_parameter_name=self.TOKEN_PARAMETER_NAME, - type_hint=AST.TypeHint.optional( - AST.TypeHint.callable(parameters=[], return_type=AST.TypeHint.str_()) - ), - initializer=AST.Expression("None"), - docs=( - "Authenticate by providing a callable that returns a pre-generated bearer token. " - "In this mode, OAuth client credentials are not required." - ), + ) + if oauth.client_secret_env_var is not None + else AST.Expression("None") ), - ) - else: - # Original behavior: client_id/client_secret are required (or env var fallback) - cred_type_hint = AST.TypeHint.str_() - add_validation = False - if oauth.client_id_env_var is not None: - add_validation = True - cred_type_hint = AST.TypeHint.optional(cred_type_hint) - parameters.append( - RootClientConstructorParameter( - constructor_parameter_name="client_id", - type_hint=cred_type_hint, - initializer=( - AST.Expression( - AST.FunctionInvocation( - function_definition=AST.Reference( - import_=AST.ReferenceImport(module=AST.Module.built_in(("os",))), - qualified_name_excluding_import=("getenv",), - ), - args=[AST.Expression(f'"{oauth.client_id_env_var}"')], - ) - ) - if oauth.client_id_env_var is not None - else None - ), - validation_check=( - AST.Expression( - AST.CodeWriter( - self._get_parameter_validation_writer( - param_name="client_id", - environment_variable=oauth.client_id_env_var, - ) - ) - ) - if add_validation and oauth.client_id_env_var is not None - else None - ), + docs=RootClientGenerator.CLIENT_SECRET_CONSTRUCTOR_PARAMETER_DOCS, + ), + ) + # Add the token parameter for direct token authentication + parameters.append( + RootClientConstructorParameter( + constructor_parameter_name=self.TOKEN_PARAMETER_NAME, + type_hint=AST.TypeHint.optional( + AST.TypeHint.callable(parameters=[], return_type=AST.TypeHint.str_()) ), - ) - - sec_cred_type_hint = AST.TypeHint.str_() - sec_add_validation = False - if oauth.client_secret_env_var is not None: - sec_add_validation = True - sec_cred_type_hint = AST.TypeHint.optional(sec_cred_type_hint) - parameters.append( - RootClientConstructorParameter( - constructor_parameter_name="client_secret", - type_hint=sec_cred_type_hint, - initializer=( - AST.Expression( - AST.FunctionInvocation( - function_definition=AST.Reference( - import_=AST.ReferenceImport(module=AST.Module.built_in(("os",))), - qualified_name_excluding_import=("getenv",), - ), - args=[AST.Expression(f'"{oauth.client_secret_env_var}"')], - ) - ) - if oauth.client_secret_env_var is not None - else None - ), - validation_check=( - AST.Expression( - AST.CodeWriter( - self._get_parameter_validation_writer( - param_name="client_secret", - environment_variable=oauth.client_secret_env_var, - ) - ) - ) - if sec_add_validation and oauth.client_secret_env_var is not None - else None - ), + initializer=AST.Expression("None"), + docs=( + "Authenticate by providing a callable that returns a pre-generated bearer token. " + "In this mode, OAuth client credentials are not required." ), - ) + ), + ) parameters.append( RootClientConstructorParameter( constructor_parameter_name=self.TOKEN_GETTER_PARAM_NAME, @@ -794,12 +708,12 @@ def _get_literal_header_parameters(self) -> List[RootClientConstructorParameter] def _get_constructor_overloads(self, *, is_async: bool) -> Optional[List[AST.FunctionSignature]]: """ - Generate constructor overloads for OAuth token override. + Generate constructor overloads for OAuth client credentials. Returns two overload signatures: 1. OAuth client credentials: client_id + client_secret (required, or optional if env vars configured) 2. Direct token: token (required) """ - if self._oauth_scheme is None or not self._context.custom_config.oauth_token_override: + if self._oauth_scheme is None: return None oauth = self._oauth_scheme.configuration.get_as_union() @@ -924,10 +838,11 @@ def _write_constructor_body(writer: AST.NodeWriter) -> None: generated_environment=self._generated_environment, ) use_oauth_token_provider = self._oauth_scheme is not None - oauth_token_override = self._context.custom_config.oauth_token_override + oauth_union = self._oauth_scheme.configuration.get_as_union() if self._oauth_scheme is not None else None + is_oauth_client_credentials = oauth_union is not None and oauth_union.type == "clientCredentials" - if use_oauth_token_provider and oauth_token_override: - # OAuth token override mode: users can provide either token OR client_id/client_secret + if use_oauth_token_provider and is_oauth_client_credentials: + # OAuth client credentials mode: users can provide either token OR client_id/client_secret self._write_oauth_token_override_constructor_body( writer=writer, client_wrapper_generator=client_wrapper_generator, diff --git a/generators/python/src/fern_python/generators/sdk/custom_config.py b/generators/python/src/fern_python/generators/sdk/custom_config.py index bf78663bdf2d..81f18fce34f2 100644 --- a/generators/python/src/fern_python/generators/sdk/custom_config.py +++ b/generators/python/src/fern_python/generators/sdk/custom_config.py @@ -127,10 +127,6 @@ class SDKCustomConfig(pydantic.BaseModel): custom_pager_name: Optional[str] = None - # When enabled for OAuth client credentials, allows users to provide - # either client_id/client_secret OR a pre-generated token directly. - oauth_token_override: bool = False - class Config: extra = pydantic.Extra.forbid @@ -140,8 +136,6 @@ def parse_obj(cls, obj: Any) -> "SDKCustomConfig": obj = obj.copy() if "custom-pager-name" in obj and "custom_pager_name" not in obj: obj["custom_pager_name"] = obj.pop("custom-pager-name") - if "oauth-token-override" in obj and "oauth_token_override" not in obj: - obj["oauth_token_override"] = obj.pop("oauth-token-override") obj = super().parse_obj(obj) diff --git a/generators/python/src/fern_python/generators/sdk/sdk_generator.py b/generators/python/src/fern_python/generators/sdk/sdk_generator.py index 1fc79ee35186..32ced88ac8e7 100644 --- a/generators/python/src/fern_python/generators/sdk/sdk_generator.py +++ b/generators/python/src/fern_python/generators/sdk/sdk_generator.py @@ -624,7 +624,6 @@ def _write_readme( pagination_enabled=context.generator_config.generate_paginated_clients, websocket_enabled=write_websocket_snippets, generated_root_client=generated_root_client, - oauth_token_override=context.custom_config.oauth_token_override, ) project.add_file( os.path.join( diff --git a/generators/python/tests/sdk/test_root_client_generator.py b/generators/python/tests/sdk/test_root_client_generator.py index 4d9d68a2ed2a..96accc7ca351 100644 --- a/generators/python/tests/sdk/test_root_client_generator.py +++ b/generators/python/tests/sdk/test_root_client_generator.py @@ -92,7 +92,7 @@ def test_generated_root_client_builder_instantiations_list() -> None: builder = _create_test_builder() generated_root_client = builder.build() - # Without oauth_token_override, there should be exactly one instantiation + # Without OAuth client credentials, there should be exactly one instantiation assert len(generated_root_client.sync_instantiations) == 1 assert len(generated_root_client.async_instantiations) == 1 @@ -106,12 +106,12 @@ def test_generated_root_client_builder_instantiations_list() -> None: assert snippet_from_property.to_str() == snippet_from_list.to_str() -def test_generated_root_client_builder_with_oauth_token_override() -> None: - """Test that oauth_token_override adds a second token-based instantiation.""" +def test_generated_root_client_builder_with_oauth_client_credentials() -> None: + """Test that OAuth client credentials adds a second token-based instantiation.""" builder = _create_test_builder(oauth_token_override=True) generated_root_client = builder.build() - # With oauth_token_override, there should be two instantiations + # With OAuth client credentials, there should be two instantiations assert len(generated_root_client.sync_instantiations) == 2 assert len(generated_root_client.async_instantiations) == 2 diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/.fern/metadata.json b/seed/python-sdk/oauth-client-credentials-environment-variables/.fern/metadata.json similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/.fern/metadata.json rename to seed/python-sdk/oauth-client-credentials-environment-variables/.fern/metadata.json diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/.github/workflows/ci.yml b/seed/python-sdk/oauth-client-credentials-environment-variables/.github/workflows/ci.yml similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/.github/workflows/ci.yml rename to seed/python-sdk/oauth-client-credentials-environment-variables/.github/workflows/ci.yml diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/.gitignore b/seed/python-sdk/oauth-client-credentials-environment-variables/.gitignore similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/.gitignore rename to seed/python-sdk/oauth-client-credentials-environment-variables/.gitignore diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/README.md b/seed/python-sdk/oauth-client-credentials-environment-variables/README.md similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/README.md rename to seed/python-sdk/oauth-client-credentials-environment-variables/README.md diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/README.md b/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/README.md deleted file mode 100644 index df4638c3035a..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/README.md +++ /dev/null @@ -1,177 +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_oauth-client-credentials-environment-variables)](https://pypi.python.org/pypi/fern_oauth-client-credentials-environment-variables) - -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) -- [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_oauth-client-credentials-environment-variables -``` - -## 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 SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.auth.get_token_with_client_credentials( - client_id="client_id", - client_secret="client_secret", - scope="scope", -) -``` - -## 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 AsyncSeedOauthClientCredentialsEnvironmentVariables - -client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) - - -async def main() -> None: - await client.auth.get_token_with_client_credentials( - client_id="client_id", - client_secret="client_secret", - scope="scope", - ) - - -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.auth.get_token_with_client_credentials(...) -except ApiError as e: - print(e.status_code) - print(e.body) -``` - -## 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 SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - ..., -) -response = client.auth.with_raw_response.get_token_with_client_credentials(...) -print(response.headers) # access the response headers -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). - -A request is deemed retryable when any of the following HTTP status codes is returned: - -- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) -- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) - -Use the `max_retries` request option to configure this behavior. - -```python -client.auth.get_token_with_client_credentials(..., 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 SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - ..., - timeout=20.0, -) - - -# Override timeout for a specific method -client.auth.get_token_with_client_credentials(..., 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 SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - ..., - 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/oauth-client-credentials-environment-variables/no-custom-config/src/seed/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/client.py deleted file mode 100644 index 9c943fd6b2b4..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/client.py +++ /dev/null @@ -1,240 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import os -import typing - -import httpx -from .core.api_error import ApiError -from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .core.oauth_token_provider import AsyncOAuthTokenProvider, OAuthTokenProvider - -if typing.TYPE_CHECKING: - from .auth.client import AsyncAuthClient, AuthClient - from .nested.client import AsyncNestedClient, NestedClient - from .nested_no_auth.client import AsyncNestedNoAuthClient, NestedNoAuthClient - from .simple.client import AsyncSimpleClient, SimpleClient - - -class SeedOauthClientCredentialsEnvironmentVariables: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - client_id : typing.Optional[str] - client_secret : typing.Optional[str] - _token_getter_override : typing.Optional[typing.Callable[[], str]] - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.Client] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from seed import SeedOauthClientCredentialsEnvironmentVariables - - client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - """ - - def __init__( - self, - *, - base_url: str, - client_id: typing.Optional[str] = os.getenv("CLIENT_ID"), - client_secret: typing.Optional[str] = os.getenv("CLIENT_SECRET"), - _token_getter_override: typing.Optional[typing.Callable[[], str]] = None, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.Client] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read - ) - if client_id is None: - raise ApiError(body="The client must be instantiated be either passing in client_id or setting CLIENT_ID") - if client_secret is None: - raise ApiError( - body="The client must be instantiated be either passing in client_secret or setting CLIENT_SECRET" - ) - oauth_token_provider = OAuthTokenProvider( - client_id=client_id, - client_secret=client_secret, - client_wrapper=SyncClientWrapper( - base_url=base_url, - httpx_client=httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.Client(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ), - ) - self._client_wrapper = SyncClientWrapper( - base_url=base_url, - token=_token_getter_override if _token_getter_override is not None else oauth_token_provider.get_token, - httpx_client=httpx_client - if httpx_client is not None - else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.Client(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ) - self._auth: typing.Optional[AuthClient] = None - self._nested_no_auth: typing.Optional[NestedNoAuthClient] = None - self._nested: typing.Optional[NestedClient] = None - self._simple: typing.Optional[SimpleClient] = None - - @property - def auth(self): - if self._auth is None: - from .auth.client import AuthClient # noqa: E402 - - self._auth = AuthClient(client_wrapper=self._client_wrapper) - return self._auth - - @property - def nested_no_auth(self): - if self._nested_no_auth is None: - from .nested_no_auth.client import NestedNoAuthClient # noqa: E402 - - self._nested_no_auth = NestedNoAuthClient(client_wrapper=self._client_wrapper) - return self._nested_no_auth - - @property - def nested(self): - if self._nested is None: - from .nested.client import NestedClient # noqa: E402 - - self._nested = NestedClient(client_wrapper=self._client_wrapper) - return self._nested - - @property - def simple(self): - if self._simple is None: - from .simple.client import SimpleClient # noqa: E402 - - self._simple = SimpleClient(client_wrapper=self._client_wrapper) - return self._simple - - -class AsyncSeedOauthClientCredentialsEnvironmentVariables: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - client_id : typing.Optional[str] - client_secret : typing.Optional[str] - _token_getter_override : typing.Optional[typing.Callable[[], str]] - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.AsyncClient] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from seed import AsyncSeedOauthClientCredentialsEnvironmentVariables - - client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - """ - - def __init__( - self, - *, - base_url: str, - client_id: typing.Optional[str] = os.getenv("CLIENT_ID"), - client_secret: typing.Optional[str] = os.getenv("CLIENT_SECRET"), - _token_getter_override: typing.Optional[typing.Callable[[], str]] = None, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read - ) - if client_id is None: - raise ApiError(body="The client must be instantiated be either passing in client_id or setting CLIENT_ID") - if client_secret is None: - raise ApiError( - body="The client must be instantiated be either passing in client_secret or setting CLIENT_SECRET" - ) - oauth_token_provider = AsyncOAuthTokenProvider( - client_id=client_id, - client_secret=client_secret, - client_wrapper=AsyncClientWrapper( - base_url=base_url, - httpx_client=httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ), - ) - self._client_wrapper = AsyncClientWrapper( - base_url=base_url, - token=_token_getter_override, - async_token=oauth_token_provider.get_token, - httpx_client=httpx_client - if httpx_client is not None - else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ) - self._auth: typing.Optional[AsyncAuthClient] = None - self._nested_no_auth: typing.Optional[AsyncNestedNoAuthClient] = None - self._nested: typing.Optional[AsyncNestedClient] = None - self._simple: typing.Optional[AsyncSimpleClient] = None - - @property - def auth(self): - if self._auth is None: - from .auth.client import AsyncAuthClient # noqa: E402 - - self._auth = AsyncAuthClient(client_wrapper=self._client_wrapper) - return self._auth - - @property - def nested_no_auth(self): - if self._nested_no_auth is None: - from .nested_no_auth.client import AsyncNestedNoAuthClient # noqa: E402 - - self._nested_no_auth = AsyncNestedNoAuthClient(client_wrapper=self._client_wrapper) - return self._nested_no_auth - - @property - def nested(self): - if self._nested is None: - from .nested.client import AsyncNestedClient # noqa: E402 - - self._nested = AsyncNestedClient(client_wrapper=self._client_wrapper) - return self._nested - - @property - def simple(self): - if self._simple is None: - from .simple.client import AsyncSimpleClient # noqa: E402 - - self._simple = AsyncSimpleClient(client_wrapper=self._client_wrapper) - return self._simple diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/poetry.lock b/seed/python-sdk/oauth-client-credentials-environment-variables/poetry.lock similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/poetry.lock rename to seed/python-sdk/oauth-client-credentials-environment-variables/poetry.lock diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/pyproject.toml b/seed/python-sdk/oauth-client-credentials-environment-variables/pyproject.toml similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/pyproject.toml rename to seed/python-sdk/oauth-client-credentials-environment-variables/pyproject.toml diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/reference.md b/seed/python-sdk/oauth-client-credentials-environment-variables/reference.md similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/reference.md rename to seed/python-sdk/oauth-client-credentials-environment-variables/reference.md diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/requirements.txt b/seed/python-sdk/oauth-client-credentials-environment-variables/requirements.txt similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/requirements.txt rename to seed/python-sdk/oauth-client-credentials-environment-variables/requirements.txt diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/snippet.json b/seed/python-sdk/oauth-client-credentials-environment-variables/snippet.json similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/snippet.json rename to seed/python-sdk/oauth-client-credentials-environment-variables/snippet.json diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/raw_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/raw_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/types/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/types/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/types/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/types/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/types/token_response.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/types/token_response.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/auth/types/token_response.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/auth/types/token_response.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/api_error.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/api_error.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/api_error.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/api_error.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/client_wrapper.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/client_wrapper.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/client_wrapper.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/client_wrapper.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/datetime_utils.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/datetime_utils.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/datetime_utils.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/datetime_utils.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/file.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/file.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/file.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/file.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/force_multipart.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/force_multipart.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/force_multipart.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/force_multipart.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_response.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_response.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_response.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_response.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_api.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_api.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_api.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_api.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_decoders.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_decoders.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_decoders.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_decoders.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_exceptions.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_exceptions.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_exceptions.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_exceptions.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_models.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_models.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/http_sse/_models.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/http_sse/_models.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/jsonable_encoder.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/jsonable_encoder.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/jsonable_encoder.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/jsonable_encoder.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/oauth_token_provider.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/oauth_token_provider.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/oauth_token_provider.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/oauth_token_provider.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/pydantic_utilities.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/pydantic_utilities.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/pydantic_utilities.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/query_encoder.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/query_encoder.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/query_encoder.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/query_encoder.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/remove_none_from_dict.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/remove_none_from_dict.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/remove_none_from_dict.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/request_options.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/request_options.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/request_options.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/request_options.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/serialization.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/serialization.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/core/serialization.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/core/serialization.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/api/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/api/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/api/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/api/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/api/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/api/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/api/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/api/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/api/raw_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/api/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/api/raw_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/api/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/raw_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested/raw_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/api/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/api/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/api/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/api/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/api/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/api/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/api/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/api/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/api/raw_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/api/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/api/raw_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/api/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/raw_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/nested_no_auth/raw_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/nested_no_auth/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/py.typed b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/py.typed similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/py.typed rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/py.typed diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/simple/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/simple/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/simple/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/simple/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/simple/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/simple/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/simple/client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/simple/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/simple/raw_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/simple/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/simple/raw_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/simple/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/version.py b/seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/version.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/src/seed/version.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/src/seed/version.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/custom/test_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/custom/test_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/custom/test_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/custom/test_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/__init__.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/circle.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/circle.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/circle.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/circle.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/color.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/color.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/color.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/color.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/object_with_defaults.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/object_with_defaults.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/object_with_defaults.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/object_with_optional_field.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/object_with_optional_field.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/object_with_optional_field.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/shape.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/shape.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/shape.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/shape.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/square.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/square.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/square.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/square.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/undiscriminated_shape.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/assets/models/undiscriminated_shape.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/assets/models/undiscriminated_shape.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/test_http_client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/test_http_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/test_http_client.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/test_http_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/test_query_encoding.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/test_query_encoding.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/test_query_encoding.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/test_query_encoding.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/test_serialization.py b/seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/test_serialization.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/no-custom-config/tests/utils/test_serialization.py rename to seed/python-sdk/oauth-client-credentials-environment-variables/tests/utils/test_serialization.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.fern/metadata.json b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.fern/metadata.json deleted file mode 100644 index 04a9803bb4f3..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.fern/metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cliVersion": "DUMMY", - "generatorName": "fernapi/fern-python-sdk", - "generatorVersion": "latest", - "generatorConfig": { - "oauth-token-override": true - } -} \ No newline at end of file diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/pyproject.toml b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/pyproject.toml deleted file mode 100644 index 126ce67eb8ee..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/pyproject.toml +++ /dev/null @@ -1,91 +0,0 @@ -[project] -name = "fern_oauth-client-credentials-environment-variables" -dynamic = ["version"] - -[tool.poetry] -name = "fern_oauth-client-credentials-environment-variables" -version = "0.0.1" -description = "" -readme = "README.md" -authors = [] -keywords = [ - "fern", - "test" -] - -classifiers = [ - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: OS Independent", - "Operating System :: POSIX", - "Operating System :: MacOS", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed" -] -packages = [ - { include = "seed", from = "src"} -] - -[tool.poetry.urls] -Documentation = 'https://buildwithfern.com/learn' -Homepage = 'https://buildwithfern.com/' -Repository = 'https://github.com/oauth-client-credentials-environment-variables/fern' - -[tool.poetry.dependencies] -python = "^3.8" -httpx = ">=0.21.2" -pydantic = ">= 1.9.2" -pydantic-core = ">=2.18.2" -typing_extensions = ">= 4.0.0" - -[tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" -pytest = "^7.4.0" -pytest-asyncio = "^0.23.5" -pytest-xdist = "^3.6.1" -python-dateutil = "^2.9.0" -types-python-dateutil = "^2.9.0.20240316" -ruff = "==0.11.5" - -[tool.pytest.ini_options] -testpaths = [ "tests" ] -asyncio_mode = "auto" - -[tool.mypy] -plugins = ["pydantic.mypy"] - -[tool.ruff] -line-length = 120 - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "F", # pyflakes - "I", # isort -] -ignore = [ - "E402", # Module level import not at top of file - "E501", # Line too long - "E711", # Comparison to `None` should be `cond is not None` - "E712", # Avoid equality comparisons to `True`; use `if ...:` checks - "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks - "E722", # Do not use bare `except` - "E731", # Do not assign a `lambda` expression, use a `def` - "F821", # Undefined name - "F841" # Local variable ... is assigned to but never used -] - -[tool.ruff.lint.isort] -section-order = ["future", "standard-library", "third-party", "first-party"] - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/reference.md b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/reference.md deleted file mode 100644 index 71f5936d4243..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/reference.md +++ /dev/null @@ -1,310 +0,0 @@ -# Reference -## Auth -
client.auth.get_token_with_client_credentials(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.auth.get_token_with_client_credentials( - client_id="client_id", - client_secret="client_secret", - scope="scope", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**client_id:** `str` - -
-
- -
-
- -**client_secret:** `str` - -
-
- -
-
- -**scope:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.auth.refresh_token(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.auth.refresh_token( - client_id="client_id", - client_secret="client_secret", - refresh_token="refresh_token", - scope="scope", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**client_id:** `str` - -
-
- -
-
- -**client_secret:** `str` - -
-
- -
-
- -**refresh_token:** `str` - -
-
- -
-
- -**scope:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## NestedNoAuth Api -
client.nested_no_auth.api.get_something() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.nested_no_auth.api.get_something() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Nested Api -
client.nested.api.get_something() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.nested.api.get_something() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Simple -
client.simple.get_something() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentialsEnvironmentVariables - -client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.simple.get_something() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/snippet.json b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/snippet.json deleted file mode 100644 index 0dc79daf023c..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/snippet.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "types": {}, - "endpoints": [ - { - "example_identifier": "default", - "id": { - "path": "/token", - "method": "POST", - "identifier_override": "endpoint_auth.getTokenWithClientCredentials" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentialsEnvironmentVariables\n\nclient = SeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.auth.get_token_with_client_credentials(\n client_id=\"client_id\",\n client_secret=\"client_secret\",\n scope=\"scope\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentialsEnvironmentVariables\n\nclient = AsyncSeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.auth.get_token_with_client_credentials(\n client_id=\"client_id\",\n client_secret=\"client_secret\",\n scope=\"scope\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/token", - "method": "POST", - "identifier_override": "endpoint_auth.refreshToken" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentialsEnvironmentVariables\n\nclient = SeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.auth.refresh_token(\n client_id=\"client_id\",\n client_secret=\"client_secret\",\n refresh_token=\"refresh_token\",\n scope=\"scope\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentialsEnvironmentVariables\n\nclient = AsyncSeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.auth.refresh_token(\n client_id=\"client_id\",\n client_secret=\"client_secret\",\n refresh_token=\"refresh_token\",\n scope=\"scope\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/nested-no-auth/get-something", - "method": "GET", - "identifier_override": "endpoint_nested-no-auth/api.getSomething" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentialsEnvironmentVariables\n\nclient = SeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.nested_no_auth.api.get_something()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentialsEnvironmentVariables\n\nclient = AsyncSeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.nested_no_auth.api.get_something()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/nested/get-something", - "method": "GET", - "identifier_override": "endpoint_nested/api.getSomething" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentialsEnvironmentVariables\n\nclient = SeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.nested.api.get_something()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentialsEnvironmentVariables\n\nclient = AsyncSeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.nested.api.get_something()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/get-something", - "method": "GET", - "identifier_override": "endpoint_simple.getSomething" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentialsEnvironmentVariables\n\nclient = SeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.simple.get_something()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentialsEnvironmentVariables\n\nclient = AsyncSeedOauthClientCredentialsEnvironmentVariables(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.simple.get_something()\n\n\nasyncio.run(main())\n", - "type": "python" - } - } - ] -} \ No newline at end of file diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/__init__.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/__init__.py deleted file mode 100644 index 15c72fcc3179..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import auth, nested, nested_no_auth, simple - from .auth import TokenResponse - from .client import ( - AsyncSeedOauthClientCredentialsEnvironmentVariables, - SeedOauthClientCredentialsEnvironmentVariables, - ) - from .version import __version__ -_dynamic_imports: typing.Dict[str, str] = { - "AsyncSeedOauthClientCredentialsEnvironmentVariables": ".client", - "SeedOauthClientCredentialsEnvironmentVariables": ".client", - "TokenResponse": ".auth", - "__version__": ".version", - "auth": ".auth", - "nested": ".nested", - "nested_no_auth": ".nested_no_auth", - "simple": ".simple", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AsyncSeedOauthClientCredentialsEnvironmentVariables", - "SeedOauthClientCredentialsEnvironmentVariables", - "TokenResponse", - "__version__", - "auth", - "nested", - "nested_no_auth", - "simple", -] diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/client.py deleted file mode 100644 index a769485bd8b8..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/client.py +++ /dev/null @@ -1,251 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from .raw_client import AsyncRawAuthClient, RawAuthClient -from .types.token_response import TokenResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class AuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawAuthClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawAuthClient - """ - return self._raw_client - - def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - from seed import SeedOauthClientCredentialsEnvironmentVariables - - client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.auth.get_token_with_client_credentials( - client_id="client_id", - client_secret="client_secret", - scope="scope", - ) - """ - _response = self._raw_client.get_token_with_client_credentials( - client_id=client_id, client_secret=client_secret, scope=scope, request_options=request_options - ) - return _response.data - - def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - from seed import SeedOauthClientCredentialsEnvironmentVariables - - client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.auth.refresh_token( - client_id="client_id", - client_secret="client_secret", - refresh_token="refresh_token", - scope="scope", - ) - """ - _response = self._raw_client.refresh_token( - client_id=client_id, - client_secret=client_secret, - refresh_token=refresh_token, - scope=scope, - request_options=request_options, - ) - return _response.data - - -class AsyncAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawAuthClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawAuthClient - """ - return self._raw_client - - async def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentialsEnvironmentVariables - - client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.auth.get_token_with_client_credentials( - client_id="client_id", - client_secret="client_secret", - scope="scope", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_token_with_client_credentials( - client_id=client_id, client_secret=client_secret, scope=scope, request_options=request_options - ) - return _response.data - - async def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentialsEnvironmentVariables - - client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.auth.refresh_token( - client_id="client_id", - client_secret="client_secret", - refresh_token="refresh_token", - scope="scope", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.refresh_token( - client_id=client_id, - client_secret=client_secret, - refresh_token=refresh_token, - scope=scope, - request_options=request_options, - ) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/client_wrapper.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/client_wrapper.py deleted file mode 100644 index 74b462ae7257..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/client_wrapper.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import httpx -from .http_client import AsyncHttpClient, HttpClient - - -class BaseClientWrapper: - def __init__( - self, - *, - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, - base_url: str, - timeout: typing.Optional[float] = None, - ): - self._token = token - self._headers = headers - self._base_url = base_url - self._timeout = timeout - - def get_headers(self) -> typing.Dict[str, str]: - headers: typing.Dict[str, str] = { - "User-Agent": "fern_oauth-client-credentials-environment-variables/0.0.1", - "X-Fern-Language": "Python", - "X-Fern-SDK-Name": "fern_oauth-client-credentials-environment-variables", - "X-Fern-SDK-Version": "0.0.1", - **(self.get_custom_headers() or {}), - } - token = self._get_token() - if token is not None: - headers["Authorization"] = f"Bearer {token}" - return headers - - def _get_token(self) -> typing.Optional[str]: - if isinstance(self._token, str) or self._token is None: - return self._token - else: - return self._token() - - def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: - return self._headers - - def get_base_url(self) -> str: - return self._base_url - - def get_timeout(self) -> typing.Optional[float]: - return self._timeout - - -class SyncClientWrapper(BaseClientWrapper): - def __init__( - self, - *, - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, - base_url: str, - timeout: typing.Optional[float] = None, - httpx_client: httpx.Client, - ): - super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout) - self.httpx_client = HttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_url=self.get_base_url, - ) - - -class AsyncClientWrapper(BaseClientWrapper): - def __init__( - self, - *, - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, - base_url: str, - timeout: typing.Optional[float] = None, - async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, - httpx_client: httpx.AsyncClient, - ): - super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout) - self._async_token = async_token - self.httpx_client = AsyncHttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_url=self.get_base_url, - async_base_headers=self.async_get_headers, - ) - - async def async_get_headers(self) -> typing.Dict[str, str]: - headers = self.get_headers() - if self._async_token is not None: - token = await self._async_token() - headers["Authorization"] = f"Bearer {token}" - return headers diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/client.py deleted file mode 100644 index eeebaf170922..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/client.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions -from .raw_client import AsyncRawApiClient, RawApiClient - - -class ApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawApiClient - """ - return self._raw_client - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from seed import SeedOauthClientCredentialsEnvironmentVariables - - client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.nested.api.get_something() - """ - _response = self._raw_client.get_something(request_options=request_options) - return _response.data - - -class AsyncApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawApiClient - """ - return self._raw_client - - async def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentialsEnvironmentVariables - - client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.nested.api.get_something() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_something(request_options=request_options) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/client.py deleted file mode 100644 index a0d2c7c8dcda..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/client.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions -from .raw_client import AsyncRawApiClient, RawApiClient - - -class ApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawApiClient - """ - return self._raw_client - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from seed import SeedOauthClientCredentialsEnvironmentVariables - - client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.nested_no_auth.api.get_something() - """ - _response = self._raw_client.get_something(request_options=request_options) - return _response.data - - -class AsyncApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawApiClient - """ - return self._raw_client - - async def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentialsEnvironmentVariables - - client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.nested_no_auth.api.get_something() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_something(request_options=request_options) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/client.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/client.py deleted file mode 100644 index 115b1a1bc016..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/client.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from .raw_client import AsyncRawSimpleClient, RawSimpleClient - - -class SimpleClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawSimpleClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawSimpleClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawSimpleClient - """ - return self._raw_client - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from seed import SeedOauthClientCredentialsEnvironmentVariables - - client = SeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.simple.get_something() - """ - _response = self._raw_client.get_something(request_options=request_options) - return _response.data - - -class AsyncSimpleClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawSimpleClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawSimpleClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawSimpleClient - """ - return self._raw_client - - async def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentialsEnvironmentVariables - - client = AsyncSeedOauthClientCredentialsEnvironmentVariables( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.simple.get_something() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_something(request_options=request_options) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/version.py b/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/version.py deleted file mode 100644 index ccfee7d60c65..000000000000 --- a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/version.py +++ /dev/null @@ -1,3 +0,0 @@ -from importlib import metadata - -__version__ = metadata.version("fern_oauth-client-credentials-environment-variables") diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/.fern/metadata.json b/seed/python-sdk/oauth-client-credentials/.fern/metadata.json similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/.fern/metadata.json rename to seed/python-sdk/oauth-client-credentials/.fern/metadata.json diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.github/workflows/ci.yml b/seed/python-sdk/oauth-client-credentials/.github/workflows/ci.yml similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.github/workflows/ci.yml rename to seed/python-sdk/oauth-client-credentials/.github/workflows/ci.yml diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.gitignore b/seed/python-sdk/oauth-client-credentials/.gitignore similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/.gitignore rename to seed/python-sdk/oauth-client-credentials/.gitignore diff --git a/seed/python-sdk/oauth-client-credentials/token-override/README.md b/seed/python-sdk/oauth-client-credentials/README.md similarity index 100% rename from seed/python-sdk/oauth-client-credentials/token-override/README.md rename to seed/python-sdk/oauth-client-credentials/README.md diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/.github/workflows/ci.yml b/seed/python-sdk/oauth-client-credentials/no-custom-config/.github/workflows/ci.yml deleted file mode 100644 index ffd2d8acab24..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/.github/workflows/ci.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: ci -on: [push] -jobs: - compile: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Compile - run: poetry run mypy . - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - - name: Test - run: poetry run pytest -rP -n auto . - - publish: - needs: [compile, test] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Publish to pypi - run: | - poetry config repositories.remote - poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD" - env: - PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/.gitignore b/seed/python-sdk/oauth-client-credentials/no-custom-config/.gitignore deleted file mode 100644 index d2e4ca808d21..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.mypy_cache/ -.ruff_cache/ -__pycache__/ -dist/ -poetry.toml diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/README.md b/seed/python-sdk/oauth-client-credentials/no-custom-config/README.md deleted file mode 100644 index fb14ff1e8071..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/README.md +++ /dev/null @@ -1,177 +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_oauth-client-credentials)](https://pypi.python.org/pypi/fern_oauth-client-credentials) - -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) -- [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_oauth-client-credentials -``` - -## 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 SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.auth.get_token_with_client_credentials( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - scope="read:users", -) -``` - -## 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 AsyncSeedOauthClientCredentials - -client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) - - -async def main() -> None: - await client.auth.get_token_with_client_credentials( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - scope="read:users", - ) - - -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.auth.get_token_with_client_credentials(...) -except ApiError as e: - print(e.status_code) - print(e.body) -``` - -## 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 SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - ..., -) -response = client.auth.with_raw_response.get_token_with_client_credentials(...) -print(response.headers) # access the response headers -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). - -A request is deemed retryable when any of the following HTTP status codes is returned: - -- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) -- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) - -Use the `max_retries` request option to configure this behavior. - -```python -client.auth.get_token_with_client_credentials(..., 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 SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - ..., - timeout=20.0, -) - - -# Override timeout for a specific method -client.auth.get_token_with_client_credentials(..., 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 SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - ..., - 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/oauth-client-credentials/no-custom-config/poetry.lock b/seed/python-sdk/oauth-client-credentials/no-custom-config/poetry.lock deleted file mode 100644 index 9decbf87e177..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/poetry.lock +++ /dev/null @@ -1,594 +0,0 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. - -[[package]] -name = "annotated-types" -version = "0.7.0" -description = "Reusable constraint types to use with typing.Annotated" -optional = false -python-versions = ">=3.8" -files = [ - {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, - {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - -[[package]] -name = "anyio" -version = "4.5.2" -description = "High level compatibility layer for multiple asynchronous event loop implementations" -optional = false -python-versions = ">=3.8" -files = [ - {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, - {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, -] - -[package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} -idna = ">=2.8" -sniffio = ">=1.1" -typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} - -[package.extras] -doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] -trio = ["trio (>=0.26.1)"] - -[[package]] -name = "certifi" -version = "2025.11.12" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.7" -files = [ - {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"}, - {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"}, -] - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "exceptiongroup" -version = "1.3.1" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, - {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "execnet" -version = "2.1.2" -description = "execnet: rapid multi-Python deployment" -optional = false -python-versions = ">=3.8" -files = [ - {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"}, - {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"}, -] - -[package.extras] -testing = ["hatch", "pre-commit", "pytest", "tox"] - -[[package]] -name = "h11" -version = "0.16.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = false -python-versions = ">=3.8" -files = [ - {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, - {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -description = "A minimal low-level HTTP client." -optional = false -python-versions = ">=3.8" -files = [ - {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, - {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, -] - -[package.dependencies] -certifi = "*" -h11 = ">=0.16" - -[package.extras] -asyncio = ["anyio (>=4.0,<5.0)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<1.0)"] - -[[package]] -name = "httpx" -version = "0.28.1" -description = "The next generation HTTP client." -optional = false -python-versions = ">=3.8" -files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, -] - -[package.dependencies] -anyio = "*" -certifi = "*" -httpcore = "==1.*" -idna = "*" - -[package.extras] -brotli = ["brotli", "brotlicffi"] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "idna" -version = "3.11" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.8" -files = [ - {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, - {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, -] - -[package.extras] -all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] - -[[package]] -name = "iniconfig" -version = "2.1.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.8" -files = [ - {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, - {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, -] - -[[package]] -name = "mypy" -version = "1.13.0" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, -] - -[package.dependencies] -mypy-extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - -[[package]] -name = "mypy-extensions" -version = "1.1.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.8" -files = [ - {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, - {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, -] - -[[package]] -name = "packaging" -version = "25.0" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, - {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, -] - -[[package]] -name = "pluggy" -version = "1.5.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pydantic" -version = "2.10.6" -description = "Data validation using Python type hints" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, - {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, -] - -[package.dependencies] -annotated-types = ">=0.6.0" -pydantic-core = "2.27.2" -typing-extensions = ">=4.12.2" - -[package.extras] -email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] - -[[package]] -name = "pydantic-core" -version = "2.27.2" -description = "Core functionality for Pydantic validation and serialization" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, - {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, -] - -[package.dependencies] -typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" - -[[package]] -name = "pytest" -version = "7.4.4" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} - -[package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-asyncio" -version = "0.23.8" -description = "Pytest support for asyncio" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, - {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, -] - -[package.dependencies] -pytest = ">=7.0.0,<9" - -[package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] -testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] - -[[package]] -name = "pytest-xdist" -version = "3.6.1" -description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, - {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, -] - -[package.dependencies] -execnet = ">=2.1" -pytest = ">=7.0.0" - -[package.extras] -psutil = ["psutil (>=3.0)"] -setproctitle = ["setproctitle"] -testing = ["filelock"] - -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, - {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "ruff" -version = "0.11.5" -description = "An extremely fast Python linter and code formatter, written in Rust." -optional = false -python-versions = ">=3.7" -files = [ - {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, - {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, - {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"}, - {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"}, - {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"}, - {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"}, - {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"}, -] - -[[package]] -name = "six" -version = "1.17.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, - {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, -] - -[[package]] -name = "sniffio" -version = "1.3.1" -description = "Sniff out which async library your code is running under" -optional = false -python-versions = ">=3.7" -files = [ - {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, - {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, -] - -[[package]] -name = "tomli" -version = "2.3.0" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.8" -files = [ - {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, - {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"}, - {file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"}, - {file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"}, - {file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"}, - {file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"}, - {file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"}, - {file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"}, - {file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"}, - {file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"}, - {file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"}, - {file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"}, - {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, - {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, -] - -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20241206" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -files = [ - {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, - {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, -] - -[[package]] -name = "typing-extensions" -version = "4.13.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -files = [ - {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, - {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, -] - -[metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "bcf31a142c86d9e556553c8c260a93b563ac64a043076dbd48b26111d422c26e" diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/requirements.txt b/seed/python-sdk/oauth-client-credentials/no-custom-config/requirements.txt deleted file mode 100644 index e80f640a2e74..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -httpx>=0.21.2 -pydantic>= 1.9.2 -pydantic-core>=2.18.2 -typing_extensions>= 4.0.0 diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/__init__.py deleted file mode 100644 index 687d87d84895..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import TokenResponse -_dynamic_imports: typing.Dict[str, str] = {"TokenResponse": ".types"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["TokenResponse"] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/raw_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/raw_client.py deleted file mode 100644 index e4209e426fc7..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/raw_client.py +++ /dev/null @@ -1,240 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from .types.token_response import TokenResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawAuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TokenResponse] - """ - _response = self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "client_credentials", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TokenResponse] - """ - _response = self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "refresh_token": refresh_token, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "refresh_token", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TokenResponse] - """ - _response = await self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "client_credentials", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TokenResponse] - """ - _response = await self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "refresh_token": refresh_token, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "refresh_token", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/types/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/types/__init__.py deleted file mode 100644 index 846044624065..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/types/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .token_response import TokenResponse -_dynamic_imports: typing.Dict[str, str] = {"TokenResponse": ".token_response"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["TokenResponse"] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/types/token_response.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/types/token_response.py deleted file mode 100644 index 27eeca677e12..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/types/token_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class TokenResponse(UniversalBaseModel): - """ - An OAuth token response. - """ - - access_token: str - expires_in: int - refresh_token: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/client.py deleted file mode 100644 index d676b2424306..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/client.py +++ /dev/null @@ -1,226 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import httpx -from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .core.oauth_token_provider import AsyncOAuthTokenProvider, OAuthTokenProvider - -if typing.TYPE_CHECKING: - from .auth.client import AsyncAuthClient, AuthClient - from .nested.client import AsyncNestedClient, NestedClient - from .nested_no_auth.client import AsyncNestedNoAuthClient, NestedNoAuthClient - from .simple.client import AsyncSimpleClient, SimpleClient - - -class SeedOauthClientCredentials: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - client_id : str - client_secret : str - _token_getter_override : typing.Optional[typing.Callable[[], str]] - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.Client] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from seed import SeedOauthClientCredentials - - client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - """ - - def __init__( - self, - *, - base_url: str, - client_id: str, - client_secret: str, - _token_getter_override: typing.Optional[typing.Callable[[], str]] = None, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.Client] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read - ) - oauth_token_provider = OAuthTokenProvider( - client_id=client_id, - client_secret=client_secret, - client_wrapper=SyncClientWrapper( - base_url=base_url, - httpx_client=httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.Client(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ), - ) - self._client_wrapper = SyncClientWrapper( - base_url=base_url, - token=_token_getter_override if _token_getter_override is not None else oauth_token_provider.get_token, - httpx_client=httpx_client - if httpx_client is not None - else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.Client(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ) - self._auth: typing.Optional[AuthClient] = None - self._nested_no_auth: typing.Optional[NestedNoAuthClient] = None - self._nested: typing.Optional[NestedClient] = None - self._simple: typing.Optional[SimpleClient] = None - - @property - def auth(self): - if self._auth is None: - from .auth.client import AuthClient # noqa: E402 - - self._auth = AuthClient(client_wrapper=self._client_wrapper) - return self._auth - - @property - def nested_no_auth(self): - if self._nested_no_auth is None: - from .nested_no_auth.client import NestedNoAuthClient # noqa: E402 - - self._nested_no_auth = NestedNoAuthClient(client_wrapper=self._client_wrapper) - return self._nested_no_auth - - @property - def nested(self): - if self._nested is None: - from .nested.client import NestedClient # noqa: E402 - - self._nested = NestedClient(client_wrapper=self._client_wrapper) - return self._nested - - @property - def simple(self): - if self._simple is None: - from .simple.client import SimpleClient # noqa: E402 - - self._simple = SimpleClient(client_wrapper=self._client_wrapper) - return self._simple - - -class AsyncSeedOauthClientCredentials: - """ - Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions. - - Parameters - ---------- - base_url : str - The base url to use for requests from the client. - - client_id : str - client_secret : str - _token_getter_override : typing.Optional[typing.Callable[[], str]] - timeout : typing.Optional[float] - The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced. - - follow_redirects : typing.Optional[bool] - Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in. - - httpx_client : typing.Optional[httpx.AsyncClient] - The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. - - Examples - -------- - from seed import AsyncSeedOauthClientCredentials - - client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - """ - - def __init__( - self, - *, - base_url: str, - client_id: str, - client_secret: str, - _token_getter_override: typing.Optional[typing.Callable[[], str]] = None, - timeout: typing.Optional[float] = None, - follow_redirects: typing.Optional[bool] = True, - httpx_client: typing.Optional[httpx.AsyncClient] = None, - ): - _defaulted_timeout = ( - timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read - ) - oauth_token_provider = AsyncOAuthTokenProvider( - client_id=client_id, - client_secret=client_secret, - client_wrapper=AsyncClientWrapper( - base_url=base_url, - httpx_client=httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ), - ) - self._client_wrapper = AsyncClientWrapper( - base_url=base_url, - token=_token_getter_override, - async_token=oauth_token_provider.get_token, - httpx_client=httpx_client - if httpx_client is not None - else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects) - if follow_redirects is not None - else httpx.AsyncClient(timeout=_defaulted_timeout), - timeout=_defaulted_timeout, - ) - self._auth: typing.Optional[AsyncAuthClient] = None - self._nested_no_auth: typing.Optional[AsyncNestedNoAuthClient] = None - self._nested: typing.Optional[AsyncNestedClient] = None - self._simple: typing.Optional[AsyncSimpleClient] = None - - @property - def auth(self): - if self._auth is None: - from .auth.client import AsyncAuthClient # noqa: E402 - - self._auth = AsyncAuthClient(client_wrapper=self._client_wrapper) - return self._auth - - @property - def nested_no_auth(self): - if self._nested_no_auth is None: - from .nested_no_auth.client import AsyncNestedNoAuthClient # noqa: E402 - - self._nested_no_auth = AsyncNestedNoAuthClient(client_wrapper=self._client_wrapper) - return self._nested_no_auth - - @property - def nested(self): - if self._nested is None: - from .nested.client import AsyncNestedClient # noqa: E402 - - self._nested = AsyncNestedClient(client_wrapper=self._client_wrapper) - return self._nested - - @property - def simple(self): - if self._simple is None: - from .simple.client import AsyncSimpleClient # noqa: E402 - - self._simple = AsyncSimpleClient(client_wrapper=self._client_wrapper) - return self._simple diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/__init__.py deleted file mode 100644 index 9a33e233875e..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/__init__.py +++ /dev/null @@ -1,105 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .api_error import ApiError - from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper - from .datetime_utils import serialize_datetime - from .file import File, convert_file_dict_to_httpx_tuples, with_content_type - from .http_client import AsyncHttpClient, HttpClient - from .http_response import AsyncHttpResponse, HttpResponse - from .jsonable_encoder import jsonable_encoder - from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, - ) - from .query_encoder import encode_query - from .remove_none_from_dict import remove_none_from_dict - from .request_options import RequestOptions - from .serialization import FieldMetadata, convert_and_respect_annotation_metadata -_dynamic_imports: typing.Dict[str, str] = { - "ApiError": ".api_error", - "AsyncClientWrapper": ".client_wrapper", - "AsyncHttpClient": ".http_client", - "AsyncHttpResponse": ".http_response", - "BaseClientWrapper": ".client_wrapper", - "FieldMetadata": ".serialization", - "File": ".file", - "HttpClient": ".http_client", - "HttpResponse": ".http_response", - "IS_PYDANTIC_V2": ".pydantic_utilities", - "RequestOptions": ".request_options", - "SyncClientWrapper": ".client_wrapper", - "UniversalBaseModel": ".pydantic_utilities", - "UniversalRootModel": ".pydantic_utilities", - "convert_and_respect_annotation_metadata": ".serialization", - "convert_file_dict_to_httpx_tuples": ".file", - "encode_query": ".query_encoder", - "jsonable_encoder": ".jsonable_encoder", - "parse_obj_as": ".pydantic_utilities", - "remove_none_from_dict": ".remove_none_from_dict", - "serialize_datetime": ".datetime_utils", - "universal_field_validator": ".pydantic_utilities", - "universal_root_validator": ".pydantic_utilities", - "update_forward_refs": ".pydantic_utilities", - "with_content_type": ".file", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "ApiError", - "AsyncClientWrapper", - "AsyncHttpClient", - "AsyncHttpResponse", - "BaseClientWrapper", - "FieldMetadata", - "File", - "HttpClient", - "HttpResponse", - "IS_PYDANTIC_V2", - "RequestOptions", - "SyncClientWrapper", - "UniversalBaseModel", - "UniversalRootModel", - "convert_and_respect_annotation_metadata", - "convert_file_dict_to_httpx_tuples", - "encode_query", - "jsonable_encoder", - "parse_obj_as", - "remove_none_from_dict", - "serialize_datetime", - "universal_field_validator", - "universal_root_validator", - "update_forward_refs", - "with_content_type", -] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/api_error.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/api_error.py deleted file mode 100644 index 6f850a60cba3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/api_error.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Optional - - -class ApiError(Exception): - headers: Optional[Dict[str, str]] - status_code: Optional[int] - body: Any - - def __init__( - self, - *, - headers: Optional[Dict[str, str]] = None, - status_code: Optional[int] = None, - body: Any = None, - ) -> None: - self.headers = headers - self.status_code = status_code - self.body = body - - def __str__(self) -> str: - return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/datetime_utils.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/datetime_utils.py deleted file mode 100644 index 7c9864a944c2..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/datetime_utils.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt - - -def serialize_datetime(v: dt.datetime) -> str: - """ - Serialize a datetime including timezone info. - - Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. - - UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. - """ - - def _serialize_zoned_datetime(v: dt.datetime) -> str: - if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): - # UTC is a special case where we use "Z" at the end instead of "+00:00" - return v.isoformat().replace("+00:00", "Z") - else: - # Delegate to the typical +/- offset format - return v.isoformat() - - if v.tzinfo is not None: - return _serialize_zoned_datetime(v) - else: - local_tz = dt.datetime.now().astimezone().tzinfo - localized_dt = v.replace(tzinfo=local_tz) - return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/file.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/file.py deleted file mode 100644 index 44b0d27c0895..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/file.py +++ /dev/null @@ -1,67 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast - -# File typing inspired by the flexibility of types within the httpx library -# https://github.com/encode/httpx/blob/master/httpx/_types.py -FileContent = Union[IO[bytes], bytes, str] -File = Union[ - # file (or bytes) - FileContent, - # (filename, file (or bytes)) - Tuple[Optional[str], FileContent], - # (filename, file (or bytes), content_type) - Tuple[Optional[str], FileContent, Optional[str]], - # (filename, file (or bytes), content_type, headers) - Tuple[ - Optional[str], - FileContent, - Optional[str], - Mapping[str, str], - ], -] - - -def convert_file_dict_to_httpx_tuples( - d: Dict[str, Union[File, List[File]]], -) -> List[Tuple[str, File]]: - """ - The format we use is a list of tuples, where the first element is the - name of the file and the second is the file object. Typically HTTPX wants - a dict, but to be able to send lists of files, you have to use the list - approach (which also works for non-lists) - https://github.com/encode/httpx/pull/1032 - """ - - httpx_tuples = [] - for key, file_like in d.items(): - if isinstance(file_like, list): - for file_like_item in file_like: - httpx_tuples.append((key, file_like_item)) - else: - httpx_tuples.append((key, file_like)) - return httpx_tuples - - -def with_content_type(*, file: File, default_content_type: str) -> File: - """ - This function resolves to the file's content type, if provided, and defaults - to the default_content_type value if not. - """ - if isinstance(file, tuple): - if len(file) == 2: - filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore - return (filename, content, default_content_type) - elif len(file) == 3: - filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore - out_content_type = file_content_type or default_content_type - return (filename, content, out_content_type) - elif len(file) == 4: - filename, content, file_content_type, headers = cast( # type: ignore - Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file - ) - out_content_type = file_content_type or default_content_type - return (filename, content, out_content_type, headers) - else: - raise ValueError(f"Unexpected tuple length: {len(file)}") - return (None, file, default_content_type) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/force_multipart.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/force_multipart.py deleted file mode 100644 index 5440913fd4bc..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/force_multipart.py +++ /dev/null @@ -1,18 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict - - -class ForceMultipartDict(Dict[str, Any]): - """ - A dictionary subclass that always evaluates to True in boolean contexts. - - This is used to force multipart/form-data encoding in HTTP requests even when - the dictionary is empty, which would normally evaluate to False. - """ - - def __bool__(self) -> bool: - return True - - -FORCE_MULTIPART = ForceMultipartDict() diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_client.py deleted file mode 100644 index f4a7c0710387..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_client.py +++ /dev/null @@ -1,613 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import asyncio -import email.utils -import re -import time -import typing -import urllib.parse -from contextlib import asynccontextmanager, contextmanager -from random import random - -import httpx -from .file import File, convert_file_dict_to_httpx_tuples -from .force_multipart import FORCE_MULTIPART -from .jsonable_encoder import jsonable_encoder -from .query_encoder import encode_query -from .remove_none_from_dict import remove_none_from_dict as remove_none_from_dict -from .request_options import RequestOptions -from httpx._types import RequestFiles - -INITIAL_RETRY_DELAY_SECONDS = 1.0 -MAX_RETRY_DELAY_SECONDS = 60.0 -JITTER_FACTOR = 0.2 # 20% random jitter - - -def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: - """ - This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. - - Inspired by the urllib3 retry implementation. - """ - retry_after_ms = response_headers.get("retry-after-ms") - if retry_after_ms is not None: - try: - return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 - except Exception: - pass - - retry_after = response_headers.get("retry-after") - if retry_after is None: - return None - - # Attempt to parse the header as an int. - if re.match(r"^\s*[0-9]+\s*$", retry_after): - seconds = float(retry_after) - # Fallback to parsing it as a date. - else: - retry_date_tuple = email.utils.parsedate_tz(retry_after) - if retry_date_tuple is None: - return None - if retry_date_tuple[9] is None: # Python 2 - # Assume UTC if no timezone was specified - # On Python2.7, parsedate_tz returns None for a timezone offset - # instead of 0 if no timezone is given, where mktime_tz treats - # a None timezone offset as local time. - retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] - - retry_date = email.utils.mktime_tz(retry_date_tuple) - seconds = retry_date - time.time() - - if seconds < 0: - seconds = 0 - - return seconds - - -def _add_positive_jitter(delay: float) -> float: - """Add positive jitter (0-20%) to prevent thundering herd.""" - jitter_multiplier = 1 + random() * JITTER_FACTOR - return delay * jitter_multiplier - - -def _add_symmetric_jitter(delay: float) -> float: - """Add symmetric jitter (±10%) for exponential backoff.""" - jitter_multiplier = 1 + (random() - 0.5) * JITTER_FACTOR - return delay * jitter_multiplier - - -def _parse_x_ratelimit_reset(response_headers: httpx.Headers) -> typing.Optional[float]: - """ - Parse the X-RateLimit-Reset header (Unix timestamp in seconds). - Returns seconds to wait, or None if header is missing/invalid. - """ - reset_time_str = response_headers.get("x-ratelimit-reset") - if reset_time_str is None: - return None - - try: - reset_time = int(reset_time_str) - delay = reset_time - time.time() - if delay > 0: - return delay - except (ValueError, TypeError): - pass - - return None - - -def _retry_timeout(response: httpx.Response, retries: int) -> float: - """ - Determine the amount of time to wait before retrying a request. - This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff - with a jitter to determine the number of seconds to wait. - """ - - # 1. Check Retry-After header first - retry_after = _parse_retry_after(response.headers) - if retry_after is not None and retry_after > 0: - return min(retry_after, MAX_RETRY_DELAY_SECONDS) - - # 2. Check X-RateLimit-Reset header (with positive jitter) - ratelimit_reset = _parse_x_ratelimit_reset(response.headers) - if ratelimit_reset is not None: - return _add_positive_jitter(min(ratelimit_reset, MAX_RETRY_DELAY_SECONDS)) - - # 3. Fall back to exponential backoff (with symmetric jitter) - backoff = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) - return _add_symmetric_jitter(backoff) - - -def _should_retry(response: httpx.Response) -> bool: - retryable_400s = [429, 408, 409] - return response.status_code >= 500 or response.status_code in retryable_400s - - -def _maybe_filter_none_from_multipart_data( - data: typing.Optional[typing.Any], - request_files: typing.Optional[RequestFiles], - force_multipart: typing.Optional[bool], -) -> typing.Optional[typing.Any]: - """ - Filter None values from data body for multipart/form requests. - This prevents httpx from converting None to empty strings in multipart encoding. - Only applies when files are present or force_multipart is True. - """ - if data is not None and isinstance(data, typing.Mapping) and (request_files or force_multipart): - return remove_none_from_dict(data) - return data - - -def remove_omit_from_dict( - original: typing.Dict[str, typing.Optional[typing.Any]], - omit: typing.Optional[typing.Any], -) -> typing.Dict[str, typing.Any]: - if omit is None: - return original - new: typing.Dict[str, typing.Any] = {} - for key, value in original.items(): - if value is not omit: - new[key] = value - return new - - -def maybe_filter_request_body( - data: typing.Optional[typing.Any], - request_options: typing.Optional[RequestOptions], - omit: typing.Optional[typing.Any], -) -> typing.Optional[typing.Any]: - if data is None: - return ( - jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} - if request_options is not None - else None - ) - elif not isinstance(data, typing.Mapping): - data_content = jsonable_encoder(data) - else: - data_content = { - **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore - **( - jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} - if request_options is not None - else {} - ), - } - return data_content - - -# Abstracted out for testing purposes -def get_request_body( - *, - json: typing.Optional[typing.Any], - data: typing.Optional[typing.Any], - request_options: typing.Optional[RequestOptions], - omit: typing.Optional[typing.Any], -) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: - json_body = None - data_body = None - if data is not None: - data_body = maybe_filter_request_body(data, request_options, omit) - else: - # If both data and json are None, we send json data in the event extra properties are specified - json_body = maybe_filter_request_body(json, request_options, omit) - - # If you have an empty JSON body, you should just send None - return (json_body if json_body != {} else None), data_body if data_body != {} else None - - -class HttpClient: - def __init__( - self, - *, - httpx_client: httpx.Client, - base_timeout: typing.Callable[[], typing.Optional[float]], - base_headers: typing.Callable[[], typing.Dict[str, str]], - base_url: typing.Optional[typing.Callable[[], str]] = None, - ): - self.base_url = base_url - self.base_timeout = base_timeout - self.base_headers = base_headers - self.httpx_client = httpx_client - - def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: - base_url = maybe_base_url - if self.base_url is not None and base_url is None: - base_url = self.base_url() - - if base_url is None: - raise ValueError("A base_url is required to make this request, please provide one and try again.") - return base_url - - def request( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> httpx.Response: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - response = self.httpx_client.request( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) or {} - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) - - max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 - if _should_retry(response=response): - if max_retries > retries: - time.sleep(_retry_timeout(response=response, retries=retries)) - return self.request( - path=path, - method=method, - base_url=base_url, - params=params, - json=json, - content=content, - files=files, - headers=headers, - request_options=request_options, - retries=retries + 1, - omit=omit, - ) - - return response - - @contextmanager - def stream( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> typing.Iterator[httpx.Response]: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - with self.httpx_client.stream( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) as stream: - yield stream - - -class AsyncHttpClient: - def __init__( - self, - *, - httpx_client: httpx.AsyncClient, - base_timeout: typing.Callable[[], typing.Optional[float]], - base_headers: typing.Callable[[], typing.Dict[str, str]], - base_url: typing.Optional[typing.Callable[[], str]] = None, - async_base_headers: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Dict[str, str]]]] = None, - ): - self.base_url = base_url - self.base_timeout = base_timeout - self.base_headers = base_headers - self.async_base_headers = async_base_headers - self.httpx_client = httpx_client - - async def _get_headers(self) -> typing.Dict[str, str]: - if self.async_base_headers is not None: - return await self.async_base_headers() - return self.base_headers() - - def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: - base_url = maybe_base_url - if self.base_url is not None and base_url is None: - base_url = self.base_url() - - if base_url is None: - raise ValueError("A base_url is required to make this request, please provide one and try again.") - return base_url - - async def request( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> httpx.Response: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - # Get headers (supports async token providers) - _headers = await self._get_headers() - - # Add the input to each of these and do None-safety checks - response = await self.httpx_client.request( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **_headers, - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) or {} - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) - - max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 - if _should_retry(response=response): - if max_retries > retries: - await asyncio.sleep(_retry_timeout(response=response, retries=retries)) - return await self.request( - path=path, - method=method, - base_url=base_url, - params=params, - json=json, - content=content, - files=files, - headers=headers, - request_options=request_options, - retries=retries + 1, - omit=omit, - ) - return response - - @asynccontextmanager - async def stream( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> typing.AsyncIterator[httpx.Response]: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - # Get headers (supports async token providers) - _headers = await self._get_headers() - - async with self.httpx_client.stream( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **_headers, - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) - if request_options is not None - else {} - ), - }, - omit=omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) as stream: - yield stream diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_response.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_response.py deleted file mode 100644 index 2479747e8bb0..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Dict, Generic, TypeVar - -import httpx - -# Generic to represent the underlying type of the data wrapped by the HTTP response. -T = TypeVar("T") - - -class BaseHttpResponse: - """Minimalist HTTP response wrapper that exposes response headers.""" - - _response: httpx.Response - - def __init__(self, response: httpx.Response): - self._response = response - - @property - def headers(self) -> Dict[str, str]: - return dict(self._response.headers) - - -class HttpResponse(Generic[T], BaseHttpResponse): - """HTTP response wrapper that exposes response headers and data.""" - - _data: T - - def __init__(self, response: httpx.Response, data: T): - super().__init__(response) - self._data = data - - @property - def data(self) -> T: - return self._data - - def close(self) -> None: - self._response.close() - - -class AsyncHttpResponse(Generic[T], BaseHttpResponse): - """HTTP response wrapper that exposes response headers and data.""" - - _data: T - - def __init__(self, response: httpx.Response, data: T): - super().__init__(response) - self._data = data - - @property - def data(self) -> T: - return self._data - - async def close(self) -> None: - await self._response.aclose() diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/__init__.py deleted file mode 100644 index 730e5a3382eb..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from ._api import EventSource, aconnect_sse, connect_sse - from ._exceptions import SSEError - from ._models import ServerSentEvent -_dynamic_imports: typing.Dict[str, str] = { - "EventSource": "._api", - "SSEError": "._exceptions", - "ServerSentEvent": "._models", - "aconnect_sse": "._api", - "connect_sse": "._api", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_api.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_api.py deleted file mode 100644 index f900b3b686de..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_api.py +++ /dev/null @@ -1,112 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import re -from contextlib import asynccontextmanager, contextmanager -from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast - -import httpx -from ._decoders import SSEDecoder -from ._exceptions import SSEError -from ._models import ServerSentEvent - - -class EventSource: - def __init__(self, response: httpx.Response) -> None: - self._response = response - - def _check_content_type(self) -> None: - content_type = self._response.headers.get("content-type", "").partition(";")[0] - if "text/event-stream" not in content_type: - raise SSEError( - f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" - ) - - def _get_charset(self) -> str: - """Extract charset from Content-Type header, fallback to UTF-8.""" - content_type = self._response.headers.get("content-type", "") - - # Parse charset parameter using regex - charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) - if charset_match: - charset = charset_match.group(1).strip("\"'") - # Validate that it's a known encoding - try: - # Test if the charset is valid by trying to encode/decode - "test".encode(charset).decode(charset) - return charset - except (LookupError, UnicodeError): - # If charset is invalid, fall back to UTF-8 - pass - - # Default to UTF-8 if no charset specified or invalid charset - return "utf-8" - - @property - def response(self) -> httpx.Response: - return self._response - - def iter_sse(self) -> Iterator[ServerSentEvent]: - self._check_content_type() - decoder = SSEDecoder() - charset = self._get_charset() - - buffer = "" - for chunk in self._response.iter_bytes(): - # Decode chunk using detected charset - text_chunk = chunk.decode(charset, errors="replace") - buffer += text_chunk - - # Process complete lines - while "\n" in buffer: - line, buffer = buffer.split("\n", 1) - line = line.rstrip("\r") - sse = decoder.decode(line) - # when we reach a "\n\n" => line = '' - # => decoder will attempt to return an SSE Event - if sse is not None: - yield sse - - # Process any remaining data in buffer - if buffer.strip(): - line = buffer.rstrip("\r") - sse = decoder.decode(line) - if sse is not None: - yield sse - - async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: - self._check_content_type() - decoder = SSEDecoder() - lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) - try: - async for line in lines: - line = line.rstrip("\n") - sse = decoder.decode(line) - if sse is not None: - yield sse - finally: - await lines.aclose() - - -@contextmanager -def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: - headers = kwargs.pop("headers", {}) - headers["Accept"] = "text/event-stream" - headers["Cache-Control"] = "no-store" - - with client.stream(method, url, headers=headers, **kwargs) as response: - yield EventSource(response) - - -@asynccontextmanager -async def aconnect_sse( - client: httpx.AsyncClient, - method: str, - url: str, - **kwargs: Any, -) -> AsyncIterator[EventSource]: - headers = kwargs.pop("headers", {}) - headers["Accept"] = "text/event-stream" - headers["Cache-Control"] = "no-store" - - async with client.stream(method, url, headers=headers, **kwargs) as response: - yield EventSource(response) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_decoders.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_decoders.py deleted file mode 100644 index 339b08901381..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_decoders.py +++ /dev/null @@ -1,61 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import List, Optional - -from ._models import ServerSentEvent - - -class SSEDecoder: - def __init__(self) -> None: - self._event = "" - self._data: List[str] = [] - self._last_event_id = "" - self._retry: Optional[int] = None - - def decode(self, line: str) -> Optional[ServerSentEvent]: - # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 - - if not line: - if not self._event and not self._data and not self._last_event_id and self._retry is None: - return None - - sse = ServerSentEvent( - event=self._event, - data="\n".join(self._data), - id=self._last_event_id, - retry=self._retry, - ) - - # NOTE: as per the SSE spec, do not reset last_event_id. - self._event = "" - self._data = [] - self._retry = None - - return sse - - if line.startswith(":"): - return None - - fieldname, _, value = line.partition(":") - - if value.startswith(" "): - value = value[1:] - - if fieldname == "event": - self._event = value - elif fieldname == "data": - self._data.append(value) - elif fieldname == "id": - if "\0" in value: - pass - else: - self._last_event_id = value - elif fieldname == "retry": - try: - self._retry = int(value) - except (TypeError, ValueError): - pass - else: - pass # Field is ignored. - - return None diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_exceptions.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_exceptions.py deleted file mode 100644 index 81605a8a65ed..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_exceptions.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import httpx - - -class SSEError(httpx.TransportError): - pass diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_models.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_models.py deleted file mode 100644 index 1af57f8fd0d2..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/http_sse/_models.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -from dataclasses import dataclass -from typing import Any, Optional - - -@dataclass(frozen=True) -class ServerSentEvent: - event: str = "message" - data: str = "" - id: str = "" - retry: Optional[int] = None - - def json(self) -> Any: - """Parse the data field as JSON.""" - return json.loads(self.data) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/jsonable_encoder.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/jsonable_encoder.py deleted file mode 100644 index afee3662d836..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/jsonable_encoder.py +++ /dev/null @@ -1,100 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -""" -jsonable_encoder converts a Python object to a JSON-friendly dict -(e.g. datetimes to strings, Pydantic models to dicts). - -Taken from FastAPI, and made a bit simpler -https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py -""" - -import base64 -import dataclasses -import datetime as dt -from enum import Enum -from pathlib import PurePath -from types import GeneratorType -from typing import Any, Callable, Dict, List, Optional, Set, Union - -import pydantic -from .datetime_utils import serialize_datetime -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - encode_by_type, - to_jsonable_with_fallback, -) - -SetIntStr = Set[Union[int, str]] -DictIntStrAny = Dict[Union[int, str], Any] - - -def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: - custom_encoder = custom_encoder or {} - if custom_encoder: - if type(obj) in custom_encoder: - return custom_encoder[type(obj)](obj) - else: - for encoder_type, encoder_instance in custom_encoder.items(): - if isinstance(obj, encoder_type): - return encoder_instance(obj) - if isinstance(obj, pydantic.BaseModel): - if IS_PYDANTIC_V2: - encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 - else: - encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 - if custom_encoder: - encoder.update(custom_encoder) - obj_dict = obj.dict(by_alias=True) - if "__root__" in obj_dict: - obj_dict = obj_dict["__root__"] - if "root" in obj_dict: - obj_dict = obj_dict["root"] - return jsonable_encoder(obj_dict, custom_encoder=encoder) - if dataclasses.is_dataclass(obj): - obj_dict = dataclasses.asdict(obj) # type: ignore - return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) - if isinstance(obj, bytes): - return base64.b64encode(obj).decode("utf-8") - if isinstance(obj, Enum): - return obj.value - if isinstance(obj, PurePath): - return str(obj) - if isinstance(obj, (str, int, float, type(None))): - return obj - if isinstance(obj, dt.datetime): - return serialize_datetime(obj) - if isinstance(obj, dt.date): - return str(obj) - if isinstance(obj, dict): - encoded_dict = {} - allowed_keys = set(obj.keys()) - for key, value in obj.items(): - if key in allowed_keys: - encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) - encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) - encoded_dict[encoded_key] = encoded_value - return encoded_dict - if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): - encoded_list = [] - for item in obj: - encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) - return encoded_list - - def fallback_serializer(o: Any) -> Any: - attempt_encode = encode_by_type(o) - if attempt_encode is not None: - return attempt_encode - - try: - data = dict(o) - except Exception as e: - errors: List[Exception] = [] - errors.append(e) - try: - data = vars(o) - except Exception as e: - errors.append(e) - raise ValueError(errors) from e - return jsonable_encoder(data, custom_encoder=custom_encoder) - - return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/oauth_token_provider.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/oauth_token_provider.py deleted file mode 100644 index f7af20ace10b..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/oauth_token_provider.py +++ /dev/null @@ -1,77 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import asyncio -import datetime as dt -import threading -import typing -from asyncio import Lock as asyncio_Lock -from threading import Lock as threading_Lock - -from ..auth.client import AsyncAuthClient, AuthClient -from .client_wrapper import AsyncClientWrapper, SyncClientWrapper - - -class OAuthTokenProvider: - BUFFER_IN_MINUTES = 2 - - def __init__(self, *, client_id: str, client_secret: str, client_wrapper: SyncClientWrapper): - self._client_id = client_id - self._client_secret = client_secret - self._access_token: typing.Optional[str] = None - self._expires_at: dt.datetime = dt.datetime.now() - self._auth_client = AuthClient(client_wrapper=client_wrapper) - self._lock: threading_Lock = threading.Lock() - - def get_token(self) -> str: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - with self._lock: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - return self._refresh() - - def _refresh(self) -> str: - token_response = self._auth_client.get_token_with_client_credentials( - client_id=self._client_id, client_secret=self._client_secret - ) - self._access_token = token_response.access_token - self._expires_at = self._get_expires_at( - expires_in_seconds=token_response.expires_in, buffer_in_minutes=self.BUFFER_IN_MINUTES - ) - return self._access_token - - def _get_expires_at(self, *, expires_in_seconds: int, buffer_in_minutes: int): - return dt.datetime.now() + dt.timedelta(seconds=expires_in_seconds) - dt.timedelta(minutes=buffer_in_minutes) - - -class AsyncOAuthTokenProvider: - BUFFER_IN_MINUTES = 2 - - def __init__(self, *, client_id: str, client_secret: str, client_wrapper: AsyncClientWrapper): - self._client_id = client_id - self._client_secret = client_secret - self._access_token: typing.Optional[str] = None - self._expires_at: dt.datetime = dt.datetime.now() - self._auth_client = AsyncAuthClient(client_wrapper=client_wrapper) - self._lock: asyncio_Lock = asyncio.Lock() - - async def get_token(self) -> str: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - async with self._lock: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - return await self._refresh() - - async def _refresh(self) -> str: - token_response = await self._auth_client.get_token_with_client_credentials( - client_id=self._client_id, client_secret=self._client_secret - ) - self._access_token = token_response.access_token - self._expires_at = self._get_expires_at( - expires_in_seconds=token_response.expires_in, buffer_in_minutes=self.BUFFER_IN_MINUTES - ) - return self._access_token - - def _get_expires_at(self, *, expires_in_seconds: int, buffer_in_minutes: int): - return dt.datetime.now() + dt.timedelta(seconds=expires_in_seconds) - dt.timedelta(minutes=buffer_in_minutes) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/pydantic_utilities.py deleted file mode 100644 index 185e5c4f64be..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/pydantic_utilities.py +++ /dev/null @@ -1,260 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# nopycln: file -import datetime as dt -from collections import defaultdict -from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast - -import pydantic - -IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") - -if IS_PYDANTIC_V2: - from pydantic.v1.datetime_parse import parse_date as parse_date - from pydantic.v1.datetime_parse import parse_datetime as parse_datetime - from pydantic.v1.fields import ModelField as ModelField - from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] - from pydantic.v1.typing import get_args as get_args - from pydantic.v1.typing import get_origin as get_origin - from pydantic.v1.typing import is_literal_type as is_literal_type - from pydantic.v1.typing import is_union as is_union -else: - from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] - from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] - from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef] - from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef] - from pydantic.typing import get_args as get_args # type: ignore[no-redef] - from pydantic.typing import get_origin as get_origin # type: ignore[no-redef] - from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef] - from pydantic.typing import is_union as is_union # type: ignore[no-redef] - -from .datetime_utils import serialize_datetime -from .serialization import convert_and_respect_annotation_metadata -from typing_extensions import TypeAlias - -T = TypeVar("T") -Model = TypeVar("Model", bound=pydantic.BaseModel) - - -def parse_obj_as(type_: Type[T], object_: Any) -> T: - dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") - if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] - return adapter.validate_python(dealiased_object) - return pydantic.parse_obj_as(type_, dealiased_object) - - -def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any: - if IS_PYDANTIC_V2: - from pydantic_core import to_jsonable_python - - return to_jsonable_python(obj, fallback=fallback_serializer) - return fallback_serializer(obj) - - -class UniversalBaseModel(pydantic.BaseModel): - if IS_PYDANTIC_V2: - model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key] - # Allow fields beginning with `model_` to be used in the model - protected_namespaces=(), - ) - - @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] - def serialize_model(self) -> Any: # type: ignore[name-defined] - serialized = self.dict() # type: ignore[attr-defined] - data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} - return data - - else: - - class Config: - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} - - @classmethod - def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": - dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") - return cls.construct(_fields_set, **dealiased_object) - - @classmethod - def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": - dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") - if IS_PYDANTIC_V2: - return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc] - return super().construct(_fields_set, **dealiased_object) - - def json(self, **kwargs: Any) -> str: - kwargs_with_defaults = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - if IS_PYDANTIC_V2: - return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc] - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: Any) -> Dict[str, Any]: - """ - Override the default dict method to `exclude_unset` by default. This function patches - `exclude_unset` to work include fields within non-None default values. - """ - # Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2 - # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. - # - # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models - # that we have less control over, and this is less intrusive than custom serializers for now. - if IS_PYDANTIC_V2: - kwargs_with_defaults_exclude_unset = { - **kwargs, - "by_alias": True, - "exclude_unset": True, - "exclude_none": False, - } - kwargs_with_defaults_exclude_none = { - **kwargs, - "by_alias": True, - "exclude_none": True, - "exclude_unset": False, - } - dict_dump = deep_union_pydantic_dicts( - super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc] - super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc] - ) - - else: - _fields_set = self.__fields_set__.copy() - - fields = _get_model_fields(self.__class__) - for name, field in fields.items(): - if name not in _fields_set: - default = _get_field_default(field) - - # If the default values are non-null act like they've been set - # This effectively allows exclude_unset to work like exclude_none where - # the latter passes through intentionally set none values. - if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): - _fields_set.add(name) - - if default is not None: - self.__fields_set__.add(name) - - kwargs_with_defaults_exclude_unset_include_fields = { - "by_alias": True, - "exclude_unset": True, - "include": _fields_set, - **kwargs, - } - - dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - - return cast( - Dict[str, Any], - convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), - ) - - -def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: - converted_list: List[Any] = [] - for i, item in enumerate(source): - destination_value = destination[i] - if isinstance(item, dict): - converted_list.append(deep_union_pydantic_dicts(item, destination_value)) - elif isinstance(item, list): - converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) - else: - converted_list.append(item) - return converted_list - - -def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]: - for key, value in source.items(): - node = destination.setdefault(key, {}) - if isinstance(value, dict): - deep_union_pydantic_dicts(value, node) - # Note: we do not do this same processing for sets given we do not have sets of models - # and given the sets are unordered, the processing of the set and matching objects would - # be non-trivial. - elif isinstance(value, list): - destination[key] = _union_list_of_pydantic_dicts(value, node) - else: - destination[key] = value - - return destination - - -if IS_PYDANTIC_V2: - - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] - pass - - UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] -else: - UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef] - - -def encode_by_type(o: Any) -> Any: - encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) - for type_, encoder in encoders_by_type.items(): - encoders_by_class_tuples[encoder] += (type_,) - - if type(o) in encoders_by_type: - return encoders_by_type[type(o)](o) - for encoder, classes_tuple in encoders_by_class_tuples.items(): - if isinstance(o, classes_tuple): - return encoder(o) - - -def update_forward_refs(model: Type["Model"], **localns: Any) -> None: - if IS_PYDANTIC_V2: - model.model_rebuild(raise_errors=False) # type: ignore[attr-defined] - else: - model.update_forward_refs(**localns) - - -# Mirrors Pydantic's internal typing -AnyCallable = Callable[..., Any] - - -def universal_root_validator( - pre: bool = False, -) -> Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - # In Pydantic v2, for RootModel we always use "before" mode - # The custom validators transform the input value before the model is created - return cast(AnyCallable, pydantic.model_validator(mode="before")(func)) # type: ignore[attr-defined] - return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] - - return decorator - - -def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined] - return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func)) - - return decorator - - -PydanticField = Union[ModelField, pydantic.fields.FieldInfo] - - -def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]: - if IS_PYDANTIC_V2: - return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined] - return cast(Mapping[str, PydanticField], model.__fields__) - - -def _get_field_default(field: PydanticField) -> Any: - try: - value = field.get_default() # type: ignore[union-attr] - except: - value = field.default - if IS_PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None - return value - return value diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/query_encoder.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/query_encoder.py deleted file mode 100644 index 3183001d4046..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/query_encoder.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, List, Optional, Tuple - -import pydantic - - -# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict -def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: - result = [] - for k, v in dict_flat.items(): - key = f"{key_prefix}[{k}]" if key_prefix is not None else k - if isinstance(v, dict): - result.extend(traverse_query_dict(v, key)) - elif isinstance(v, list): - for arr_v in v: - if isinstance(arr_v, dict): - result.extend(traverse_query_dict(arr_v, key)) - else: - result.append((key, arr_v)) - else: - result.append((key, v)) - return result - - -def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: - if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): - if isinstance(query_value, pydantic.BaseModel): - obj_dict = query_value.dict(by_alias=True) - else: - obj_dict = query_value - return traverse_query_dict(obj_dict, query_key) - elif isinstance(query_value, list): - encoded_values: List[Tuple[str, Any]] = [] - for value in query_value: - if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): - if isinstance(value, pydantic.BaseModel): - obj_dict = value.dict(by_alias=True) - elif isinstance(value, dict): - obj_dict = value - - encoded_values.extend(single_query_encoder(query_key, obj_dict)) - else: - encoded_values.append((query_key, value)) - - return encoded_values - - return [(query_key, query_value)] - - -def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: - if query is None: - return None - - encoded_query = [] - for k, v in query.items(): - encoded_query.extend(single_query_encoder(k, v)) - return encoded_query diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/remove_none_from_dict.py deleted file mode 100644 index c2298143f14a..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/remove_none_from_dict.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Mapping, Optional - - -def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: - new: Dict[str, Any] = {} - for key, value in original.items(): - if value is not None: - new[key] = value - return new diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/request_options.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/request_options.py deleted file mode 100644 index 1b38804432ba..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/request_options.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -try: - from typing import NotRequired # type: ignore -except ImportError: - from typing_extensions import NotRequired - - -class RequestOptions(typing.TypedDict, total=False): - """ - Additional options for request-specific configuration when calling APIs via the SDK. - This is used primarily as an optional final parameter for service functions. - - Attributes: - - timeout_in_seconds: int. The number of seconds to await an API call before timing out. - - - max_retries: int. The max number of retries to attempt if the API call fails. - - - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict - - - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict - - - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict - - - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. - """ - - timeout_in_seconds: NotRequired[int] - max_retries: NotRequired[int] - additional_headers: NotRequired[typing.Dict[str, typing.Any]] - additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] - additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] - chunk_size: NotRequired[int] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/serialization.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/serialization.py deleted file mode 100644 index c36e865cc729..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/serialization.py +++ /dev/null @@ -1,276 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import collections -import inspect -import typing - -import pydantic -import typing_extensions - - -class FieldMetadata: - """ - Metadata class used to annotate fields to provide additional information. - - Example: - class MyDict(TypedDict): - field: typing.Annotated[str, FieldMetadata(alias="field_name")] - - Will serialize: `{"field": "value"}` - To: `{"field_name": "value"}` - """ - - alias: str - - def __init__(self, *, alias: str) -> None: - self.alias = alias - - -def convert_and_respect_annotation_metadata( - *, - object_: typing.Any, - annotation: typing.Any, - inner_type: typing.Optional[typing.Any] = None, - direction: typing.Literal["read", "write"], -) -> typing.Any: - """ - Respect the metadata annotations on a field, such as aliasing. This function effectively - manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for - TypedDicts, which cannot support aliasing out of the box, and can be extended for additional - utilities, such as defaults. - - Parameters - ---------- - object_ : typing.Any - - annotation : type - The type we're looking to apply typing annotations from - - inner_type : typing.Optional[type] - - Returns - ------- - typing.Any - """ - - if object_ is None: - return None - if inner_type is None: - inner_type = annotation - - clean_type = _remove_annotations(inner_type) - # Pydantic models - if ( - inspect.isclass(clean_type) - and issubclass(clean_type, pydantic.BaseModel) - and isinstance(object_, typing.Mapping) - ): - return _convert_mapping(object_, clean_type, direction) - # TypedDicts - if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): - return _convert_mapping(object_, clean_type, direction) - - if ( - typing_extensions.get_origin(clean_type) == typing.Dict - or typing_extensions.get_origin(clean_type) == dict - or clean_type == typing.Dict - ) and isinstance(object_, typing.Dict): - key_type = typing_extensions.get_args(clean_type)[0] - value_type = typing_extensions.get_args(clean_type)[1] - - return { - key: convert_and_respect_annotation_metadata( - object_=value, - annotation=annotation, - inner_type=value_type, - direction=direction, - ) - for key, value in object_.items() - } - - # If you're iterating on a string, do not bother to coerce it to a sequence. - if not isinstance(object_, str): - if ( - typing_extensions.get_origin(clean_type) == typing.Set - or typing_extensions.get_origin(clean_type) == set - or clean_type == typing.Set - ) and isinstance(object_, typing.Set): - inner_type = typing_extensions.get_args(clean_type)[0] - return { - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - } - elif ( - ( - typing_extensions.get_origin(clean_type) == typing.List - or typing_extensions.get_origin(clean_type) == list - or clean_type == typing.List - ) - and isinstance(object_, typing.List) - ) or ( - ( - typing_extensions.get_origin(clean_type) == typing.Sequence - or typing_extensions.get_origin(clean_type) == collections.abc.Sequence - or clean_type == typing.Sequence - ) - and isinstance(object_, typing.Sequence) - ): - inner_type = typing_extensions.get_args(clean_type)[0] - return [ - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - ] - - if typing_extensions.get_origin(clean_type) == typing.Union: - # We should be able to ~relatively~ safely try to convert keys against all - # member types in the union, the edge case here is if one member aliases a field - # of the same name to a different name from another member - # Or if another member aliases a field of the same name that another member does not. - for member in typing_extensions.get_args(clean_type): - object_ = convert_and_respect_annotation_metadata( - object_=object_, - annotation=annotation, - inner_type=member, - direction=direction, - ) - return object_ - - annotated_type = _get_annotation(annotation) - if annotated_type is None: - return object_ - - # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) - # Then we can safely call it on the recursive conversion. - return object_ - - -def _convert_mapping( - object_: typing.Mapping[str, object], - expected_type: typing.Any, - direction: typing.Literal["read", "write"], -) -> typing.Mapping[str, object]: - converted_object: typing.Dict[str, object] = {} - try: - annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) - except NameError: - # The TypedDict contains a circular reference, so - # we use the __annotations__ attribute directly. - annotations = getattr(expected_type, "__annotations__", {}) - aliases_to_field_names = _get_alias_to_field_name(annotations) - for key, value in object_.items(): - if direction == "read" and key in aliases_to_field_names: - dealiased_key = aliases_to_field_names.get(key) - if dealiased_key is not None: - type_ = annotations.get(dealiased_key) - else: - type_ = annotations.get(key) - # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map - # - # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias - # then we can just pass the value through as is - if type_ is None: - converted_object[key] = value - elif direction == "read" and key not in aliases_to_field_names: - converted_object[key] = convert_and_respect_annotation_metadata( - object_=value, annotation=type_, direction=direction - ) - else: - converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( - convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) - ) - return converted_object - - -def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return None - - if maybe_annotated_type == typing_extensions.NotRequired: - type_ = typing_extensions.get_args(type_)[0] - maybe_annotated_type = typing_extensions.get_origin(type_) - - if maybe_annotated_type == typing_extensions.Annotated: - return type_ - - return None - - -def _remove_annotations(type_: typing.Any) -> typing.Any: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return type_ - - if maybe_annotated_type == typing_extensions.NotRequired: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - if maybe_annotated_type == typing_extensions.Annotated: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - return type_ - - -def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_alias_to_field_name(annotations) - - -def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_field_to_alias_name(annotations) - - -def _get_alias_to_field_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[maybe_alias] = field - return aliases - - -def _get_field_to_alias_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[field] = maybe_alias - return aliases - - -def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: - maybe_annotated_type = _get_annotation(type_) - - if maybe_annotated_type is not None: - # The actual annotations are 1 onward, the first is the annotated type - annotations = typing_extensions.get_args(maybe_annotated_type)[1:] - - for annotation in annotations: - if isinstance(annotation, FieldMetadata) and annotation.alias is not None: - return annotation.alias - return None - - -def _alias_key( - key: str, - type_: typing.Any, - direction: typing.Literal["read", "write"], - aliases_to_field_names: typing.Dict[str, str], -) -> str: - if direction == "read": - return aliases_to_field_names.get(key, key) - return _get_alias_from_type(type_=type_) or key diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/__init__.py deleted file mode 100644 index 87547c8ef9a8..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import api -_dynamic_imports: typing.Dict[str, str] = {"api": ".api"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["api"] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/__init__.py deleted file mode 100644 index 5cde0202dcf3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/raw_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/raw_client.py deleted file mode 100644 index d7f7becabd87..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/raw_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.request_options import RequestOptions - - -class RawApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "nested/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_something( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "nested/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/client.py deleted file mode 100644 index b6b69853720e..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/client.py +++ /dev/null @@ -1,63 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .raw_client import AsyncRawNestedClient, RawNestedClient - -if typing.TYPE_CHECKING: - from .api.client import ApiClient, AsyncApiClient - - -class NestedClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawNestedClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[ApiClient] = None - - @property - def with_raw_response(self) -> RawNestedClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawNestedClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import ApiClient # noqa: E402 - - self._api = ApiClient(client_wrapper=self._client_wrapper) - return self._api - - -class AsyncNestedClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawNestedClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[AsyncApiClient] = None - - @property - def with_raw_response(self) -> AsyncRawNestedClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawNestedClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import AsyncApiClient # noqa: E402 - - self._api = AsyncApiClient(client_wrapper=self._client_wrapper) - return self._api diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/raw_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/raw_client.py deleted file mode 100644 index 27d31b97385d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/raw_client.py +++ /dev/null @@ -1,13 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper - - -class RawNestedClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - -class AsyncRawNestedClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/__init__.py deleted file mode 100644 index 87547c8ef9a8..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import api -_dynamic_imports: typing.Dict[str, str] = {"api": ".api"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["api"] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/__init__.py deleted file mode 100644 index 5cde0202dcf3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/raw_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/raw_client.py deleted file mode 100644 index 4fbe653ac421..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/raw_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.request_options import RequestOptions - - -class RawApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "nested-no-auth/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_something( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "nested-no-auth/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/client.py deleted file mode 100644 index d72921720357..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/client.py +++ /dev/null @@ -1,63 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .raw_client import AsyncRawNestedNoAuthClient, RawNestedNoAuthClient - -if typing.TYPE_CHECKING: - from .api.client import ApiClient, AsyncApiClient - - -class NestedNoAuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawNestedNoAuthClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[ApiClient] = None - - @property - def with_raw_response(self) -> RawNestedNoAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawNestedNoAuthClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import ApiClient # noqa: E402 - - self._api = ApiClient(client_wrapper=self._client_wrapper) - return self._api - - -class AsyncNestedNoAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawNestedNoAuthClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[AsyncApiClient] = None - - @property - def with_raw_response(self) -> AsyncRawNestedNoAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawNestedNoAuthClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import AsyncApiClient # noqa: E402 - - self._api = AsyncApiClient(client_wrapper=self._client_wrapper) - return self._api diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/raw_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/raw_client.py deleted file mode 100644 index 0c7a80a10e7a..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/raw_client.py +++ /dev/null @@ -1,13 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper - - -class RawNestedNoAuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - -class AsyncRawNestedNoAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/py.typed b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/py.typed deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/__init__.py deleted file mode 100644 index 5cde0202dcf3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/raw_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/raw_client.py deleted file mode 100644 index aa82d3dd5984..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/raw_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.request_options import RequestOptions - - -class RawSimpleClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawSimpleClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_something( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/custom/test_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/custom/test_client.py deleted file mode 100644 index ab04ce6393ef..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/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/oauth-client-credentials/no-custom-config/tests/utils/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/__init__.py deleted file mode 100644 index f3ea2659bb1c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/__init__.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/__init__.py deleted file mode 100644 index 2cf01263529d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -from .circle import CircleParams -from .object_with_defaults import ObjectWithDefaultsParams -from .object_with_optional_field import ObjectWithOptionalFieldParams -from .shape import Shape_CircleParams, Shape_SquareParams, ShapeParams -from .square import SquareParams -from .undiscriminated_shape import UndiscriminatedShapeParams - -__all__ = [ - "CircleParams", - "ObjectWithDefaultsParams", - "ObjectWithOptionalFieldParams", - "ShapeParams", - "Shape_CircleParams", - "Shape_SquareParams", - "SquareParams", - "UndiscriminatedShapeParams", -] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/circle.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/circle.py deleted file mode 100644 index 74ecf38c308b..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/circle.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - -from seed.core.serialization import FieldMetadata - - -class CircleParams(typing_extensions.TypedDict): - radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/color.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/color.py deleted file mode 100644 index 2aa2c4c52f0c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/color.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing - -Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/object_with_defaults.py deleted file mode 100644 index a977b1d2aa1c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/object_with_defaults.py +++ /dev/null @@ -1,15 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - - -class ObjectWithDefaultsParams(typing_extensions.TypedDict): - """ - Defines properties with default values and validation rules. - """ - - decimal: typing_extensions.NotRequired[float] - string: typing_extensions.NotRequired[str] - required_string: str diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/object_with_optional_field.py deleted file mode 100644 index 6b5608bc05b6..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/object_with_optional_field.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -import uuid - -import typing_extensions -from .color import Color -from .shape import ShapeParams -from .undiscriminated_shape import UndiscriminatedShapeParams - -from seed.core.serialization import FieldMetadata - - -class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): - literal: typing.Literal["lit_one"] - string: typing_extensions.NotRequired[str] - integer: typing_extensions.NotRequired[int] - long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] - double: typing_extensions.NotRequired[float] - bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] - datetime: typing_extensions.NotRequired[dt.datetime] - date: typing_extensions.NotRequired[dt.date] - uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] - base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] - list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] - set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] - map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] - enum: typing_extensions.NotRequired[Color] - union: typing_extensions.NotRequired[ShapeParams] - second_union: typing_extensions.NotRequired[ShapeParams] - undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] - any: typing.Optional[typing.Any] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/shape.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/shape.py deleted file mode 100644 index 7e70010a251f..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/shape.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import typing_extensions - -from seed.core.serialization import FieldMetadata - - -class Base(typing_extensions.TypedDict): - id: str - - -class Shape_CircleParams(Base): - shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] - radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] - - -class Shape_SquareParams(Base): - shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] - length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] - - -ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/square.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/square.py deleted file mode 100644 index 71c7d25fd4ad..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/square.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - -from seed.core.serialization import FieldMetadata - - -class SquareParams(typing_extensions.TypedDict): - length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/undiscriminated_shape.py deleted file mode 100644 index 99f12b300d1d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/assets/models/undiscriminated_shape.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .circle import CircleParams -from .square import SquareParams - -UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_http_client.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_http_client.py deleted file mode 100644 index 79d01a455762..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_http_client.py +++ /dev/null @@ -1,109 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed.core.http_client import get_request_body, remove_none_from_dict -from seed.core.request_options import RequestOptions - - -def get_request_options() -> RequestOptions: - return {"additional_body_parameters": {"see you": "later"}} - - -def get_request_options_with_none() -> RequestOptions: - return {"additional_body_parameters": {"see you": "later", "optional": None}} - - -def test_get_json_request_body() -> None: - json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) - assert json_body == {"hello": "world"} - assert data_body is None - - json_body_extras, data_body_extras = get_request_body( - json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None - ) - - assert json_body_extras == {"goodbye": "world", "see you": "later"} - assert data_body_extras is None - - -def test_get_files_request_body() -> None: - json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) - assert data_body == {"hello": "world"} - assert json_body is None - - json_body_extras, data_body_extras = get_request_body( - json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None - ) - - assert data_body_extras == {"goodbye": "world", "see you": "later"} - assert json_body_extras is None - - -def test_get_none_request_body() -> None: - json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) - assert data_body is None - assert json_body is None - - json_body_extras, data_body_extras = get_request_body( - json=None, data=None, request_options=get_request_options(), omit=None - ) - - assert json_body_extras == {"see you": "later"} - assert data_body_extras is None - - -def test_get_empty_json_request_body() -> None: - unrelated_request_options: RequestOptions = {"max_retries": 3} - json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) - assert json_body is None - assert data_body is None - - json_body_extras, data_body_extras = get_request_body( - json={}, data=None, request_options=unrelated_request_options, omit=None - ) - - assert json_body_extras is None - assert data_body_extras is None - - -def test_json_body_preserves_none_values() -> None: - """Test that JSON bodies preserve None values (they become JSON null).""" - json_body, data_body = get_request_body( - json={"hello": "world", "optional": None}, data=None, request_options=None, omit=None - ) - # JSON bodies should preserve None values - assert json_body == {"hello": "world", "optional": None} - assert data_body is None - - -def test_data_body_preserves_none_values_without_multipart() -> None: - """Test that data bodies preserve None values when not using multipart. - - The filtering of None values happens in HttpClient.request/stream methods, - not in get_request_body. This test verifies get_request_body doesn't filter None. - """ - json_body, data_body = get_request_body( - json=None, data={"hello": "world", "optional": None}, request_options=None, omit=None - ) - # get_request_body should preserve None values in data body - # The filtering happens later in HttpClient.request when multipart is detected - assert data_body == {"hello": "world", "optional": None} - assert json_body is None - - -def test_remove_none_from_dict_filters_none_values() -> None: - """Test that remove_none_from_dict correctly filters out None values.""" - original = {"hello": "world", "optional": None, "another": "value", "also_none": None} - filtered = remove_none_from_dict(original) - assert filtered == {"hello": "world", "another": "value"} - # Original should not be modified - assert original == {"hello": "world", "optional": None, "another": "value", "also_none": None} - - -def test_remove_none_from_dict_empty_dict() -> None: - """Test that remove_none_from_dict handles empty dict.""" - assert remove_none_from_dict({}) == {} - - -def test_remove_none_from_dict_all_none() -> None: - """Test that remove_none_from_dict handles dict with all None values.""" - assert remove_none_from_dict({"a": None, "b": None}) == {} diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_query_encoding.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_query_encoding.py deleted file mode 100644 index ef5fd7094f9b..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_query_encoding.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed.core.query_encoder import encode_query - - -def test_query_encoding_deep_objects() -> None: - assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] - assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] - assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ - ("hello_world[hello][world]", "today"), - ("hello_world[test]", "this"), - ("hi", "there"), - ] - - -def test_query_encoding_deep_object_arrays() -> None: - assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ - ("objects[key]", "hello"), - ("objects[value]", "world"), - ("objects[key]", "foo"), - ("objects[value]", "bar"), - ] - assert encode_query( - {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} - ) == [ - ("users[name]", "string"), - ("users[tags]", "string"), - ("users[name]", "string2"), - ("users[tags]", "string2"), - ("users[tags]", "string3"), - ] - - -def test_encode_query_with_none() -> None: - encoded = encode_query(None) - assert encoded is None diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_serialization.py b/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_serialization.py deleted file mode 100644 index b298db89c4bd..000000000000 --- a/seed/python-sdk/oauth-client-credentials/no-custom-config/tests/utils/test_serialization.py +++ /dev/null @@ -1,72 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, List - -from .assets.models import ObjectWithOptionalFieldParams, ShapeParams - -from seed.core.serialization import convert_and_respect_annotation_metadata - -UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} -UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} - - -def test_convert_and_respect_annotation_metadata() -> None: - data: ObjectWithOptionalFieldParams = { - "string": "string", - "long_": 12345, - "bool_": True, - "literal": "lit_one", - "any": "any", - } - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" - ) - assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} - - -def test_convert_and_respect_annotation_metadata_in_list() -> None: - data: List[ObjectWithOptionalFieldParams] = [ - {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, - {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, - ] - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" - ) - - assert converted == [ - {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, - {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, - ] - - -def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: - data: ObjectWithOptionalFieldParams = { - "string": "string", - "long_": 12345, - "union": UNION_TEST, - "literal": "lit_one", - "any": "any", - } - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" - ) - - assert converted == { - "string": "string", - "long": 12345, - "union": UNION_TEST_CONVERTED, - "literal": "lit_one", - "any": "any", - } - - -def test_convert_and_respect_annotation_metadata_in_union() -> None: - converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") - - assert converted == UNION_TEST_CONVERTED - - -def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: - data: Any = {} - converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") - assert converted == data diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/poetry.lock b/seed/python-sdk/oauth-client-credentials/poetry.lock similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/poetry.lock rename to seed/python-sdk/oauth-client-credentials/poetry.lock diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/pyproject.toml b/seed/python-sdk/oauth-client-credentials/pyproject.toml similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/pyproject.toml rename to seed/python-sdk/oauth-client-credentials/pyproject.toml diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/reference.md b/seed/python-sdk/oauth-client-credentials/reference.md similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/reference.md rename to seed/python-sdk/oauth-client-credentials/reference.md diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/requirements.txt b/seed/python-sdk/oauth-client-credentials/requirements.txt similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/requirements.txt rename to seed/python-sdk/oauth-client-credentials/requirements.txt diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/snippet.json b/seed/python-sdk/oauth-client-credentials/snippet.json similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/snippet.json rename to seed/python-sdk/oauth-client-credentials/snippet.json diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/auth/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/auth/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/auth/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/auth/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/auth/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/raw_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/auth/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/raw_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/auth/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/types/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/auth/types/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/types/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/auth/types/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/types/token_response.py b/seed/python-sdk/oauth-client-credentials/src/seed/auth/types/token_response.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/auth/types/token_response.py rename to seed/python-sdk/oauth-client-credentials/src/seed/auth/types/token_response.py diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/token-override/src/seed/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/api_error.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/api_error.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/api_error.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/api_error.py diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/client_wrapper.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/client_wrapper.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/core/client_wrapper.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/client_wrapper.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/datetime_utils.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/datetime_utils.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/datetime_utils.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/datetime_utils.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/file.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/file.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/file.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/file.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/force_multipart.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/force_multipart.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/force_multipart.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/force_multipart.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_response.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_response.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_response.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_response.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_api.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_api.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_api.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_api.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_decoders.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_decoders.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_decoders.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_decoders.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_exceptions.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_exceptions.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_exceptions.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_exceptions.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_models.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_models.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/http_sse/_models.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/http_sse/_models.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/jsonable_encoder.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/jsonable_encoder.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/jsonable_encoder.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/jsonable_encoder.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/oauth_token_provider.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/oauth_token_provider.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/oauth_token_provider.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/oauth_token_provider.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/pydantic_utilities.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/pydantic_utilities.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/pydantic_utilities.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/query_encoder.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/query_encoder.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/query_encoder.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/query_encoder.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/remove_none_from_dict.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/remove_none_from_dict.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/remove_none_from_dict.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/request_options.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/request_options.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/request_options.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/request_options.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/serialization.py b/seed/python-sdk/oauth-client-credentials/src/seed/core/serialization.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/core/serialization.py rename to seed/python-sdk/oauth-client-credentials/src/seed/core/serialization.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested/api/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested/api/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested/api/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested/api/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested/api/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/raw_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested/api/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/api/raw_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested/api/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/raw_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested/raw_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/api/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/api/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/api/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/nested_no_auth/api/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/api/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/raw_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/api/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/api/raw_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/api/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/raw_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/nested_no_auth/raw_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/nested_no_auth/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/py.typed b/seed/python-sdk/oauth-client-credentials/src/seed/py.typed similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/py.typed rename to seed/python-sdk/oauth-client-credentials/src/seed/py.typed diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/__init__.py b/seed/python-sdk/oauth-client-credentials/src/seed/simple/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/__init__.py rename to seed/python-sdk/oauth-client-credentials/src/seed/simple/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/client.py b/seed/python-sdk/oauth-client-credentials/src/seed/simple/client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/simple/client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/simple/client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/raw_client.py b/seed/python-sdk/oauth-client-credentials/src/seed/simple/raw_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/src/seed/simple/raw_client.py rename to seed/python-sdk/oauth-client-credentials/src/seed/simple/raw_client.py diff --git a/seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/version.py b/seed/python-sdk/oauth-client-credentials/src/seed/version.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials/no-custom-config/src/seed/version.py rename to seed/python-sdk/oauth-client-credentials/src/seed/version.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/custom/test_client.py b/seed/python-sdk/oauth-client-credentials/tests/custom/test_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/custom/test_client.py rename to seed/python-sdk/oauth-client-credentials/tests/custom/test_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/__init__.py b/seed/python-sdk/oauth-client-credentials/tests/utils/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/__init__.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/__init__.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/__init__.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/__init__.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/__init__.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/circle.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/circle.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/circle.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/circle.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/color.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/color.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/color.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/color.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/object_with_defaults.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/object_with_defaults.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/object_with_defaults.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/object_with_optional_field.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/object_with_optional_field.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/object_with_optional_field.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/shape.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/shape.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/shape.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/shape.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/square.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/square.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/square.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/square.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/undiscriminated_shape.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/assets/models/undiscriminated_shape.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/assets/models/undiscriminated_shape.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/test_http_client.py b/seed/python-sdk/oauth-client-credentials/tests/utils/test_http_client.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/test_http_client.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/test_http_client.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/test_query_encoding.py b/seed/python-sdk/oauth-client-credentials/tests/utils/test_query_encoding.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/test_query_encoding.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/test_query_encoding.py diff --git a/seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/test_serialization.py b/seed/python-sdk/oauth-client-credentials/tests/utils/test_serialization.py similarity index 100% rename from seed/python-sdk/oauth-client-credentials-environment-variables/token-override/tests/utils/test_serialization.py rename to seed/python-sdk/oauth-client-credentials/tests/utils/test_serialization.py diff --git a/seed/python-sdk/oauth-client-credentials/token-override/.fern/metadata.json b/seed/python-sdk/oauth-client-credentials/token-override/.fern/metadata.json deleted file mode 100644 index 04a9803bb4f3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/.fern/metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "cliVersion": "DUMMY", - "generatorName": "fernapi/fern-python-sdk", - "generatorVersion": "latest", - "generatorConfig": { - "oauth-token-override": true - } -} \ No newline at end of file diff --git a/seed/python-sdk/oauth-client-credentials/token-override/.github/workflows/ci.yml b/seed/python-sdk/oauth-client-credentials/token-override/.github/workflows/ci.yml deleted file mode 100644 index ffd2d8acab24..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/.github/workflows/ci.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: ci -on: [push] -jobs: - compile: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Compile - run: poetry run mypy . - test: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - - name: Test - run: poetry run pytest -rP -n auto . - - publish: - needs: [compile, test] - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Set up python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Bootstrap poetry - run: | - curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 - - name: Install dependencies - run: poetry install - - name: Publish to pypi - run: | - poetry config repositories.remote - poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD" - env: - PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/seed/python-sdk/oauth-client-credentials/token-override/.gitignore b/seed/python-sdk/oauth-client-credentials/token-override/.gitignore deleted file mode 100644 index d2e4ca808d21..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.mypy_cache/ -.ruff_cache/ -__pycache__/ -dist/ -poetry.toml diff --git a/seed/python-sdk/oauth-client-credentials/token-override/poetry.lock b/seed/python-sdk/oauth-client-credentials/token-override/poetry.lock deleted file mode 100644 index 9decbf87e177..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/poetry.lock +++ /dev/null @@ -1,594 +0,0 @@ -# This file is automatically @generated by Poetry 1.8.5 and should not be changed by hand. - -[[package]] -name = "annotated-types" -version = "0.7.0" -description = "Reusable constraint types to use with typing.Annotated" -optional = false -python-versions = ">=3.8" -files = [ - {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, - {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - -[[package]] -name = "anyio" -version = "4.5.2" -description = "High level compatibility layer for multiple asynchronous event loop implementations" -optional = false -python-versions = ">=3.8" -files = [ - {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, - {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, -] - -[package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} -idna = ">=2.8" -sniffio = ">=1.1" -typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} - -[package.extras] -doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] -trio = ["trio (>=0.26.1)"] - -[[package]] -name = "certifi" -version = "2025.11.12" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.7" -files = [ - {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"}, - {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"}, -] - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "exceptiongroup" -version = "1.3.1" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, - {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "execnet" -version = "2.1.2" -description = "execnet: rapid multi-Python deployment" -optional = false -python-versions = ">=3.8" -files = [ - {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"}, - {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"}, -] - -[package.extras] -testing = ["hatch", "pre-commit", "pytest", "tox"] - -[[package]] -name = "h11" -version = "0.16.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -optional = false -python-versions = ">=3.8" -files = [ - {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, - {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -description = "A minimal low-level HTTP client." -optional = false -python-versions = ">=3.8" -files = [ - {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, - {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, -] - -[package.dependencies] -certifi = "*" -h11 = ">=0.16" - -[package.extras] -asyncio = ["anyio (>=4.0,<5.0)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -trio = ["trio (>=0.22.0,<1.0)"] - -[[package]] -name = "httpx" -version = "0.28.1" -description = "The next generation HTTP client." -optional = false -python-versions = ">=3.8" -files = [ - {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, - {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, -] - -[package.dependencies] -anyio = "*" -certifi = "*" -httpcore = "==1.*" -idna = "*" - -[package.extras] -brotli = ["brotli", "brotlicffi"] -cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] -http2 = ["h2 (>=3,<5)"] -socks = ["socksio (==1.*)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "idna" -version = "3.11" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.8" -files = [ - {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, - {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, -] - -[package.extras] -all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] - -[[package]] -name = "iniconfig" -version = "2.1.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.8" -files = [ - {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, - {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, -] - -[[package]] -name = "mypy" -version = "1.13.0" -description = "Optional static typing for Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, - {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, - {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, - {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, - {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, - {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, - {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, - {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, - {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, - {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, - {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, - {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, - {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, - {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, - {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, - {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, - {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, - {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, - {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, - {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, - {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, - {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, - {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, - {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, - {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, - {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, - {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, -] - -[package.dependencies] -mypy-extensions = ">=1.0.0" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.6.0" - -[package.extras] -dmypy = ["psutil (>=4.0)"] -faster-cache = ["orjson"] -install-types = ["pip"] -mypyc = ["setuptools (>=50)"] -reports = ["lxml"] - -[[package]] -name = "mypy-extensions" -version = "1.1.0" -description = "Type system extensions for programs checked with the mypy type checker." -optional = false -python-versions = ">=3.8" -files = [ - {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, - {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, -] - -[[package]] -name = "packaging" -version = "25.0" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, - {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, -] - -[[package]] -name = "pluggy" -version = "1.5.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, - {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pydantic" -version = "2.10.6" -description = "Data validation using Python type hints" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, - {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, -] - -[package.dependencies] -annotated-types = ">=0.6.0" -pydantic-core = "2.27.2" -typing-extensions = ">=4.12.2" - -[package.extras] -email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] - -[[package]] -name = "pydantic-core" -version = "2.27.2" -description = "Core functionality for Pydantic validation and serialization" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, - {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, - {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, - {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, - {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, - {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, - {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, - {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, - {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, - {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, - {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, - {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, - {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, - {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, - {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, - {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, - {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, - {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, - {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, - {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, - {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, - {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, - {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, - {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, - {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, - {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, -] - -[package.dependencies] -typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" - -[[package]] -name = "pytest" -version = "7.4.4" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} - -[package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytest-asyncio" -version = "0.23.8" -description = "Pytest support for asyncio" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"}, - {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"}, -] - -[package.dependencies] -pytest = ">=7.0.0,<9" - -[package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] -testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] - -[[package]] -name = "pytest-xdist" -version = "3.6.1" -description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, - {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, -] - -[package.dependencies] -execnet = ">=2.1" -pytest = ">=7.0.0" - -[package.extras] -psutil = ["psutil (>=3.0)"] -setproctitle = ["setproctitle"] -testing = ["filelock"] - -[[package]] -name = "python-dateutil" -version = "2.9.0.post0" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, - {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "ruff" -version = "0.11.5" -description = "An extremely fast Python linter and code formatter, written in Rust." -optional = false -python-versions = ">=3.7" -files = [ - {file = "ruff-0.11.5-py3-none-linux_armv6l.whl", hash = "sha256:2561294e108eb648e50f210671cc56aee590fb6167b594144401532138c66c7b"}, - {file = "ruff-0.11.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:ac12884b9e005c12d0bd121f56ccf8033e1614f736f766c118ad60780882a077"}, - {file = "ruff-0.11.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:4bfd80a6ec559a5eeb96c33f832418bf0fb96752de0539905cf7b0cc1d31d779"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0947c0a1afa75dcb5db4b34b070ec2bccee869d40e6cc8ab25aca11a7d527794"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad871ff74b5ec9caa66cb725b85d4ef89b53f8170f47c3406e32ef040400b038"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e6cf918390cfe46d240732d4d72fa6e18e528ca1f60e318a10835cf2fa3dc19f"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56145ee1478582f61c08f21076dc59153310d606ad663acc00ea3ab5b2125f82"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e5f66f8f1e8c9fc594cbd66fbc5f246a8d91f916cb9667e80208663ec3728304"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80b4df4d335a80315ab9afc81ed1cff62be112bd165e162b5eed8ac55bfc8470"}, - {file = "ruff-0.11.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3068befab73620b8a0cc2431bd46b3cd619bc17d6f7695a3e1bb166b652c382a"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f5da2e710a9641828e09aa98b92c9ebbc60518fdf3921241326ca3e8f8e55b8b"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ef39f19cb8ec98cbc762344921e216f3857a06c47412030374fffd413fb8fd3a"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:b2a7cedf47244f431fd11aa5a7e2806dda2e0c365873bda7834e8f7d785ae159"}, - {file = "ruff-0.11.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:81be52e7519f3d1a0beadcf8e974715b2dfc808ae8ec729ecfc79bddf8dbb783"}, - {file = "ruff-0.11.5-py3-none-win32.whl", hash = "sha256:e268da7b40f56e3eca571508a7e567e794f9bfcc0f412c4b607931d3af9c4afe"}, - {file = "ruff-0.11.5-py3-none-win_amd64.whl", hash = "sha256:6c6dc38af3cfe2863213ea25b6dc616d679205732dc0fb673356c2d69608f800"}, - {file = "ruff-0.11.5-py3-none-win_arm64.whl", hash = "sha256:67e241b4314f4eacf14a601d586026a962f4002a475aa702c69980a38087aa4e"}, - {file = "ruff-0.11.5.tar.gz", hash = "sha256:cae2e2439cb88853e421901ec040a758960b576126dab520fa08e9de431d1bef"}, -] - -[[package]] -name = "six" -version = "1.17.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, - {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, -] - -[[package]] -name = "sniffio" -version = "1.3.1" -description = "Sniff out which async library your code is running under" -optional = false -python-versions = ">=3.7" -files = [ - {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, - {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, -] - -[[package]] -name = "tomli" -version = "2.3.0" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.8" -files = [ - {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, - {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf"}, - {file = "tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845"}, - {file = "tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c"}, - {file = "tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456"}, - {file = "tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac"}, - {file = "tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f"}, - {file = "tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8"}, - {file = "tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6"}, - {file = "tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876"}, - {file = "tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b"}, - {file = "tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b"}, - {file = "tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f"}, - {file = "tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05"}, - {file = "tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606"}, - {file = "tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e"}, - {file = "tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc"}, - {file = "tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879"}, - {file = "tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005"}, - {file = "tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463"}, - {file = "tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77"}, - {file = "tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530"}, - {file = "tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67"}, - {file = "tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f"}, - {file = "tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0"}, - {file = "tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba"}, - {file = "tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b"}, - {file = "tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549"}, -] - -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20241206" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -files = [ - {file = "types_python_dateutil-2.9.0.20241206-py3-none-any.whl", hash = "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53"}, - {file = "types_python_dateutil-2.9.0.20241206.tar.gz", hash = "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb"}, -] - -[[package]] -name = "typing-extensions" -version = "4.13.2" -description = "Backported and Experimental Type Hints for Python 3.8+" -optional = false -python-versions = ">=3.8" -files = [ - {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, - {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, -] - -[metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "bcf31a142c86d9e556553c8c260a93b563ac64a043076dbd48b26111d422c26e" diff --git a/seed/python-sdk/oauth-client-credentials/token-override/pyproject.toml b/seed/python-sdk/oauth-client-credentials/token-override/pyproject.toml deleted file mode 100644 index e56941b5f10d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/pyproject.toml +++ /dev/null @@ -1,91 +0,0 @@ -[project] -name = "fern_oauth-client-credentials" -dynamic = ["version"] - -[tool.poetry] -name = "fern_oauth-client-credentials" -version = "0.0.1" -description = "" -readme = "README.md" -authors = [] -keywords = [ - "fern", - "test" -] - -classifiers = [ - "Intended Audience :: Developers", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Operating System :: OS Independent", - "Operating System :: POSIX", - "Operating System :: MacOS", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed" -] -packages = [ - { include = "seed", from = "src"} -] - -[tool.poetry.urls] -Documentation = 'https://buildwithfern.com/learn' -Homepage = 'https://buildwithfern.com/' -Repository = 'https://github.com/oauth-client-credentials/fern' - -[tool.poetry.dependencies] -python = "^3.8" -httpx = ">=0.21.2" -pydantic = ">= 1.9.2" -pydantic-core = ">=2.18.2" -typing_extensions = ">= 4.0.0" - -[tool.poetry.group.dev.dependencies] -mypy = "==1.13.0" -pytest = "^7.4.0" -pytest-asyncio = "^0.23.5" -pytest-xdist = "^3.6.1" -python-dateutil = "^2.9.0" -types-python-dateutil = "^2.9.0.20240316" -ruff = "==0.11.5" - -[tool.pytest.ini_options] -testpaths = [ "tests" ] -asyncio_mode = "auto" - -[tool.mypy] -plugins = ["pydantic.mypy"] - -[tool.ruff] -line-length = 120 - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors - "F", # pyflakes - "I", # isort -] -ignore = [ - "E402", # Module level import not at top of file - "E501", # Line too long - "E711", # Comparison to `None` should be `cond is not None` - "E712", # Avoid equality comparisons to `True`; use `if ...:` checks - "E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks - "E722", # Do not use bare `except` - "E731", # Do not assign a `lambda` expression, use a `def` - "F821", # Undefined name - "F841" # Local variable ... is assigned to but never used -] - -[tool.ruff.lint.isort] -section-order = ["future", "standard-library", "third-party", "first-party"] - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" diff --git a/seed/python-sdk/oauth-client-credentials/token-override/reference.md b/seed/python-sdk/oauth-client-credentials/token-override/reference.md deleted file mode 100644 index 1345df8e76cf..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/reference.md +++ /dev/null @@ -1,310 +0,0 @@ -# Reference -## Auth -
client.auth.get_token_with_client_credentials(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.auth.get_token_with_client_credentials( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - scope="read:users", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**client_id:** `str` - -
-
- -
-
- -**client_secret:** `str` - -
-
- -
-
- -**scope:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -
client.auth.refresh_token(...) -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.auth.refresh_token( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - refresh_token="refresh_token", - scope="read:users", -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**client_id:** `str` - -
-
- -
-
- -**client_secret:** `str` - -
-
- -
-
- -**refresh_token:** `str` - -
-
- -
-
- -**scope:** `typing.Optional[str]` - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## NestedNoAuth Api -
client.nested_no_auth.api.get_something() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.nested_no_auth.api.get_something() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Nested Api -
client.nested.api.get_something() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.nested.api.get_something() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- -## Simple -
client.simple.get_something() -
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from seed import SeedOauthClientCredentials - -client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", -) -client.simple.get_something() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
-
-
- - -
-
-
- diff --git a/seed/python-sdk/oauth-client-credentials/token-override/requirements.txt b/seed/python-sdk/oauth-client-credentials/token-override/requirements.txt deleted file mode 100644 index e80f640a2e74..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -httpx>=0.21.2 -pydantic>= 1.9.2 -pydantic-core>=2.18.2 -typing_extensions>= 4.0.0 diff --git a/seed/python-sdk/oauth-client-credentials/token-override/snippet.json b/seed/python-sdk/oauth-client-credentials/token-override/snippet.json deleted file mode 100644 index 5bb5c3b9a99c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/snippet.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "types": {}, - "endpoints": [ - { - "example_identifier": "default", - "id": { - "path": "/token", - "method": "POST", - "identifier_override": "endpoint_auth.getTokenWithClientCredentials" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentials\n\nclient = SeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.auth.get_token_with_client_credentials(\n client_id=\"my_oauth_app_123\",\n client_secret=\"sk_live_abcdef123456789\",\n scope=\"read:users\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentials\n\nclient = AsyncSeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.auth.get_token_with_client_credentials(\n client_id=\"my_oauth_app_123\",\n client_secret=\"sk_live_abcdef123456789\",\n scope=\"read:users\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/token", - "method": "POST", - "identifier_override": "endpoint_auth.refreshToken" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentials\n\nclient = SeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.auth.refresh_token(\n client_id=\"my_oauth_app_123\",\n client_secret=\"sk_live_abcdef123456789\",\n refresh_token=\"refresh_token\",\n scope=\"read:users\",\n)\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentials\n\nclient = AsyncSeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.auth.refresh_token(\n client_id=\"my_oauth_app_123\",\n client_secret=\"sk_live_abcdef123456789\",\n refresh_token=\"refresh_token\",\n scope=\"read:users\",\n )\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/nested-no-auth/get-something", - "method": "GET", - "identifier_override": "endpoint_nested-no-auth/api.getSomething" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentials\n\nclient = SeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.nested_no_auth.api.get_something()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentials\n\nclient = AsyncSeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.nested_no_auth.api.get_something()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/nested/get-something", - "method": "GET", - "identifier_override": "endpoint_nested/api.getSomething" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentials\n\nclient = SeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.nested.api.get_something()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentials\n\nclient = AsyncSeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.nested.api.get_something()\n\n\nasyncio.run(main())\n", - "type": "python" - } - }, - { - "example_identifier": "default", - "id": { - "path": "/get-something", - "method": "GET", - "identifier_override": "endpoint_simple.getSomething" - }, - "snippet": { - "sync_client": "from seed import SeedOauthClientCredentials\n\nclient = SeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\nclient.simple.get_something()\n", - "async_client": "import asyncio\n\nfrom seed import AsyncSeedOauthClientCredentials\n\nclient = AsyncSeedOauthClientCredentials(\n base_url=\"https://yourhost.com/path/to/api\",\n client_id=\"YOUR_CLIENT_ID\",\n client_secret=\"YOUR_CLIENT_SECRET\",\n)\n\n\nasync def main() -> None:\n await client.simple.get_something()\n\n\nasyncio.run(main())\n", - "type": "python" - } - } - ] -} \ No newline at end of file diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/__init__.py deleted file mode 100644 index 0ad9c226d668..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/__init__.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import auth, nested, nested_no_auth, simple - from .auth import TokenResponse - from .client import AsyncSeedOauthClientCredentials, SeedOauthClientCredentials - from .version import __version__ -_dynamic_imports: typing.Dict[str, str] = { - "AsyncSeedOauthClientCredentials": ".client", - "SeedOauthClientCredentials": ".client", - "TokenResponse": ".auth", - "__version__": ".version", - "auth": ".auth", - "nested": ".nested", - "nested_no_auth": ".nested_no_auth", - "simple": ".simple", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "AsyncSeedOauthClientCredentials", - "SeedOauthClientCredentials", - "TokenResponse", - "__version__", - "auth", - "nested", - "nested_no_auth", - "simple", -] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/__init__.py deleted file mode 100644 index 687d87d84895..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .types import TokenResponse -_dynamic_imports: typing.Dict[str, str] = {"TokenResponse": ".types"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["TokenResponse"] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/client.py deleted file mode 100644 index 1fe50a6357b0..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/client.py +++ /dev/null @@ -1,251 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from .raw_client import AsyncRawAuthClient, RawAuthClient -from .types.token_response import TokenResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class AuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawAuthClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawAuthClient - """ - return self._raw_client - - def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - from seed import SeedOauthClientCredentials - - client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.auth.get_token_with_client_credentials( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - scope="read:users", - ) - """ - _response = self._raw_client.get_token_with_client_credentials( - client_id=client_id, client_secret=client_secret, scope=scope, request_options=request_options - ) - return _response.data - - def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - from seed import SeedOauthClientCredentials - - client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.auth.refresh_token( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - refresh_token="refresh_token", - scope="read:users", - ) - """ - _response = self._raw_client.refresh_token( - client_id=client_id, - client_secret=client_secret, - refresh_token=refresh_token, - scope=scope, - request_options=request_options, - ) - return _response.data - - -class AsyncAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawAuthClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawAuthClient - """ - return self._raw_client - - async def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentials - - client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.auth.get_token_with_client_credentials( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - scope="read:users", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_token_with_client_credentials( - client_id=client_id, client_secret=client_secret, scope=scope, request_options=request_options - ) - return _response.data - - async def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> TokenResponse: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - TokenResponse - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentials - - client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.auth.refresh_token( - client_id="my_oauth_app_123", - client_secret="sk_live_abcdef123456789", - refresh_token="refresh_token", - scope="read:users", - ) - - - asyncio.run(main()) - """ - _response = await self._raw_client.refresh_token( - client_id=client_id, - client_secret=client_secret, - refresh_token=refresh_token, - scope=scope, - request_options=request_options, - ) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/raw_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/raw_client.py deleted file mode 100644 index e4209e426fc7..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/raw_client.py +++ /dev/null @@ -1,240 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.pydantic_utilities import parse_obj_as -from ..core.request_options import RequestOptions -from .types.token_response import TokenResponse - -# this is used as the default value for optional parameters -OMIT = typing.cast(typing.Any, ...) - - -class RawAuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TokenResponse] - """ - _response = self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "client_credentials", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> HttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[TokenResponse] - """ - _response = self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "refresh_token": refresh_token, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "refresh_token", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return HttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_token_with_client_credentials( - self, - *, - client_id: str, - client_secret: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TokenResponse] - """ - _response = await self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "client_credentials", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - async def refresh_token( - self, - *, - client_id: str, - client_secret: str, - refresh_token: str, - scope: typing.Optional[str] = OMIT, - request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncHttpResponse[TokenResponse]: - """ - Parameters - ---------- - client_id : str - - client_secret : str - - refresh_token : str - - scope : typing.Optional[str] - - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[TokenResponse] - """ - _response = await self._client_wrapper.httpx_client.request( - "token", - method="POST", - json={ - "client_id": client_id, - "client_secret": client_secret, - "refresh_token": refresh_token, - "scope": scope, - "audience": "https://api.example.com", - "grant_type": "refresh_token", - }, - request_options=request_options, - omit=OMIT, - ) - try: - if 200 <= _response.status_code < 300: - _data = typing.cast( - TokenResponse, - parse_obj_as( - type_=TokenResponse, # type: ignore - object_=_response.json(), - ), - ) - return AsyncHttpResponse(response=_response, data=_data) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/types/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/types/__init__.py deleted file mode 100644 index 846044624065..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/types/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .token_response import TokenResponse -_dynamic_imports: typing.Dict[str, str] = {"TokenResponse": ".token_response"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["TokenResponse"] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/types/token_response.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/types/token_response.py deleted file mode 100644 index 27eeca677e12..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/auth/types/token_response.py +++ /dev/null @@ -1,25 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import pydantic -from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel - - -class TokenResponse(UniversalBaseModel): - """ - An OAuth token response. - """ - - access_token: str - expires_in: int - refresh_token: typing.Optional[str] = None - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/__init__.py deleted file mode 100644 index 9a33e233875e..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/__init__.py +++ /dev/null @@ -1,105 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from .api_error import ApiError - from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper - from .datetime_utils import serialize_datetime - from .file import File, convert_file_dict_to_httpx_tuples, with_content_type - from .http_client import AsyncHttpClient, HttpClient - from .http_response import AsyncHttpResponse, HttpResponse - from .jsonable_encoder import jsonable_encoder - from .pydantic_utilities import ( - IS_PYDANTIC_V2, - UniversalBaseModel, - UniversalRootModel, - parse_obj_as, - universal_field_validator, - universal_root_validator, - update_forward_refs, - ) - from .query_encoder import encode_query - from .remove_none_from_dict import remove_none_from_dict - from .request_options import RequestOptions - from .serialization import FieldMetadata, convert_and_respect_annotation_metadata -_dynamic_imports: typing.Dict[str, str] = { - "ApiError": ".api_error", - "AsyncClientWrapper": ".client_wrapper", - "AsyncHttpClient": ".http_client", - "AsyncHttpResponse": ".http_response", - "BaseClientWrapper": ".client_wrapper", - "FieldMetadata": ".serialization", - "File": ".file", - "HttpClient": ".http_client", - "HttpResponse": ".http_response", - "IS_PYDANTIC_V2": ".pydantic_utilities", - "RequestOptions": ".request_options", - "SyncClientWrapper": ".client_wrapper", - "UniversalBaseModel": ".pydantic_utilities", - "UniversalRootModel": ".pydantic_utilities", - "convert_and_respect_annotation_metadata": ".serialization", - "convert_file_dict_to_httpx_tuples": ".file", - "encode_query": ".query_encoder", - "jsonable_encoder": ".jsonable_encoder", - "parse_obj_as": ".pydantic_utilities", - "remove_none_from_dict": ".remove_none_from_dict", - "serialize_datetime": ".datetime_utils", - "universal_field_validator": ".pydantic_utilities", - "universal_root_validator": ".pydantic_utilities", - "update_forward_refs": ".pydantic_utilities", - "with_content_type": ".file", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = [ - "ApiError", - "AsyncClientWrapper", - "AsyncHttpClient", - "AsyncHttpResponse", - "BaseClientWrapper", - "FieldMetadata", - "File", - "HttpClient", - "HttpResponse", - "IS_PYDANTIC_V2", - "RequestOptions", - "SyncClientWrapper", - "UniversalBaseModel", - "UniversalRootModel", - "convert_and_respect_annotation_metadata", - "convert_file_dict_to_httpx_tuples", - "encode_query", - "jsonable_encoder", - "parse_obj_as", - "remove_none_from_dict", - "serialize_datetime", - "universal_field_validator", - "universal_root_validator", - "update_forward_refs", - "with_content_type", -] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/api_error.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/api_error.py deleted file mode 100644 index 6f850a60cba3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/api_error.py +++ /dev/null @@ -1,23 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Optional - - -class ApiError(Exception): - headers: Optional[Dict[str, str]] - status_code: Optional[int] - body: Any - - def __init__( - self, - *, - headers: Optional[Dict[str, str]] = None, - status_code: Optional[int] = None, - body: Any = None, - ) -> None: - self.headers = headers - self.status_code = status_code - self.body = body - - def __str__(self) -> str: - return f"headers: {self.headers}, status_code: {self.status_code}, body: {self.body}" diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/client_wrapper.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/client_wrapper.py deleted file mode 100644 index 59fb3f0e1e5a..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/client_wrapper.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -import httpx -from .http_client import AsyncHttpClient, HttpClient - - -class BaseClientWrapper: - def __init__( - self, - *, - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, - base_url: str, - timeout: typing.Optional[float] = None, - ): - self._token = token - self._headers = headers - self._base_url = base_url - self._timeout = timeout - - def get_headers(self) -> typing.Dict[str, str]: - headers: typing.Dict[str, str] = { - "User-Agent": "fern_oauth-client-credentials/0.0.1", - "X-Fern-Language": "Python", - "X-Fern-SDK-Name": "fern_oauth-client-credentials", - "X-Fern-SDK-Version": "0.0.1", - **(self.get_custom_headers() or {}), - } - token = self._get_token() - if token is not None: - headers["Authorization"] = f"Bearer {token}" - return headers - - def _get_token(self) -> typing.Optional[str]: - if isinstance(self._token, str) or self._token is None: - return self._token - else: - return self._token() - - def get_custom_headers(self) -> typing.Optional[typing.Dict[str, str]]: - return self._headers - - def get_base_url(self) -> str: - return self._base_url - - def get_timeout(self) -> typing.Optional[float]: - return self._timeout - - -class SyncClientWrapper(BaseClientWrapper): - def __init__( - self, - *, - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, - base_url: str, - timeout: typing.Optional[float] = None, - httpx_client: httpx.Client, - ): - super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout) - self.httpx_client = HttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_url=self.get_base_url, - ) - - -class AsyncClientWrapper(BaseClientWrapper): - def __init__( - self, - *, - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None, - headers: typing.Optional[typing.Dict[str, str]] = None, - base_url: str, - timeout: typing.Optional[float] = None, - async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None, - httpx_client: httpx.AsyncClient, - ): - super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout) - self._async_token = async_token - self.httpx_client = AsyncHttpClient( - httpx_client=httpx_client, - base_headers=self.get_headers, - base_timeout=self.get_timeout, - base_url=self.get_base_url, - async_base_headers=self.async_get_headers, - ) - - async def async_get_headers(self) -> typing.Dict[str, str]: - headers = self.get_headers() - if self._async_token is not None: - token = await self._async_token() - headers["Authorization"] = f"Bearer {token}" - return headers diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/datetime_utils.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/datetime_utils.py deleted file mode 100644 index 7c9864a944c2..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/datetime_utils.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt - - -def serialize_datetime(v: dt.datetime) -> str: - """ - Serialize a datetime including timezone info. - - Uses the timezone info provided if present, otherwise uses the current runtime's timezone info. - - UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00. - """ - - def _serialize_zoned_datetime(v: dt.datetime) -> str: - if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None): - # UTC is a special case where we use "Z" at the end instead of "+00:00" - return v.isoformat().replace("+00:00", "Z") - else: - # Delegate to the typical +/- offset format - return v.isoformat() - - if v.tzinfo is not None: - return _serialize_zoned_datetime(v) - else: - local_tz = dt.datetime.now().astimezone().tzinfo - localized_dt = v.replace(tzinfo=local_tz) - return _serialize_zoned_datetime(localized_dt) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/file.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/file.py deleted file mode 100644 index 44b0d27c0895..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/file.py +++ /dev/null @@ -1,67 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast - -# File typing inspired by the flexibility of types within the httpx library -# https://github.com/encode/httpx/blob/master/httpx/_types.py -FileContent = Union[IO[bytes], bytes, str] -File = Union[ - # file (or bytes) - FileContent, - # (filename, file (or bytes)) - Tuple[Optional[str], FileContent], - # (filename, file (or bytes), content_type) - Tuple[Optional[str], FileContent, Optional[str]], - # (filename, file (or bytes), content_type, headers) - Tuple[ - Optional[str], - FileContent, - Optional[str], - Mapping[str, str], - ], -] - - -def convert_file_dict_to_httpx_tuples( - d: Dict[str, Union[File, List[File]]], -) -> List[Tuple[str, File]]: - """ - The format we use is a list of tuples, where the first element is the - name of the file and the second is the file object. Typically HTTPX wants - a dict, but to be able to send lists of files, you have to use the list - approach (which also works for non-lists) - https://github.com/encode/httpx/pull/1032 - """ - - httpx_tuples = [] - for key, file_like in d.items(): - if isinstance(file_like, list): - for file_like_item in file_like: - httpx_tuples.append((key, file_like_item)) - else: - httpx_tuples.append((key, file_like)) - return httpx_tuples - - -def with_content_type(*, file: File, default_content_type: str) -> File: - """ - This function resolves to the file's content type, if provided, and defaults - to the default_content_type value if not. - """ - if isinstance(file, tuple): - if len(file) == 2: - filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore - return (filename, content, default_content_type) - elif len(file) == 3: - filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore - out_content_type = file_content_type or default_content_type - return (filename, content, out_content_type) - elif len(file) == 4: - filename, content, file_content_type, headers = cast( # type: ignore - Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file - ) - out_content_type = file_content_type or default_content_type - return (filename, content, out_content_type, headers) - else: - raise ValueError(f"Unexpected tuple length: {len(file)}") - return (None, file, default_content_type) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/force_multipart.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/force_multipart.py deleted file mode 100644 index 5440913fd4bc..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/force_multipart.py +++ /dev/null @@ -1,18 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict - - -class ForceMultipartDict(Dict[str, Any]): - """ - A dictionary subclass that always evaluates to True in boolean contexts. - - This is used to force multipart/form-data encoding in HTTP requests even when - the dictionary is empty, which would normally evaluate to False. - """ - - def __bool__(self) -> bool: - return True - - -FORCE_MULTIPART = ForceMultipartDict() diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_client.py deleted file mode 100644 index f4a7c0710387..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_client.py +++ /dev/null @@ -1,613 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import asyncio -import email.utils -import re -import time -import typing -import urllib.parse -from contextlib import asynccontextmanager, contextmanager -from random import random - -import httpx -from .file import File, convert_file_dict_to_httpx_tuples -from .force_multipart import FORCE_MULTIPART -from .jsonable_encoder import jsonable_encoder -from .query_encoder import encode_query -from .remove_none_from_dict import remove_none_from_dict as remove_none_from_dict -from .request_options import RequestOptions -from httpx._types import RequestFiles - -INITIAL_RETRY_DELAY_SECONDS = 1.0 -MAX_RETRY_DELAY_SECONDS = 60.0 -JITTER_FACTOR = 0.2 # 20% random jitter - - -def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]: - """ - This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait. - - Inspired by the urllib3 retry implementation. - """ - retry_after_ms = response_headers.get("retry-after-ms") - if retry_after_ms is not None: - try: - return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0 - except Exception: - pass - - retry_after = response_headers.get("retry-after") - if retry_after is None: - return None - - # Attempt to parse the header as an int. - if re.match(r"^\s*[0-9]+\s*$", retry_after): - seconds = float(retry_after) - # Fallback to parsing it as a date. - else: - retry_date_tuple = email.utils.parsedate_tz(retry_after) - if retry_date_tuple is None: - return None - if retry_date_tuple[9] is None: # Python 2 - # Assume UTC if no timezone was specified - # On Python2.7, parsedate_tz returns None for a timezone offset - # instead of 0 if no timezone is given, where mktime_tz treats - # a None timezone offset as local time. - retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:] - - retry_date = email.utils.mktime_tz(retry_date_tuple) - seconds = retry_date - time.time() - - if seconds < 0: - seconds = 0 - - return seconds - - -def _add_positive_jitter(delay: float) -> float: - """Add positive jitter (0-20%) to prevent thundering herd.""" - jitter_multiplier = 1 + random() * JITTER_FACTOR - return delay * jitter_multiplier - - -def _add_symmetric_jitter(delay: float) -> float: - """Add symmetric jitter (±10%) for exponential backoff.""" - jitter_multiplier = 1 + (random() - 0.5) * JITTER_FACTOR - return delay * jitter_multiplier - - -def _parse_x_ratelimit_reset(response_headers: httpx.Headers) -> typing.Optional[float]: - """ - Parse the X-RateLimit-Reset header (Unix timestamp in seconds). - Returns seconds to wait, or None if header is missing/invalid. - """ - reset_time_str = response_headers.get("x-ratelimit-reset") - if reset_time_str is None: - return None - - try: - reset_time = int(reset_time_str) - delay = reset_time - time.time() - if delay > 0: - return delay - except (ValueError, TypeError): - pass - - return None - - -def _retry_timeout(response: httpx.Response, retries: int) -> float: - """ - Determine the amount of time to wait before retrying a request. - This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff - with a jitter to determine the number of seconds to wait. - """ - - # 1. Check Retry-After header first - retry_after = _parse_retry_after(response.headers) - if retry_after is not None and retry_after > 0: - return min(retry_after, MAX_RETRY_DELAY_SECONDS) - - # 2. Check X-RateLimit-Reset header (with positive jitter) - ratelimit_reset = _parse_x_ratelimit_reset(response.headers) - if ratelimit_reset is not None: - return _add_positive_jitter(min(ratelimit_reset, MAX_RETRY_DELAY_SECONDS)) - - # 3. Fall back to exponential backoff (with symmetric jitter) - backoff = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS) - return _add_symmetric_jitter(backoff) - - -def _should_retry(response: httpx.Response) -> bool: - retryable_400s = [429, 408, 409] - return response.status_code >= 500 or response.status_code in retryable_400s - - -def _maybe_filter_none_from_multipart_data( - data: typing.Optional[typing.Any], - request_files: typing.Optional[RequestFiles], - force_multipart: typing.Optional[bool], -) -> typing.Optional[typing.Any]: - """ - Filter None values from data body for multipart/form requests. - This prevents httpx from converting None to empty strings in multipart encoding. - Only applies when files are present or force_multipart is True. - """ - if data is not None and isinstance(data, typing.Mapping) and (request_files or force_multipart): - return remove_none_from_dict(data) - return data - - -def remove_omit_from_dict( - original: typing.Dict[str, typing.Optional[typing.Any]], - omit: typing.Optional[typing.Any], -) -> typing.Dict[str, typing.Any]: - if omit is None: - return original - new: typing.Dict[str, typing.Any] = {} - for key, value in original.items(): - if value is not omit: - new[key] = value - return new - - -def maybe_filter_request_body( - data: typing.Optional[typing.Any], - request_options: typing.Optional[RequestOptions], - omit: typing.Optional[typing.Any], -) -> typing.Optional[typing.Any]: - if data is None: - return ( - jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} - if request_options is not None - else None - ) - elif not isinstance(data, typing.Mapping): - data_content = jsonable_encoder(data) - else: - data_content = { - **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore - **( - jsonable_encoder(request_options.get("additional_body_parameters", {})) or {} - if request_options is not None - else {} - ), - } - return data_content - - -# Abstracted out for testing purposes -def get_request_body( - *, - json: typing.Optional[typing.Any], - data: typing.Optional[typing.Any], - request_options: typing.Optional[RequestOptions], - omit: typing.Optional[typing.Any], -) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]: - json_body = None - data_body = None - if data is not None: - data_body = maybe_filter_request_body(data, request_options, omit) - else: - # If both data and json are None, we send json data in the event extra properties are specified - json_body = maybe_filter_request_body(json, request_options, omit) - - # If you have an empty JSON body, you should just send None - return (json_body if json_body != {} else None), data_body if data_body != {} else None - - -class HttpClient: - def __init__( - self, - *, - httpx_client: httpx.Client, - base_timeout: typing.Callable[[], typing.Optional[float]], - base_headers: typing.Callable[[], typing.Dict[str, str]], - base_url: typing.Optional[typing.Callable[[], str]] = None, - ): - self.base_url = base_url - self.base_timeout = base_timeout - self.base_headers = base_headers - self.httpx_client = httpx_client - - def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: - base_url = maybe_base_url - if self.base_url is not None and base_url is None: - base_url = self.base_url() - - if base_url is None: - raise ValueError("A base_url is required to make this request, please provide one and try again.") - return base_url - - def request( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> httpx.Response: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - response = self.httpx_client.request( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) or {} - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) - - max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 - if _should_retry(response=response): - if max_retries > retries: - time.sleep(_retry_timeout(response=response, retries=retries)) - return self.request( - path=path, - method=method, - base_url=base_url, - params=params, - json=json, - content=content, - files=files, - headers=headers, - request_options=request_options, - retries=retries + 1, - omit=omit, - ) - - return response - - @contextmanager - def stream( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> typing.Iterator[httpx.Response]: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - with self.httpx_client.stream( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **self.base_headers(), - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) as stream: - yield stream - - -class AsyncHttpClient: - def __init__( - self, - *, - httpx_client: httpx.AsyncClient, - base_timeout: typing.Callable[[], typing.Optional[float]], - base_headers: typing.Callable[[], typing.Dict[str, str]], - base_url: typing.Optional[typing.Callable[[], str]] = None, - async_base_headers: typing.Optional[typing.Callable[[], typing.Awaitable[typing.Dict[str, str]]]] = None, - ): - self.base_url = base_url - self.base_timeout = base_timeout - self.base_headers = base_headers - self.async_base_headers = async_base_headers - self.httpx_client = httpx_client - - async def _get_headers(self) -> typing.Dict[str, str]: - if self.async_base_headers is not None: - return await self.async_base_headers() - return self.base_headers() - - def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str: - base_url = maybe_base_url - if self.base_url is not None and base_url is None: - base_url = self.base_url() - - if base_url is None: - raise ValueError("A base_url is required to make this request, please provide one and try again.") - return base_url - - async def request( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> httpx.Response: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - # Get headers (supports async token providers) - _headers = await self._get_headers() - - # Add the input to each of these and do None-safety checks - response = await self.httpx_client.request( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **_headers, - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) or {} - if request_options is not None - else {} - ), - }, - omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) - - max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0 - if _should_retry(response=response): - if max_retries > retries: - await asyncio.sleep(_retry_timeout(response=response, retries=retries)) - return await self.request( - path=path, - method=method, - base_url=base_url, - params=params, - json=json, - content=content, - files=files, - headers=headers, - request_options=request_options, - retries=retries + 1, - omit=omit, - ) - return response - - @asynccontextmanager - async def stream( - self, - path: typing.Optional[str] = None, - *, - method: str, - base_url: typing.Optional[str] = None, - params: typing.Optional[typing.Dict[str, typing.Any]] = None, - json: typing.Optional[typing.Any] = None, - data: typing.Optional[typing.Any] = None, - content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None, - files: typing.Optional[ - typing.Union[ - typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]], - typing.List[typing.Tuple[str, File]], - ] - ] = None, - headers: typing.Optional[typing.Dict[str, typing.Any]] = None, - request_options: typing.Optional[RequestOptions] = None, - retries: int = 2, - omit: typing.Optional[typing.Any] = None, - force_multipart: typing.Optional[bool] = None, - ) -> typing.AsyncIterator[httpx.Response]: - base_url = self.get_base_url(base_url) - timeout = ( - request_options.get("timeout_in_seconds") - if request_options is not None and request_options.get("timeout_in_seconds") is not None - else self.base_timeout() - ) - - request_files: typing.Optional[RequestFiles] = ( - convert_file_dict_to_httpx_tuples(remove_omit_from_dict(remove_none_from_dict(files), omit)) - if (files is not None and files is not omit and isinstance(files, dict)) - else None - ) - - if (request_files is None or len(request_files) == 0) and force_multipart: - request_files = FORCE_MULTIPART - - json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit) - - data_body = _maybe_filter_none_from_multipart_data(data_body, request_files, force_multipart) - - # Get headers (supports async token providers) - _headers = await self._get_headers() - - async with self.httpx_client.stream( - method=method, - url=urllib.parse.urljoin(f"{base_url}/", path), - headers=jsonable_encoder( - remove_none_from_dict( - { - **_headers, - **(headers if headers is not None else {}), - **(request_options.get("additional_headers", {}) if request_options is not None else {}), - } - ) - ), - params=encode_query( - jsonable_encoder( - remove_none_from_dict( - remove_omit_from_dict( - { - **(params if params is not None else {}), - **( - request_options.get("additional_query_parameters", {}) - if request_options is not None - else {} - ), - }, - omit=omit, - ) - ) - ) - ), - json=json_body, - data=data_body, - content=content, - files=request_files, - timeout=timeout, - ) as stream: - yield stream diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_response.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_response.py deleted file mode 100644 index 2479747e8bb0..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_response.py +++ /dev/null @@ -1,55 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Dict, Generic, TypeVar - -import httpx - -# Generic to represent the underlying type of the data wrapped by the HTTP response. -T = TypeVar("T") - - -class BaseHttpResponse: - """Minimalist HTTP response wrapper that exposes response headers.""" - - _response: httpx.Response - - def __init__(self, response: httpx.Response): - self._response = response - - @property - def headers(self) -> Dict[str, str]: - return dict(self._response.headers) - - -class HttpResponse(Generic[T], BaseHttpResponse): - """HTTP response wrapper that exposes response headers and data.""" - - _data: T - - def __init__(self, response: httpx.Response, data: T): - super().__init__(response) - self._data = data - - @property - def data(self) -> T: - return self._data - - def close(self) -> None: - self._response.close() - - -class AsyncHttpResponse(Generic[T], BaseHttpResponse): - """HTTP response wrapper that exposes response headers and data.""" - - _data: T - - def __init__(self, response: httpx.Response, data: T): - super().__init__(response) - self._data = data - - @property - def data(self) -> T: - return self._data - - async def close(self) -> None: - await self._response.aclose() diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/__init__.py deleted file mode 100644 index 730e5a3382eb..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from ._api import EventSource, aconnect_sse, connect_sse - from ._exceptions import SSEError - from ._models import ServerSentEvent -_dynamic_imports: typing.Dict[str, str] = { - "EventSource": "._api", - "SSEError": "._exceptions", - "ServerSentEvent": "._models", - "aconnect_sse": "._api", - "connect_sse": "._api", -} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_api.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_api.py deleted file mode 100644 index f900b3b686de..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_api.py +++ /dev/null @@ -1,112 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import re -from contextlib import asynccontextmanager, contextmanager -from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast - -import httpx -from ._decoders import SSEDecoder -from ._exceptions import SSEError -from ._models import ServerSentEvent - - -class EventSource: - def __init__(self, response: httpx.Response) -> None: - self._response = response - - def _check_content_type(self) -> None: - content_type = self._response.headers.get("content-type", "").partition(";")[0] - if "text/event-stream" not in content_type: - raise SSEError( - f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" - ) - - def _get_charset(self) -> str: - """Extract charset from Content-Type header, fallback to UTF-8.""" - content_type = self._response.headers.get("content-type", "") - - # Parse charset parameter using regex - charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) - if charset_match: - charset = charset_match.group(1).strip("\"'") - # Validate that it's a known encoding - try: - # Test if the charset is valid by trying to encode/decode - "test".encode(charset).decode(charset) - return charset - except (LookupError, UnicodeError): - # If charset is invalid, fall back to UTF-8 - pass - - # Default to UTF-8 if no charset specified or invalid charset - return "utf-8" - - @property - def response(self) -> httpx.Response: - return self._response - - def iter_sse(self) -> Iterator[ServerSentEvent]: - self._check_content_type() - decoder = SSEDecoder() - charset = self._get_charset() - - buffer = "" - for chunk in self._response.iter_bytes(): - # Decode chunk using detected charset - text_chunk = chunk.decode(charset, errors="replace") - buffer += text_chunk - - # Process complete lines - while "\n" in buffer: - line, buffer = buffer.split("\n", 1) - line = line.rstrip("\r") - sse = decoder.decode(line) - # when we reach a "\n\n" => line = '' - # => decoder will attempt to return an SSE Event - if sse is not None: - yield sse - - # Process any remaining data in buffer - if buffer.strip(): - line = buffer.rstrip("\r") - sse = decoder.decode(line) - if sse is not None: - yield sse - - async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: - self._check_content_type() - decoder = SSEDecoder() - lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) - try: - async for line in lines: - line = line.rstrip("\n") - sse = decoder.decode(line) - if sse is not None: - yield sse - finally: - await lines.aclose() - - -@contextmanager -def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: - headers = kwargs.pop("headers", {}) - headers["Accept"] = "text/event-stream" - headers["Cache-Control"] = "no-store" - - with client.stream(method, url, headers=headers, **kwargs) as response: - yield EventSource(response) - - -@asynccontextmanager -async def aconnect_sse( - client: httpx.AsyncClient, - method: str, - url: str, - **kwargs: Any, -) -> AsyncIterator[EventSource]: - headers = kwargs.pop("headers", {}) - headers["Accept"] = "text/event-stream" - headers["Cache-Control"] = "no-store" - - async with client.stream(method, url, headers=headers, **kwargs) as response: - yield EventSource(response) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_decoders.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_decoders.py deleted file mode 100644 index 339b08901381..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_decoders.py +++ /dev/null @@ -1,61 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import List, Optional - -from ._models import ServerSentEvent - - -class SSEDecoder: - def __init__(self) -> None: - self._event = "" - self._data: List[str] = [] - self._last_event_id = "" - self._retry: Optional[int] = None - - def decode(self, line: str) -> Optional[ServerSentEvent]: - # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 - - if not line: - if not self._event and not self._data and not self._last_event_id and self._retry is None: - return None - - sse = ServerSentEvent( - event=self._event, - data="\n".join(self._data), - id=self._last_event_id, - retry=self._retry, - ) - - # NOTE: as per the SSE spec, do not reset last_event_id. - self._event = "" - self._data = [] - self._retry = None - - return sse - - if line.startswith(":"): - return None - - fieldname, _, value = line.partition(":") - - if value.startswith(" "): - value = value[1:] - - if fieldname == "event": - self._event = value - elif fieldname == "data": - self._data.append(value) - elif fieldname == "id": - if "\0" in value: - pass - else: - self._last_event_id = value - elif fieldname == "retry": - try: - self._retry = int(value) - except (TypeError, ValueError): - pass - else: - pass # Field is ignored. - - return None diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_exceptions.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_exceptions.py deleted file mode 100644 index 81605a8a65ed..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_exceptions.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import httpx - - -class SSEError(httpx.TransportError): - pass diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_models.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_models.py deleted file mode 100644 index 1af57f8fd0d2..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/http_sse/_models.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import json -from dataclasses import dataclass -from typing import Any, Optional - - -@dataclass(frozen=True) -class ServerSentEvent: - event: str = "message" - data: str = "" - id: str = "" - retry: Optional[int] = None - - def json(self) -> Any: - """Parse the data field as JSON.""" - return json.loads(self.data) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/jsonable_encoder.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/jsonable_encoder.py deleted file mode 100644 index afee3662d836..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/jsonable_encoder.py +++ /dev/null @@ -1,100 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -""" -jsonable_encoder converts a Python object to a JSON-friendly dict -(e.g. datetimes to strings, Pydantic models to dicts). - -Taken from FastAPI, and made a bit simpler -https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py -""" - -import base64 -import dataclasses -import datetime as dt -from enum import Enum -from pathlib import PurePath -from types import GeneratorType -from typing import Any, Callable, Dict, List, Optional, Set, Union - -import pydantic -from .datetime_utils import serialize_datetime -from .pydantic_utilities import ( - IS_PYDANTIC_V2, - encode_by_type, - to_jsonable_with_fallback, -) - -SetIntStr = Set[Union[int, str]] -DictIntStrAny = Dict[Union[int, str], Any] - - -def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any: - custom_encoder = custom_encoder or {} - if custom_encoder: - if type(obj) in custom_encoder: - return custom_encoder[type(obj)](obj) - else: - for encoder_type, encoder_instance in custom_encoder.items(): - if isinstance(obj, encoder_type): - return encoder_instance(obj) - if isinstance(obj, pydantic.BaseModel): - if IS_PYDANTIC_V2: - encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2 - else: - encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1 - if custom_encoder: - encoder.update(custom_encoder) - obj_dict = obj.dict(by_alias=True) - if "__root__" in obj_dict: - obj_dict = obj_dict["__root__"] - if "root" in obj_dict: - obj_dict = obj_dict["root"] - return jsonable_encoder(obj_dict, custom_encoder=encoder) - if dataclasses.is_dataclass(obj): - obj_dict = dataclasses.asdict(obj) # type: ignore - return jsonable_encoder(obj_dict, custom_encoder=custom_encoder) - if isinstance(obj, bytes): - return base64.b64encode(obj).decode("utf-8") - if isinstance(obj, Enum): - return obj.value - if isinstance(obj, PurePath): - return str(obj) - if isinstance(obj, (str, int, float, type(None))): - return obj - if isinstance(obj, dt.datetime): - return serialize_datetime(obj) - if isinstance(obj, dt.date): - return str(obj) - if isinstance(obj, dict): - encoded_dict = {} - allowed_keys = set(obj.keys()) - for key, value in obj.items(): - if key in allowed_keys: - encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder) - encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder) - encoded_dict[encoded_key] = encoded_value - return encoded_dict - if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)): - encoded_list = [] - for item in obj: - encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder)) - return encoded_list - - def fallback_serializer(o: Any) -> Any: - attempt_encode = encode_by_type(o) - if attempt_encode is not None: - return attempt_encode - - try: - data = dict(o) - except Exception as e: - errors: List[Exception] = [] - errors.append(e) - try: - data = vars(o) - except Exception as e: - errors.append(e) - raise ValueError(errors) from e - return jsonable_encoder(data, custom_encoder=custom_encoder) - - return to_jsonable_with_fallback(obj, fallback_serializer) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/oauth_token_provider.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/oauth_token_provider.py deleted file mode 100644 index f7af20ace10b..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/oauth_token_provider.py +++ /dev/null @@ -1,77 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import asyncio -import datetime as dt -import threading -import typing -from asyncio import Lock as asyncio_Lock -from threading import Lock as threading_Lock - -from ..auth.client import AsyncAuthClient, AuthClient -from .client_wrapper import AsyncClientWrapper, SyncClientWrapper - - -class OAuthTokenProvider: - BUFFER_IN_MINUTES = 2 - - def __init__(self, *, client_id: str, client_secret: str, client_wrapper: SyncClientWrapper): - self._client_id = client_id - self._client_secret = client_secret - self._access_token: typing.Optional[str] = None - self._expires_at: dt.datetime = dt.datetime.now() - self._auth_client = AuthClient(client_wrapper=client_wrapper) - self._lock: threading_Lock = threading.Lock() - - def get_token(self) -> str: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - with self._lock: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - return self._refresh() - - def _refresh(self) -> str: - token_response = self._auth_client.get_token_with_client_credentials( - client_id=self._client_id, client_secret=self._client_secret - ) - self._access_token = token_response.access_token - self._expires_at = self._get_expires_at( - expires_in_seconds=token_response.expires_in, buffer_in_minutes=self.BUFFER_IN_MINUTES - ) - return self._access_token - - def _get_expires_at(self, *, expires_in_seconds: int, buffer_in_minutes: int): - return dt.datetime.now() + dt.timedelta(seconds=expires_in_seconds) - dt.timedelta(minutes=buffer_in_minutes) - - -class AsyncOAuthTokenProvider: - BUFFER_IN_MINUTES = 2 - - def __init__(self, *, client_id: str, client_secret: str, client_wrapper: AsyncClientWrapper): - self._client_id = client_id - self._client_secret = client_secret - self._access_token: typing.Optional[str] = None - self._expires_at: dt.datetime = dt.datetime.now() - self._auth_client = AsyncAuthClient(client_wrapper=client_wrapper) - self._lock: asyncio_Lock = asyncio.Lock() - - async def get_token(self) -> str: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - async with self._lock: - if self._access_token and self._expires_at > dt.datetime.now(): - return self._access_token - return await self._refresh() - - async def _refresh(self) -> str: - token_response = await self._auth_client.get_token_with_client_credentials( - client_id=self._client_id, client_secret=self._client_secret - ) - self._access_token = token_response.access_token - self._expires_at = self._get_expires_at( - expires_in_seconds=token_response.expires_in, buffer_in_minutes=self.BUFFER_IN_MINUTES - ) - return self._access_token - - def _get_expires_at(self, *, expires_in_seconds: int, buffer_in_minutes: int): - return dt.datetime.now() + dt.timedelta(seconds=expires_in_seconds) - dt.timedelta(minutes=buffer_in_minutes) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/pydantic_utilities.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/pydantic_utilities.py deleted file mode 100644 index 185e5c4f64be..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/pydantic_utilities.py +++ /dev/null @@ -1,260 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# nopycln: file -import datetime as dt -from collections import defaultdict -from typing import Any, Callable, ClassVar, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast - -import pydantic - -IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.") - -if IS_PYDANTIC_V2: - from pydantic.v1.datetime_parse import parse_date as parse_date - from pydantic.v1.datetime_parse import parse_datetime as parse_datetime - from pydantic.v1.fields import ModelField as ModelField - from pydantic.v1.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[attr-defined] - from pydantic.v1.typing import get_args as get_args - from pydantic.v1.typing import get_origin as get_origin - from pydantic.v1.typing import is_literal_type as is_literal_type - from pydantic.v1.typing import is_union as is_union -else: - from pydantic.datetime_parse import parse_date as parse_date # type: ignore[no-redef] - from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore[no-redef] - from pydantic.fields import ModelField as ModelField # type: ignore[attr-defined, no-redef] - from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore[no-redef] - from pydantic.typing import get_args as get_args # type: ignore[no-redef] - from pydantic.typing import get_origin as get_origin # type: ignore[no-redef] - from pydantic.typing import is_literal_type as is_literal_type # type: ignore[no-redef] - from pydantic.typing import is_union as is_union # type: ignore[no-redef] - -from .datetime_utils import serialize_datetime -from .serialization import convert_and_respect_annotation_metadata -from typing_extensions import TypeAlias - -T = TypeVar("T") -Model = TypeVar("Model", bound=pydantic.BaseModel) - - -def parse_obj_as(type_: Type[T], object_: Any) -> T: - dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read") - if IS_PYDANTIC_V2: - adapter = pydantic.TypeAdapter(type_) # type: ignore[attr-defined] - return adapter.validate_python(dealiased_object) - return pydantic.parse_obj_as(type_, dealiased_object) - - -def to_jsonable_with_fallback(obj: Any, fallback_serializer: Callable[[Any], Any]) -> Any: - if IS_PYDANTIC_V2: - from pydantic_core import to_jsonable_python - - return to_jsonable_python(obj, fallback=fallback_serializer) - return fallback_serializer(obj) - - -class UniversalBaseModel(pydantic.BaseModel): - if IS_PYDANTIC_V2: - model_config: ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( # type: ignore[typeddict-unknown-key] - # Allow fields beginning with `model_` to be used in the model - protected_namespaces=(), - ) - - @pydantic.model_serializer(mode="plain", when_used="json") # type: ignore[attr-defined] - def serialize_model(self) -> Any: # type: ignore[name-defined] - serialized = self.dict() # type: ignore[attr-defined] - data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()} - return data - - else: - - class Config: - smart_union = True - json_encoders = {dt.datetime: serialize_datetime} - - @classmethod - def model_construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": - dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") - return cls.construct(_fields_set, **dealiased_object) - - @classmethod - def construct(cls: Type["Model"], _fields_set: Optional[Set[str]] = None, **values: Any) -> "Model": - dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read") - if IS_PYDANTIC_V2: - return super().model_construct(_fields_set, **dealiased_object) # type: ignore[misc] - return super().construct(_fields_set, **dealiased_object) - - def json(self, **kwargs: Any) -> str: - kwargs_with_defaults = { - "by_alias": True, - "exclude_unset": True, - **kwargs, - } - if IS_PYDANTIC_V2: - return super().model_dump_json(**kwargs_with_defaults) # type: ignore[misc] - return super().json(**kwargs_with_defaults) - - def dict(self, **kwargs: Any) -> Dict[str, Any]: - """ - Override the default dict method to `exclude_unset` by default. This function patches - `exclude_unset` to work include fields within non-None default values. - """ - # Note: the logic here is multiplexed given the levers exposed in Pydantic V1 vs V2 - # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice. - # - # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models - # that we have less control over, and this is less intrusive than custom serializers for now. - if IS_PYDANTIC_V2: - kwargs_with_defaults_exclude_unset = { - **kwargs, - "by_alias": True, - "exclude_unset": True, - "exclude_none": False, - } - kwargs_with_defaults_exclude_none = { - **kwargs, - "by_alias": True, - "exclude_none": True, - "exclude_unset": False, - } - dict_dump = deep_union_pydantic_dicts( - super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore[misc] - super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore[misc] - ) - - else: - _fields_set = self.__fields_set__.copy() - - fields = _get_model_fields(self.__class__) - for name, field in fields.items(): - if name not in _fields_set: - default = _get_field_default(field) - - # If the default values are non-null act like they've been set - # This effectively allows exclude_unset to work like exclude_none where - # the latter passes through intentionally set none values. - if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]): - _fields_set.add(name) - - if default is not None: - self.__fields_set__.add(name) - - kwargs_with_defaults_exclude_unset_include_fields = { - "by_alias": True, - "exclude_unset": True, - "include": _fields_set, - **kwargs, - } - - dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields) - - return cast( - Dict[str, Any], - convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write"), - ) - - -def _union_list_of_pydantic_dicts(source: List[Any], destination: List[Any]) -> List[Any]: - converted_list: List[Any] = [] - for i, item in enumerate(source): - destination_value = destination[i] - if isinstance(item, dict): - converted_list.append(deep_union_pydantic_dicts(item, destination_value)) - elif isinstance(item, list): - converted_list.append(_union_list_of_pydantic_dicts(item, destination_value)) - else: - converted_list.append(item) - return converted_list - - -def deep_union_pydantic_dicts(source: Dict[str, Any], destination: Dict[str, Any]) -> Dict[str, Any]: - for key, value in source.items(): - node = destination.setdefault(key, {}) - if isinstance(value, dict): - deep_union_pydantic_dicts(value, node) - # Note: we do not do this same processing for sets given we do not have sets of models - # and given the sets are unordered, the processing of the set and matching objects would - # be non-trivial. - elif isinstance(value, list): - destination[key] = _union_list_of_pydantic_dicts(value, node) - else: - destination[key] = value - - return destination - - -if IS_PYDANTIC_V2: - - class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore[misc, name-defined, type-arg] - pass - - UniversalRootModel: TypeAlias = V2RootModel # type: ignore[misc] -else: - UniversalRootModel: TypeAlias = UniversalBaseModel # type: ignore[misc, no-redef] - - -def encode_by_type(o: Any) -> Any: - encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple) - for type_, encoder in encoders_by_type.items(): - encoders_by_class_tuples[encoder] += (type_,) - - if type(o) in encoders_by_type: - return encoders_by_type[type(o)](o) - for encoder, classes_tuple in encoders_by_class_tuples.items(): - if isinstance(o, classes_tuple): - return encoder(o) - - -def update_forward_refs(model: Type["Model"], **localns: Any) -> None: - if IS_PYDANTIC_V2: - model.model_rebuild(raise_errors=False) # type: ignore[attr-defined] - else: - model.update_forward_refs(**localns) - - -# Mirrors Pydantic's internal typing -AnyCallable = Callable[..., Any] - - -def universal_root_validator( - pre: bool = False, -) -> Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - # In Pydantic v2, for RootModel we always use "before" mode - # The custom validators transform the input value before the model is created - return cast(AnyCallable, pydantic.model_validator(mode="before")(func)) # type: ignore[attr-defined] - return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] - - return decorator - - -def universal_field_validator(field_name: str, pre: bool = False) -> Callable[[AnyCallable], AnyCallable]: - def decorator(func: AnyCallable) -> AnyCallable: - if IS_PYDANTIC_V2: - return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined] - return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func)) - - return decorator - - -PydanticField = Union[ModelField, pydantic.fields.FieldInfo] - - -def _get_model_fields(model: Type["Model"]) -> Mapping[str, PydanticField]: - if IS_PYDANTIC_V2: - return cast(Mapping[str, PydanticField], model.model_fields) # type: ignore[attr-defined] - return cast(Mapping[str, PydanticField], model.__fields__) - - -def _get_field_default(field: PydanticField) -> Any: - try: - value = field.get_default() # type: ignore[union-attr] - except: - value = field.default - if IS_PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None - return value - return value diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/query_encoder.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/query_encoder.py deleted file mode 100644 index 3183001d4046..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/query_encoder.py +++ /dev/null @@ -1,58 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, List, Optional, Tuple - -import pydantic - - -# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict -def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]: - result = [] - for k, v in dict_flat.items(): - key = f"{key_prefix}[{k}]" if key_prefix is not None else k - if isinstance(v, dict): - result.extend(traverse_query_dict(v, key)) - elif isinstance(v, list): - for arr_v in v: - if isinstance(arr_v, dict): - result.extend(traverse_query_dict(arr_v, key)) - else: - result.append((key, arr_v)) - else: - result.append((key, v)) - return result - - -def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]: - if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict): - if isinstance(query_value, pydantic.BaseModel): - obj_dict = query_value.dict(by_alias=True) - else: - obj_dict = query_value - return traverse_query_dict(obj_dict, query_key) - elif isinstance(query_value, list): - encoded_values: List[Tuple[str, Any]] = [] - for value in query_value: - if isinstance(value, pydantic.BaseModel) or isinstance(value, dict): - if isinstance(value, pydantic.BaseModel): - obj_dict = value.dict(by_alias=True) - elif isinstance(value, dict): - obj_dict = value - - encoded_values.extend(single_query_encoder(query_key, obj_dict)) - else: - encoded_values.append((query_key, value)) - - return encoded_values - - return [(query_key, query_value)] - - -def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]: - if query is None: - return None - - encoded_query = [] - for k, v in query.items(): - encoded_query.extend(single_query_encoder(k, v)) - return encoded_query diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/remove_none_from_dict.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/remove_none_from_dict.py deleted file mode 100644 index c2298143f14a..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/remove_none_from_dict.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, Dict, Mapping, Optional - - -def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]: - new: Dict[str, Any] = {} - for key, value in original.items(): - if value is not None: - new[key] = value - return new diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/request_options.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/request_options.py deleted file mode 100644 index 1b38804432ba..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/request_options.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -try: - from typing import NotRequired # type: ignore -except ImportError: - from typing_extensions import NotRequired - - -class RequestOptions(typing.TypedDict, total=False): - """ - Additional options for request-specific configuration when calling APIs via the SDK. - This is used primarily as an optional final parameter for service functions. - - Attributes: - - timeout_in_seconds: int. The number of seconds to await an API call before timing out. - - - max_retries: int. The max number of retries to attempt if the API call fails. - - - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict - - - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict - - - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict - - - chunk_size: int. The size, in bytes, to process each chunk of data being streamed back within the response. This equates to leveraging `chunk_size` within `requests` or `httpx`, and is only leveraged for file downloads. - """ - - timeout_in_seconds: NotRequired[int] - max_retries: NotRequired[int] - additional_headers: NotRequired[typing.Dict[str, typing.Any]] - additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]] - additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]] - chunk_size: NotRequired[int] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/serialization.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/serialization.py deleted file mode 100644 index c36e865cc729..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/core/serialization.py +++ /dev/null @@ -1,276 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import collections -import inspect -import typing - -import pydantic -import typing_extensions - - -class FieldMetadata: - """ - Metadata class used to annotate fields to provide additional information. - - Example: - class MyDict(TypedDict): - field: typing.Annotated[str, FieldMetadata(alias="field_name")] - - Will serialize: `{"field": "value"}` - To: `{"field_name": "value"}` - """ - - alias: str - - def __init__(self, *, alias: str) -> None: - self.alias = alias - - -def convert_and_respect_annotation_metadata( - *, - object_: typing.Any, - annotation: typing.Any, - inner_type: typing.Optional[typing.Any] = None, - direction: typing.Literal["read", "write"], -) -> typing.Any: - """ - Respect the metadata annotations on a field, such as aliasing. This function effectively - manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for - TypedDicts, which cannot support aliasing out of the box, and can be extended for additional - utilities, such as defaults. - - Parameters - ---------- - object_ : typing.Any - - annotation : type - The type we're looking to apply typing annotations from - - inner_type : typing.Optional[type] - - Returns - ------- - typing.Any - """ - - if object_ is None: - return None - if inner_type is None: - inner_type = annotation - - clean_type = _remove_annotations(inner_type) - # Pydantic models - if ( - inspect.isclass(clean_type) - and issubclass(clean_type, pydantic.BaseModel) - and isinstance(object_, typing.Mapping) - ): - return _convert_mapping(object_, clean_type, direction) - # TypedDicts - if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping): - return _convert_mapping(object_, clean_type, direction) - - if ( - typing_extensions.get_origin(clean_type) == typing.Dict - or typing_extensions.get_origin(clean_type) == dict - or clean_type == typing.Dict - ) and isinstance(object_, typing.Dict): - key_type = typing_extensions.get_args(clean_type)[0] - value_type = typing_extensions.get_args(clean_type)[1] - - return { - key: convert_and_respect_annotation_metadata( - object_=value, - annotation=annotation, - inner_type=value_type, - direction=direction, - ) - for key, value in object_.items() - } - - # If you're iterating on a string, do not bother to coerce it to a sequence. - if not isinstance(object_, str): - if ( - typing_extensions.get_origin(clean_type) == typing.Set - or typing_extensions.get_origin(clean_type) == set - or clean_type == typing.Set - ) and isinstance(object_, typing.Set): - inner_type = typing_extensions.get_args(clean_type)[0] - return { - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - } - elif ( - ( - typing_extensions.get_origin(clean_type) == typing.List - or typing_extensions.get_origin(clean_type) == list - or clean_type == typing.List - ) - and isinstance(object_, typing.List) - ) or ( - ( - typing_extensions.get_origin(clean_type) == typing.Sequence - or typing_extensions.get_origin(clean_type) == collections.abc.Sequence - or clean_type == typing.Sequence - ) - and isinstance(object_, typing.Sequence) - ): - inner_type = typing_extensions.get_args(clean_type)[0] - return [ - convert_and_respect_annotation_metadata( - object_=item, - annotation=annotation, - inner_type=inner_type, - direction=direction, - ) - for item in object_ - ] - - if typing_extensions.get_origin(clean_type) == typing.Union: - # We should be able to ~relatively~ safely try to convert keys against all - # member types in the union, the edge case here is if one member aliases a field - # of the same name to a different name from another member - # Or if another member aliases a field of the same name that another member does not. - for member in typing_extensions.get_args(clean_type): - object_ = convert_and_respect_annotation_metadata( - object_=object_, - annotation=annotation, - inner_type=member, - direction=direction, - ) - return object_ - - annotated_type = _get_annotation(annotation) - if annotated_type is None: - return object_ - - # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.) - # Then we can safely call it on the recursive conversion. - return object_ - - -def _convert_mapping( - object_: typing.Mapping[str, object], - expected_type: typing.Any, - direction: typing.Literal["read", "write"], -) -> typing.Mapping[str, object]: - converted_object: typing.Dict[str, object] = {} - try: - annotations = typing_extensions.get_type_hints(expected_type, include_extras=True) - except NameError: - # The TypedDict contains a circular reference, so - # we use the __annotations__ attribute directly. - annotations = getattr(expected_type, "__annotations__", {}) - aliases_to_field_names = _get_alias_to_field_name(annotations) - for key, value in object_.items(): - if direction == "read" and key in aliases_to_field_names: - dealiased_key = aliases_to_field_names.get(key) - if dealiased_key is not None: - type_ = annotations.get(dealiased_key) - else: - type_ = annotations.get(key) - # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map - # - # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias - # then we can just pass the value through as is - if type_ is None: - converted_object[key] = value - elif direction == "read" and key not in aliases_to_field_names: - converted_object[key] = convert_and_respect_annotation_metadata( - object_=value, annotation=type_, direction=direction - ) - else: - converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = ( - convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction) - ) - return converted_object - - -def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return None - - if maybe_annotated_type == typing_extensions.NotRequired: - type_ = typing_extensions.get_args(type_)[0] - maybe_annotated_type = typing_extensions.get_origin(type_) - - if maybe_annotated_type == typing_extensions.Annotated: - return type_ - - return None - - -def _remove_annotations(type_: typing.Any) -> typing.Any: - maybe_annotated_type = typing_extensions.get_origin(type_) - if maybe_annotated_type is None: - return type_ - - if maybe_annotated_type == typing_extensions.NotRequired: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - if maybe_annotated_type == typing_extensions.Annotated: - return _remove_annotations(typing_extensions.get_args(type_)[0]) - - return type_ - - -def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_alias_to_field_name(annotations) - - -def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]: - annotations = typing_extensions.get_type_hints(type_, include_extras=True) - return _get_field_to_alias_name(annotations) - - -def _get_alias_to_field_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[maybe_alias] = field - return aliases - - -def _get_field_to_alias_name( - field_to_hint: typing.Dict[str, typing.Any], -) -> typing.Dict[str, str]: - aliases = {} - for field, hint in field_to_hint.items(): - maybe_alias = _get_alias_from_type(hint) - if maybe_alias is not None: - aliases[field] = maybe_alias - return aliases - - -def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]: - maybe_annotated_type = _get_annotation(type_) - - if maybe_annotated_type is not None: - # The actual annotations are 1 onward, the first is the annotated type - annotations = typing_extensions.get_args(maybe_annotated_type)[1:] - - for annotation in annotations: - if isinstance(annotation, FieldMetadata) and annotation.alias is not None: - return annotation.alias - return None - - -def _alias_key( - key: str, - type_: typing.Any, - direction: typing.Literal["read", "write"], - aliases_to_field_names: typing.Dict[str, str], -) -> str: - if direction == "read": - return aliases_to_field_names.get(key, key) - return _get_alias_from_type(type_=type_) or key diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/__init__.py deleted file mode 100644 index 87547c8ef9a8..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import api -_dynamic_imports: typing.Dict[str, str] = {"api": ".api"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["api"] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/__init__.py deleted file mode 100644 index 5cde0202dcf3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/client.py deleted file mode 100644 index c9bee058077f..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/client.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions -from .raw_client import AsyncRawApiClient, RawApiClient - - -class ApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawApiClient - """ - return self._raw_client - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from seed import SeedOauthClientCredentials - - client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.nested.api.get_something() - """ - _response = self._raw_client.get_something(request_options=request_options) - return _response.data - - -class AsyncApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawApiClient - """ - return self._raw_client - - async def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentials - - client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.nested.api.get_something() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_something(request_options=request_options) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/raw_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/raw_client.py deleted file mode 100644 index d7f7becabd87..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/api/raw_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.request_options import RequestOptions - - -class RawApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "nested/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_something( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "nested/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/client.py deleted file mode 100644 index b6b69853720e..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/client.py +++ /dev/null @@ -1,63 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .raw_client import AsyncRawNestedClient, RawNestedClient - -if typing.TYPE_CHECKING: - from .api.client import ApiClient, AsyncApiClient - - -class NestedClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawNestedClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[ApiClient] = None - - @property - def with_raw_response(self) -> RawNestedClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawNestedClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import ApiClient # noqa: E402 - - self._api = ApiClient(client_wrapper=self._client_wrapper) - return self._api - - -class AsyncNestedClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawNestedClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[AsyncApiClient] = None - - @property - def with_raw_response(self) -> AsyncRawNestedClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawNestedClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import AsyncApiClient # noqa: E402 - - self._api = AsyncApiClient(client_wrapper=self._client_wrapper) - return self._api diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/raw_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/raw_client.py deleted file mode 100644 index 27d31b97385d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested/raw_client.py +++ /dev/null @@ -1,13 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper - - -class RawNestedClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - -class AsyncRawNestedClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/__init__.py deleted file mode 100644 index 87547c8ef9a8..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - -import typing -from importlib import import_module - -if typing.TYPE_CHECKING: - from . import api -_dynamic_imports: typing.Dict[str, str] = {"api": ".api"} - - -def __getattr__(attr_name: str) -> typing.Any: - module_name = _dynamic_imports.get(attr_name) - if module_name is None: - raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") - try: - module = import_module(module_name, __package__) - if module_name == f".{attr_name}": - return module - else: - return getattr(module, attr_name) - except ImportError as e: - raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e - except AttributeError as e: - raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e - - -def __dir__(): - lazy_attrs = list(_dynamic_imports.keys()) - return sorted(lazy_attrs) - - -__all__ = ["api"] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/__init__.py deleted file mode 100644 index 5cde0202dcf3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/client.py deleted file mode 100644 index c6ecb161a286..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/client.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.request_options import RequestOptions -from .raw_client import AsyncRawApiClient, RawApiClient - - -class ApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawApiClient - """ - return self._raw_client - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from seed import SeedOauthClientCredentials - - client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.nested_no_auth.api.get_something() - """ - _response = self._raw_client.get_something(request_options=request_options) - return _response.data - - -class AsyncApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawApiClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawApiClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawApiClient - """ - return self._raw_client - - async def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentials - - client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.nested_no_auth.api.get_something() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_something(request_options=request_options) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/raw_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/raw_client.py deleted file mode 100644 index 4fbe653ac421..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/api/raw_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ...core.api_error import ApiError -from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ...core.http_response import AsyncHttpResponse, HttpResponse -from ...core.request_options import RequestOptions - - -class RawApiClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "nested-no-auth/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawApiClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_something( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "nested-no-auth/get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/client.py deleted file mode 100644 index d72921720357..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/client.py +++ /dev/null @@ -1,63 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from .raw_client import AsyncRawNestedNoAuthClient, RawNestedNoAuthClient - -if typing.TYPE_CHECKING: - from .api.client import ApiClient, AsyncApiClient - - -class NestedNoAuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawNestedNoAuthClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[ApiClient] = None - - @property - def with_raw_response(self) -> RawNestedNoAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawNestedNoAuthClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import ApiClient # noqa: E402 - - self._api = ApiClient(client_wrapper=self._client_wrapper) - return self._api - - -class AsyncNestedNoAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawNestedNoAuthClient(client_wrapper=client_wrapper) - self._client_wrapper = client_wrapper - self._api: typing.Optional[AsyncApiClient] = None - - @property - def with_raw_response(self) -> AsyncRawNestedNoAuthClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawNestedNoAuthClient - """ - return self._raw_client - - @property - def api(self): - if self._api is None: - from .api.client import AsyncApiClient # noqa: E402 - - self._api = AsyncApiClient(client_wrapper=self._client_wrapper) - return self._api diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/raw_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/raw_client.py deleted file mode 100644 index 0c7a80a10e7a..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/nested_no_auth/raw_client.py +++ /dev/null @@ -1,13 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper - - -class RawNestedNoAuthClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - -class AsyncRawNestedNoAuthClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/py.typed b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/py.typed deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/__init__.py deleted file mode 100644 index 5cde0202dcf3..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# isort: skip_file - diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/client.py deleted file mode 100644 index 4ed5aebffe12..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/client.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing - -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.request_options import RequestOptions -from .raw_client import AsyncRawSimpleClient, RawSimpleClient - - -class SimpleClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._raw_client = RawSimpleClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> RawSimpleClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - RawSimpleClient - """ - return self._raw_client - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - from seed import SeedOauthClientCredentials - - client = SeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - client.simple.get_something() - """ - _response = self._raw_client.get_something(request_options=request_options) - return _response.data - - -class AsyncSimpleClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._raw_client = AsyncRawSimpleClient(client_wrapper=client_wrapper) - - @property - def with_raw_response(self) -> AsyncRawSimpleClient: - """ - Retrieves a raw implementation of this client that returns raw responses. - - Returns - ------- - AsyncRawSimpleClient - """ - return self._raw_client - - async def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - None - - Examples - -------- - import asyncio - - from seed import AsyncSeedOauthClientCredentials - - client = AsyncSeedOauthClientCredentials( - base_url="https://yourhost.com/path/to/api", - client_id="YOUR_CLIENT_ID", - client_secret="YOUR_CLIENT_SECRET", - ) - - - async def main() -> None: - await client.simple.get_something() - - - asyncio.run(main()) - """ - _response = await self._raw_client.get_something(request_options=request_options) - return _response.data diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/raw_client.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/raw_client.py deleted file mode 100644 index aa82d3dd5984..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/simple/raw_client.py +++ /dev/null @@ -1,69 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -import typing -from json.decoder import JSONDecodeError - -from ..core.api_error import ApiError -from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -from ..core.http_response import AsyncHttpResponse, HttpResponse -from ..core.request_options import RequestOptions - - -class RawSimpleClient: - def __init__(self, *, client_wrapper: SyncClientWrapper): - self._client_wrapper = client_wrapper - - def get_something(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - HttpResponse[None] - """ - _response = self._client_wrapper.httpx_client.request( - "get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return HttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) - - -class AsyncRawSimpleClient: - def __init__(self, *, client_wrapper: AsyncClientWrapper): - self._client_wrapper = client_wrapper - - async def get_something( - self, *, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncHttpResponse[None]: - """ - Parameters - ---------- - request_options : typing.Optional[RequestOptions] - Request-specific configuration. - - Returns - ------- - AsyncHttpResponse[None] - """ - _response = await self._client_wrapper.httpx_client.request( - "get-something", - method="GET", - request_options=request_options, - ) - try: - if 200 <= _response.status_code < 300: - return AsyncHttpResponse(response=_response, data=None) - _response_json = _response.json() - except JSONDecodeError: - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) - raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) diff --git a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/version.py b/seed/python-sdk/oauth-client-credentials/token-override/src/seed/version.py deleted file mode 100644 index 468e83737f8e..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/src/seed/version.py +++ /dev/null @@ -1,3 +0,0 @@ -from importlib import metadata - -__version__ = metadata.version("fern_oauth-client-credentials") diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/custom/test_client.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/custom/test_client.py deleted file mode 100644 index ab04ce6393ef..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/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/oauth-client-credentials/token-override/tests/utils/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/__init__.py deleted file mode 100644 index f3ea2659bb1c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/__init__.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/__init__.py deleted file mode 100644 index 2cf01263529d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -from .circle import CircleParams -from .object_with_defaults import ObjectWithDefaultsParams -from .object_with_optional_field import ObjectWithOptionalFieldParams -from .shape import Shape_CircleParams, Shape_SquareParams, ShapeParams -from .square import SquareParams -from .undiscriminated_shape import UndiscriminatedShapeParams - -__all__ = [ - "CircleParams", - "ObjectWithDefaultsParams", - "ObjectWithOptionalFieldParams", - "ShapeParams", - "Shape_CircleParams", - "Shape_SquareParams", - "SquareParams", - "UndiscriminatedShapeParams", -] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/circle.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/circle.py deleted file mode 100644 index 74ecf38c308b..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/circle.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - -from seed.core.serialization import FieldMetadata - - -class CircleParams(typing_extensions.TypedDict): - radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/color.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/color.py deleted file mode 100644 index 2aa2c4c52f0c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/color.py +++ /dev/null @@ -1,7 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing - -Color = typing.Union[typing.Literal["red", "blue"], typing.Any] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/object_with_defaults.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/object_with_defaults.py deleted file mode 100644 index a977b1d2aa1c..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/object_with_defaults.py +++ /dev/null @@ -1,15 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - - -class ObjectWithDefaultsParams(typing_extensions.TypedDict): - """ - Defines properties with default values and validation rules. - """ - - decimal: typing_extensions.NotRequired[float] - string: typing_extensions.NotRequired[str] - required_string: str diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/object_with_optional_field.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/object_with_optional_field.py deleted file mode 100644 index 6b5608bc05b6..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/object_with_optional_field.py +++ /dev/null @@ -1,35 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import datetime as dt -import typing -import uuid - -import typing_extensions -from .color import Color -from .shape import ShapeParams -from .undiscriminated_shape import UndiscriminatedShapeParams - -from seed.core.serialization import FieldMetadata - - -class ObjectWithOptionalFieldParams(typing_extensions.TypedDict): - literal: typing.Literal["lit_one"] - string: typing_extensions.NotRequired[str] - integer: typing_extensions.NotRequired[int] - long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]] - double: typing_extensions.NotRequired[float] - bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]] - datetime: typing_extensions.NotRequired[dt.datetime] - date: typing_extensions.NotRequired[dt.date] - uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]] - base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]] - list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]] - set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]] - map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]] - enum: typing_extensions.NotRequired[Color] - union: typing_extensions.NotRequired[ShapeParams] - second_union: typing_extensions.NotRequired[ShapeParams] - undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams] - any: typing.Optional[typing.Any] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/shape.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/shape.py deleted file mode 100644 index 7e70010a251f..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/shape.py +++ /dev/null @@ -1,28 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -from __future__ import annotations - -import typing - -import typing_extensions - -from seed.core.serialization import FieldMetadata - - -class Base(typing_extensions.TypedDict): - id: str - - -class Shape_CircleParams(Base): - shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")] - radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")] - - -class Shape_SquareParams(Base): - shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")] - length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] - - -ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/square.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/square.py deleted file mode 100644 index 71c7d25fd4ad..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/square.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing_extensions - -from seed.core.serialization import FieldMetadata - - -class SquareParams(typing_extensions.TypedDict): - length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/undiscriminated_shape.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/undiscriminated_shape.py deleted file mode 100644 index 99f12b300d1d..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/assets/models/undiscriminated_shape.py +++ /dev/null @@ -1,10 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -# This file was auto-generated by Fern from our API Definition. - -import typing - -from .circle import CircleParams -from .square import SquareParams - -UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams] diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_http_client.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_http_client.py deleted file mode 100644 index 79d01a455762..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_http_client.py +++ /dev/null @@ -1,109 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed.core.http_client import get_request_body, remove_none_from_dict -from seed.core.request_options import RequestOptions - - -def get_request_options() -> RequestOptions: - return {"additional_body_parameters": {"see you": "later"}} - - -def get_request_options_with_none() -> RequestOptions: - return {"additional_body_parameters": {"see you": "later", "optional": None}} - - -def test_get_json_request_body() -> None: - json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None) - assert json_body == {"hello": "world"} - assert data_body is None - - json_body_extras, data_body_extras = get_request_body( - json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None - ) - - assert json_body_extras == {"goodbye": "world", "see you": "later"} - assert data_body_extras is None - - -def test_get_files_request_body() -> None: - json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None) - assert data_body == {"hello": "world"} - assert json_body is None - - json_body_extras, data_body_extras = get_request_body( - json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None - ) - - assert data_body_extras == {"goodbye": "world", "see you": "later"} - assert json_body_extras is None - - -def test_get_none_request_body() -> None: - json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None) - assert data_body is None - assert json_body is None - - json_body_extras, data_body_extras = get_request_body( - json=None, data=None, request_options=get_request_options(), omit=None - ) - - assert json_body_extras == {"see you": "later"} - assert data_body_extras is None - - -def test_get_empty_json_request_body() -> None: - unrelated_request_options: RequestOptions = {"max_retries": 3} - json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None) - assert json_body is None - assert data_body is None - - json_body_extras, data_body_extras = get_request_body( - json={}, data=None, request_options=unrelated_request_options, omit=None - ) - - assert json_body_extras is None - assert data_body_extras is None - - -def test_json_body_preserves_none_values() -> None: - """Test that JSON bodies preserve None values (they become JSON null).""" - json_body, data_body = get_request_body( - json={"hello": "world", "optional": None}, data=None, request_options=None, omit=None - ) - # JSON bodies should preserve None values - assert json_body == {"hello": "world", "optional": None} - assert data_body is None - - -def test_data_body_preserves_none_values_without_multipart() -> None: - """Test that data bodies preserve None values when not using multipart. - - The filtering of None values happens in HttpClient.request/stream methods, - not in get_request_body. This test verifies get_request_body doesn't filter None. - """ - json_body, data_body = get_request_body( - json=None, data={"hello": "world", "optional": None}, request_options=None, omit=None - ) - # get_request_body should preserve None values in data body - # The filtering happens later in HttpClient.request when multipart is detected - assert data_body == {"hello": "world", "optional": None} - assert json_body is None - - -def test_remove_none_from_dict_filters_none_values() -> None: - """Test that remove_none_from_dict correctly filters out None values.""" - original = {"hello": "world", "optional": None, "another": "value", "also_none": None} - filtered = remove_none_from_dict(original) - assert filtered == {"hello": "world", "another": "value"} - # Original should not be modified - assert original == {"hello": "world", "optional": None, "another": "value", "also_none": None} - - -def test_remove_none_from_dict_empty_dict() -> None: - """Test that remove_none_from_dict handles empty dict.""" - assert remove_none_from_dict({}) == {} - - -def test_remove_none_from_dict_all_none() -> None: - """Test that remove_none_from_dict handles dict with all None values.""" - assert remove_none_from_dict({"a": None, "b": None}) == {} diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_query_encoding.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_query_encoding.py deleted file mode 100644 index ef5fd7094f9b..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_query_encoding.py +++ /dev/null @@ -1,36 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from seed.core.query_encoder import encode_query - - -def test_query_encoding_deep_objects() -> None: - assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")] - assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")] - assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [ - ("hello_world[hello][world]", "today"), - ("hello_world[test]", "this"), - ("hi", "there"), - ] - - -def test_query_encoding_deep_object_arrays() -> None: - assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [ - ("objects[key]", "hello"), - ("objects[value]", "world"), - ("objects[key]", "foo"), - ("objects[value]", "bar"), - ] - assert encode_query( - {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]} - ) == [ - ("users[name]", "string"), - ("users[tags]", "string"), - ("users[name]", "string2"), - ("users[tags]", "string2"), - ("users[tags]", "string3"), - ] - - -def test_encode_query_with_none() -> None: - encoded = encode_query(None) - assert encoded is None diff --git a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_serialization.py b/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_serialization.py deleted file mode 100644 index b298db89c4bd..000000000000 --- a/seed/python-sdk/oauth-client-credentials/token-override/tests/utils/test_serialization.py +++ /dev/null @@ -1,72 +0,0 @@ -# This file was auto-generated by Fern from our API Definition. - -from typing import Any, List - -from .assets.models import ObjectWithOptionalFieldParams, ShapeParams - -from seed.core.serialization import convert_and_respect_annotation_metadata - -UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"} -UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"} - - -def test_convert_and_respect_annotation_metadata() -> None: - data: ObjectWithOptionalFieldParams = { - "string": "string", - "long_": 12345, - "bool_": True, - "literal": "lit_one", - "any": "any", - } - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" - ) - assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"} - - -def test_convert_and_respect_annotation_metadata_in_list() -> None: - data: List[ObjectWithOptionalFieldParams] = [ - {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"}, - {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"}, - ] - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write" - ) - - assert converted == [ - {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}, - {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"}, - ] - - -def test_convert_and_respect_annotation_metadata_in_nested_object() -> None: - data: ObjectWithOptionalFieldParams = { - "string": "string", - "long_": 12345, - "union": UNION_TEST, - "literal": "lit_one", - "any": "any", - } - converted = convert_and_respect_annotation_metadata( - object_=data, annotation=ObjectWithOptionalFieldParams, direction="write" - ) - - assert converted == { - "string": "string", - "long": 12345, - "union": UNION_TEST_CONVERTED, - "literal": "lit_one", - "any": "any", - } - - -def test_convert_and_respect_annotation_metadata_in_union() -> None: - converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write") - - assert converted == UNION_TEST_CONVERTED - - -def test_convert_and_respect_annotation_metadata_with_empty_object() -> None: - data: Any = {} - converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write") - assert converted == data