diff --git a/generators/python/sdk/CHANGELOG.md b/generators/python/sdk/CHANGELOG.md index 95270be991b..ab633d3d071 100644 --- a/generators/python/sdk/CHANGELOG.md +++ b/generators/python/sdk/CHANGELOG.md @@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.11.1] - 2024-02-20 + +- Improvement: Python now supports specifying files to auto-export from the root `__init__.py` file, this means you can export custom classes and functions from your package for users to access like so: + + ```python + from my_package import custom_function + ``` + + the configuration for this is: + + ```yaml + # generators.yml + python-sdk: + generators: + - name: fernapi/fern-python-sdk + version: 0.11.1 + config: + additional_init_exports: + - from: file_with_custom_function + imports: + - custom_function + ``` + +- Chore: Add a docstring for base clients to explain usage, example: + + ```python + class SeedTest: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + --- + from seed.client import SeedTest + + client = SeedTest( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + ``` + ## [0.11.0] - 2024-02-19 - Improvement: Python now supports a wider range of types for file upload, mirroring the `httpx` library used under the hood, these are grouped under a new type `File`: diff --git a/generators/python/src/fern_python/codegen/ast/nodes/declarations/class_/class_declaration.py b/generators/python/src/fern_python/codegen/ast/nodes/declarations/class_/class_declaration.py index 3ecec57817b..2cdbb424d5e 100644 --- a/generators/python/src/fern_python/codegen/ast/nodes/declarations/class_/class_declaration.py +++ b/generators/python/src/fern_python/codegen/ast/nodes/declarations/class_/class_declaration.py @@ -25,6 +25,7 @@ def __init__( constructor: ClassConstructor = None, docstring: Docstring = None, snippet: Optional[str] = None, + write_parameter_docstring: bool = False, ): self.name = name self.extends = list(extends or []) @@ -42,6 +43,7 @@ def __init__( self.class_vars: List[VariableDeclaration] = [] self.statements: List[AstNode] = [] self.ghost_references: OrderedSet[Reference] = OrderedSet() + self.write_parameter_docstring = write_parameter_docstring def add_class_var(self, variable_declaration: VariableDeclaration) -> None: self.class_vars.append(variable_declaration) @@ -157,18 +159,80 @@ def write(self, writer: NodeWriter) -> None: writer.write_line(":") with writer.indent(): - if self.docstring is not None: + parameters = ( + self.constructor.function_declaration.signature.named_parameters if self.constructor is not None else [] + ) + if ( + self.docstring is not None + or self.snippet is not None + or (len(parameters) > 0 and self.write_parameter_docstring) + ): writer.write_line('"""') + + if self.docstring is not None: writer.write_node(self.docstring) writer.write_newline_if_last_line_not() + if self.snippet is None and len(parameters) == 0: + writer.write_line('"""') + elif len(parameters) == 0: + writer.write_line("---") + + if len(parameters) > 0 and self.write_parameter_docstring: + if self.docstring is not None: + # Include a line between the endpoint docs and field docs. + writer.write_line() + writer.write_line("Parameters:") + with writer.indent(): + for i, param in enumerate(parameters): + if i > 0: + writer.write_line() + + if param.docs is None: + writer.write(f"- {param.name}: ") + if param.type_hint is not None: + writer.write_node(param.type_hint) + writer.write_line(".") + continue + + split = param.docs.split("\n") + if len(split) == 1: + writer.write(f"- {param.name}: ") + if param.type_hint is not None: + writer.write_node(param.type_hint) + writer.write_line(f". {param.docs}") + continue + + # Handle multi-line comments at the same level of indentation for the same field, + # e.g. + # + # - userId: str. This is a multi-line comment. + # This one has three lines + # in total. + # + # - request: Request. The request body. + # + indent = "" + for i, line in enumerate(split): + if i == 0: + # Determine the level of indentation we need by capturing the length + # before and after we write the type hint. + writer.write(f"- {param.name}: ") + before = writer.size() + if param.type_hint is not None: + writer.write_node(param.type_hint) + after = writer.size() + writer.write_line(f". {line}") + indent = " " * (len(param.name) + (after - before) + 4) + continue + writer.write(f" {indent} {line}") + if i < len(split) - 1: + writer.write_line() if self.snippet is None: writer.write_line('"""') else: writer.write_line("---") if self.snippet is not None: - if self.docstring is None: - writer.write_line('"""') writer.write(self.snippet) writer.write_newline_if_last_line_not() writer.write_line('"""') diff --git a/generators/python/src/fern_python/codegen/module_manager.py b/generators/python/src/fern_python/codegen/module_manager.py index d12d2658303..5bbbc3a3daf 100644 --- a/generators/python/src/fern_python/codegen/module_manager.py +++ b/generators/python/src/fern_python/codegen/module_manager.py @@ -4,6 +4,8 @@ from functools import cmp_to_key from typing import DefaultDict, List, Optional, Sequence, Set, Tuple +import pydantic + from . import AST from .filepath import ExportStrategy, Filepath from .writer_impl import WriterImpl @@ -11,6 +13,11 @@ RelativeModulePath = Tuple[str, ...] +class ModuleExport(pydantic.BaseModel): + from_: str = pydantic.Field(alias="from") + imports: List[str] + + @dataclass class ModuleInfo: exports: DefaultDict[RelativeModulePath, Set[str]] @@ -38,6 +45,10 @@ def __init__(self, *, should_format: bool, sorted_modules: Optional[Sequence[str self._should_format = should_format self._sorted_modules = sorted_modules or [] + def register_additional_exports(self, path: AST.ModulePath, exports: List[ModuleExport]) -> None: + for export in exports: + self._module_infos[path].exports[(export.from_,)].update(export.imports) + def register_exports(self, filepath: Filepath, exports: Set[str]) -> None: module_being_exported_from: AST.ModulePath = tuple( directory.module_name for directory in filepath.directories diff --git a/generators/python/src/fern_python/codegen/project.py b/generators/python/src/fern_python/codegen/project.py index fbee7497e99..b9b7c2c1000 100644 --- a/generators/python/src/fern_python/codegen/project.py +++ b/generators/python/src/fern_python/codegen/project.py @@ -4,14 +4,14 @@ from dataclasses import dataclass from pathlib import Path from types import TracebackType -from typing import Optional, Sequence, Set, Type +from typing import List, Optional, Sequence, Set, Type from fern_python.codegen import AST from fern_python.codegen.pyproject_toml import PyProjectToml, PyProjectTomlPackageConfig from .dependency_manager import DependencyManager from .filepath import Filepath -from .module_manager import ModuleManager +from .module_manager import ModuleExport, ModuleManager from .reference_resolver_impl import ReferenceResolverImpl from .source_file import SourceFile, SourceFileImpl from .writer_impl import WriterImpl @@ -59,6 +59,9 @@ def __init__( self._should_format_files = should_format_files self._whitelabel = whitelabel + def add_init_exports(self, path: AST.ModulePath, exports: List[ModuleExport]) -> None: + self._module_manager.register_additional_exports(path, exports) + def add_dependency(self, dependency: AST.Dependency) -> None: self._dependency_manager.add_dependency(dependency) 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 6e395384ee6..75b8be47eac 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 @@ -15,6 +15,7 @@ ConstructorParameter, ) from fern_python.snippet import SnippetRegistry, SnippetWriter +from fern_python.source_file_factory.source_file_factory import SourceFileFactory from ..context.sdk_generator_context import SdkGeneratorContext from ..environment_generators import ( @@ -35,13 +36,16 @@ class RootClientConstructorParameter: private_member_name: typing.Optional[str] = None initializer: Optional[AST.Expression] = None exclude_from_wrapper_construction: Optional[bool] = False + docs: Optional[str] = None class RootClientGenerator: ENVIRONMENT_CONSTRUCTOR_PARAMETER_NAME = "environment" ENVIRONMENT_MEMBER_NAME = "_environment" + ENVIRONMENT_CONSTRUCTOR_PARAMETER_DOCS = "The environment to use for requests from the client." BASE_URL_CONSTRUCTOR_PARAMETER_NAME = "base_url" + BASE_URL_CONSTRUCTOR_PARAMETER_DOCS = "The base url to use for requests from the client." BASE_URL_MEMBER_NAME = "_base_url" HTTPX_CLIENT_CONSTRUCTOR_PARAMETER_NAME = "httpx_client" @@ -130,6 +134,7 @@ def generate(self, source_file: SourceFile) -> GeneratedRootClient: AST.NamedFunctionParameter( name=RootClientGenerator.BASE_URL_CONSTRUCTOR_PARAMETER_NAME, type_hint=AST.TypeHint.optional(AST.TypeHint.str_()), + docs=RootClientGenerator.BASE_URL_CONSTRUCTOR_PARAMETER_DOCS, ), AST.NamedFunctionParameter( name=RootClientGenerator.ENVIRONMENT_CONSTRUCTOR_PARAMETER_NAME, @@ -138,6 +143,7 @@ def generate(self, source_file: SourceFile) -> GeneratedRootClient: else AST.TypeHint.optional( AST.TypeHint(self._context.get_reference_to_environments_class()) ), + docs="The environment to be used as the base url, can be used in lieu of 'base_url'.", ), ], return_type=AST.TypeHint.str_(), @@ -148,6 +154,11 @@ def generate(self, source_file: SourceFile) -> GeneratedRootClient: ) return generated_root_client + def _write_root_class_docstring(self, writer: AST.NodeWriter) -> None: + writer.write_line( + "Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions." + ) + def _create_class_declaration( self, *, @@ -161,10 +172,15 @@ def _create_class_declaration( name=param.constructor_parameter_name, type_hint=param.type_hint, initializer=param.initializer, + docs=param.docs, ) for param in constructor_parameters ] + snippet = SourceFileFactory.create_snippet() + snippet.add_expression( + generated_root_client.async_instantiation if is_async else generated_root_client.sync_instantiation + ) class_declaration = AST.ClassDeclaration( name=self._async_class_name if is_async else self._class_name, constructor=AST.ClassConstructor( @@ -175,6 +191,9 @@ def _create_class_declaration( self._get_write_constructor_body(is_async=is_async, constructor_parameters=constructor_parameters) ), ), + docstring=AST.Docstring(self._write_root_class_docstring), + snippet=snippet.to_str(), + write_parameter_docstring=True, ) if self._package.service is not None: @@ -223,6 +242,7 @@ def _get_constructor_parameters(self, *, is_async: bool) -> List[RootClientConst type_hint=AST.TypeHint.str_(), private_member_name=None, initializer=None, + docs=RootClientGenerator.BASE_URL_CONSTRUCTOR_PARAMETER_DOCS, ) ) # If single url environment present, client should provide both base_url and environment arguments @@ -234,8 +254,33 @@ def _get_constructor_parameters(self, *, is_async: bool) -> List[RootClientConst private_member_name=None, initializer=AST.Expression("None"), exclude_from_wrapper_construction=True, + docs=RootClientGenerator.BASE_URL_CONSTRUCTOR_PARAMETER_DOCS, + ) + ) + default_environment = ( + AST.Expression( + environments_config.environments.visit( + single_base_url=lambda single_base_url_environments: SingleBaseUrlEnvironmentGenerator( + context=self._context, environments=single_base_url_environments + ).get_reference_to_default_environment(), + multiple_base_urls=lambda multiple_base_urls_environments: MultipleBaseUrlsEnvironmentGenerator( + context=self._context, environments=multiple_base_urls_environments + ).get_reference_to_default_environment(), + ) ) + if environments_config.default_environment is not None + else None ) + environment_docs = f"{RootClientGenerator.ENVIRONMENT_CONSTRUCTOR_PARAMETER_DOCS}" + if default_environment is not None: + snippet = SourceFileFactory.create_snippet() + + def write_default_environment(writer: AST.NodeWriter) -> None: + writer.write("Defaults to ") + writer.write_node(default_environment) # type: ignore + + snippet.add_arbitrary_code(AST.CodeWriter(code_writer=write_default_environment)) + environment_docs += f" {snippet.to_str()}" parameters.append( RootClientConstructorParameter( constructor_parameter_name=RootClientGenerator.ENVIRONMENT_CONSTRUCTOR_PARAMETER_NAME, @@ -243,23 +288,37 @@ def _get_constructor_parameters(self, *, is_async: bool) -> List[RootClientConst if environments_config.default_environment is not None else AST.TypeHint.optional(AST.TypeHint(self._context.get_reference_to_environments_class())), private_member_name=None, - initializer=AST.Expression( - environments_config.environments.visit( - single_base_url=lambda single_base_url_environments: SingleBaseUrlEnvironmentGenerator( - context=self._context, environments=single_base_url_environments - ).get_reference_to_default_environment(), - multiple_base_urls=lambda multiple_base_urls_environments: MultipleBaseUrlsEnvironmentGenerator( - context=self._context, environments=multiple_base_urls_environments - ).get_reference_to_default_environment(), - ) - ) - if environments_config.default_environment is not None - else None, + initializer=default_environment if default_environment is not None else None, exclude_from_wrapper_construction=True, + docs=environment_docs, ), ) # If mutli url environment present, client should provide only environment argument elif environments_config.environments.get_as_union().type == "multipleBaseUrls": + default_environment = ( + AST.Expression( + environments_config.environments.visit( + single_base_url=lambda single_base_url_environments: SingleBaseUrlEnvironmentGenerator( + context=self._context, environments=single_base_url_environments + ).get_reference_to_default_environment(), + multiple_base_urls=lambda multiple_base_urls_environments: MultipleBaseUrlsEnvironmentGenerator( + context=self._context, environments=multiple_base_urls_environments + ).get_reference_to_default_environment(), + ) + ) + if environments_config.default_environment is not None + else None + ) + environment_docs = f"{RootClientGenerator.ENVIRONMENT_CONSTRUCTOR_PARAMETER_DOCS}" + if default_environment is not None: + snippet = SourceFileFactory.create_snippet() + + def write_default_environment(writer: AST.NodeWriter) -> None: + writer.write("Defaults to ") + writer.write_node(default_environment) # type: ignore + + snippet.add_arbitrary_code(AST.CodeWriter(code_writer=write_default_environment)) + environment_docs += f" {snippet.to_str()}" parameters.append( RootClientConstructorParameter( constructor_parameter_name=RootClientGenerator.ENVIRONMENT_CONSTRUCTOR_PARAMETER_NAME, @@ -267,18 +326,8 @@ def _get_constructor_parameters(self, *, is_async: bool) -> List[RootClientConst if environments_config.default_environment is not None else AST.TypeHint.optional(AST.TypeHint(self._context.get_reference_to_environments_class())), private_member_name=None, - initializer=AST.Expression( - environments_config.environments.visit( - single_base_url=lambda single_base_url_environments: SingleBaseUrlEnvironmentGenerator( - context=self._context, environments=single_base_url_environments - ).get_reference_to_default_environment(), - multiple_base_urls=lambda multiple_base_urls_environments: MultipleBaseUrlsEnvironmentGenerator( - context=self._context, environments=multiple_base_urls_environments - ).get_reference_to_default_environment(), - ) - ) - if environments_config.default_environment is not None - else None, + initializer=default_environment if default_environment is not None else None, + docs=environment_docs, ), ) @@ -327,6 +376,7 @@ def _get_constructor_parameters(self, *, is_async: bool) -> List[RootClientConst initializer=AST.Expression(f"{self._context.custom_config.timeout_in_seconds}") if isinstance(self._context.custom_config.timeout_in_seconds, int) else AST.Expression(AST.TypeHint.none()), + docs="The timeout to be used, in seconds, for requests by default the timeout is 60 seconds.", ) ) parameters.append( @@ -337,6 +387,7 @@ def _get_constructor_parameters(self, *, is_async: bool) -> List[RootClientConst else AST.TypeHint.optional(AST.TypeHint(HttpX.ASYNC_CLIENT)), private_member_name=None, initializer=AST.Expression(AST.TypeHint.none()), + docs="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.", ) ) return parameters diff --git a/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py b/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py index f80939542c8..586a120b61b 100644 --- a/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py +++ b/generators/python/src/fern_python/generators/sdk/core_utilities/client_wrapper_generator.py @@ -25,6 +25,7 @@ class ConstructorParameter: header_prefix: typing.Optional[str] = None environment_variable: typing.Optional[str] = None is_basic: bool = False + docs: typing.Optional[str] = None @dataclass 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 4066a9ad5a4..65838ce9045 100644 --- a/generators/python/src/fern_python/generators/sdk/custom_config.py +++ b/generators/python/src/fern_python/generators/sdk/custom_config.py @@ -1,6 +1,7 @@ -from typing import Dict, Literal, Optional, Union +from typing import Dict, List, Literal, Optional, Union import pydantic +from fern_python.codegen.module_manager import ModuleExport from fern_python.generators.pydantic_model import PydanticModelCustomConfig @@ -23,6 +24,7 @@ class SDKCustomConfig(pydantic.BaseModel): timeout_in_seconds: Union[Literal["infinity"], int] = 60 flat_layout: bool = False pydantic_config: SdkPydanticModelCustomConfig = SdkPydanticModelCustomConfig() + additional_init_exports: Optional[List[ModuleExport]] = None class Config: extra = pydantic.Extra.forbid 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 ac40f586f70..f45b361ba1e 100644 --- a/generators/python/src/fern_python/generators/sdk/sdk_generator.py +++ b/generators/python/src/fern_python/generators/sdk/sdk_generator.py @@ -75,6 +75,10 @@ def run( for dep, version in custom_config.extra_dependencies.items(): project.add_dependency(dependency=AST.Dependency(name=dep, version=version)) + # Export from root init + if custom_config.additional_init_exports is not None: + project.add_init_exports(path=(), exports=custom_config.additional_init_exports) + self._pydantic_model_custom_config = custom_config.pydantic_config context = SdkGeneratorContextImpl( diff --git a/packages/cli/cli/src/cli.ts b/packages/cli/cli/src/cli.ts index f9f456b1eef..f627526b2dc 100644 --- a/packages/cli/cli/src/cli.ts +++ b/packages/cli/cli/src/cli.ts @@ -720,20 +720,34 @@ function addWriteOverridesCommand(cli: Argv, cliContext: CliCo cli.command( "write-overrides", "Generate a basic openapi overrides file.", - (yargs) => + (yargs) => [ yargs.option("api", { string: true, description: "Only run the command on the provided API" }), + yargs.option("exclude-models", { + boolean: true, + description: + "When generating the initial overrides, also stub the models (in addition to the endpoints)", + default: false + }), + yargs.option("existing-overrides", { + string: true, + description: + "The existing overrides file to add on to instead of writing a new one, we will default to the one specified in generators.yml." + }) + ], async (argv) => { cliContext.instrumentPostHogEvent({ command: "fern generate-overrides" }); await writeOverridesForWorkspaces({ project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, { - commandLineApiWorkspace: argv.api, + commandLineApiWorkspace: argv.api as string, defaultToAllApiWorkspaces: true }), + includeModels: !(argv.excludeModels as boolean), + overridesFilepath: argv.existingOverrides as string, cliContext }); } diff --git a/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts b/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts index 64949b3ad67..f528bc48aa1 100644 --- a/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts +++ b/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts @@ -3,22 +3,32 @@ import { getEndpointLocation } from "@fern-api/openapi-ir-to-fern"; import { Project } from "@fern-api/project-loader"; import { TaskContext } from "@fern-api/task-context"; import { getOpenAPIIRFromOpenAPIWorkspace, OpenAPIWorkspace } from "@fern-api/workspace-loader"; -import { writeFile } from "fs/promises"; +import { readFile, writeFile } from "fs/promises"; import yaml from "js-yaml"; import { CliContext } from "../../cli-context/CliContext"; export async function writeOverridesForWorkspaces({ project, + includeModels, + overridesFilepath, cliContext }: { project: Project; + includeModels: boolean; + overridesFilepath: string | undefined; cliContext: CliContext; }): Promise { await Promise.all( project.apiWorkspaces.map(async (workspace) => { await cliContext.runTaskForWorkspace(workspace, async (context) => { if (workspace.type === "openapi") { - await writeDefinitionForOpenAPIWorkspace({ workspace, context }); + await writeDefinitionForOpenAPIWorkspace({ + workspace, + context, + includeModels, + overridesFilepath: + overridesFilepath ?? workspace.generatorsConfiguration?.absolutePathToOpenAPIOverrides + }); } else { context.logger.warn("Skipping fern workspace definition generation"); } @@ -27,15 +37,43 @@ export async function writeOverridesForWorkspaces({ ); } +async function readExistingOverrides(overridesFilepath: string, context: TaskContext) { + let parsedOverrides = null; + try { + const contents = (await readFile(overridesFilepath, "utf8")).toString(); + try { + parsedOverrides = JSON.parse(contents); + } catch (err) { + parsedOverrides = yaml.load(contents, { json: true }); + } + } catch (err) { + return context.failAndThrow(`Failed to read OpenAPI overrides from file ${overridesFilepath}`); + } + return parsedOverrides; +} + async function writeDefinitionForOpenAPIWorkspace({ workspace, + includeModels, + overridesFilepath, context }: { workspace: OpenAPIWorkspace; + includeModels: boolean; + overridesFilepath: string | undefined; context: TaskContext; }): Promise { const openApiIr = await getOpenAPIIRFromOpenAPIWorkspace(workspace, context); - const paths: Record> = {}; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let existingOverrides: any = {}; + if (overridesFilepath !== undefined) { + existingOverrides = await readExistingOverrides(overridesFilepath, context); + } + + const paths: Record> = "path" in existingOverrides + ? (existingOverrides.path as Record>) + : {}; for (const endpoint of openApiIr.endpoints) { const endpointLocation = getEndpointLocation(endpoint); if (!(endpoint.path in paths)) { @@ -54,12 +92,29 @@ async function writeDefinitionForOpenAPIWorkspace({ } sdkMethodNameExtensions["x-fern-sdk-method-name"] = endpointLocation.endpointId; pathItem[endpoint.method.toLowerCase()] = sdkMethodNameExtensions; - } else { + } else if (existingOverrides == null) { context.logger.warn(`Endpoint ${endpoint.path} ${endpoint.method} is defined multiple times`); } } + const schemas: Record> = "path" in existingOverrides + ? (existingOverrides.path as Record>) + : {}; + if (includeModels) { + for (const [schemaId, schema] of Object.entries(openApiIr.schemas)) { + if (schemaId in schemas) { + continue; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const typeNameOverride: Record = {}; + typeNameOverride["x-fern-type-name"] = + "nameOverride" in schema ? schema.nameOverride ?? schemaId : schemaId; + schemas[schemaId] = typeNameOverride; + } + } + const components: Record> = { schemas }; + await writeFile( join(dirname(workspace.absolutePathToOpenAPI), RelativeFilePath.of("openapi-overrides.yml")), - yaml.dump({ paths }) + yaml.dump({ paths, components }) ); } diff --git a/packages/cli/ete-tests/src/tests/write-overrides/__snapshots__/writeOverrides.test.ts.snap b/packages/cli/ete-tests/src/tests/write-overrides/__snapshots__/writeOverrides.test.ts.snap new file mode 100644 index 00000000000..e06c921b8b1 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/write-overrides/__snapshots__/writeOverrides.test.ts.snap @@ -0,0 +1,28 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`overrides petstore 1`] = ` +"paths: + /pets: + get: + x-fern-sdk-group-name: + - pets + x-fern-sdk-method-name: listPets + post: + x-fern-sdk-group-name: + - pets + x-fern-sdk-method-name: createPets + /pets/{petId}: + get: + x-fern-sdk-group-name: + - pets + x-fern-sdk-method-name: showPetById +components: + schemas: + Pet: + x-fern-type-name: Pet + Pets: + x-fern-type-name: Pets + Error: + x-fern-type-name: Error +" +`; diff --git a/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/.gitignore b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/.gitignore new file mode 100644 index 00000000000..48d75fb2f57 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/.gitignore @@ -0,0 +1 @@ +fern/openapi/openapi-overrides.yml diff --git a/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/fern.config.json b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/fern.config.json new file mode 100644 index 00000000000..9538944f200 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/fern.config.json @@ -0,0 +1,4 @@ +{ + "version": "*", + "organization": "fern" +} diff --git a/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/generators.yml b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/generators.yml new file mode 100644 index 00000000000..ef7442a2a3e --- /dev/null +++ b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/generators.yml @@ -0,0 +1,2 @@ +openapi: openapi/openapi.yml +groups: {} diff --git a/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/openapi/openapi.yml b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/openapi/openapi.yml new file mode 100644 index 00000000000..f5b955a22e5 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/write-overrides/fixtures/petstore/fern/openapi/openapi.yml @@ -0,0 +1,113 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + operationId: listPets + tags: + - pets + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100) + required: false + schema: + type: integer + maximum: 100 + format: int32 + responses: + "200": + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: "#/components/schemas/Pets" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: Create a pet + operationId: createPets + tags: + - pets + responses: + "201": + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + "200": + description: Expected response to a valid request + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + Pet: + type: object + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + maxItems: 100 + items: + $ref: "#/components/schemas/Pet" + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string diff --git a/packages/cli/ete-tests/src/tests/write-overrides/writeOverrides.test.ts b/packages/cli/ete-tests/src/tests/write-overrides/writeOverrides.test.ts new file mode 100644 index 00000000000..4bfdf140fa8 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/write-overrides/writeOverrides.test.ts @@ -0,0 +1,34 @@ +import { AbsoluteFilePath } from "@fern-api/fs-utils"; +import { readFile } from "fs/promises"; +import path from "path"; +import { runFernCli } from "../../utils/runFernCli"; + +const FIXTURES_DIR = path.join(__dirname, "fixtures"); + +describe("overrides", () => { + itFixture("petstore"); +}); + +function itFixture(fixtureName: string) { + it( + // eslint-disable-next-line jest/valid-title + fixtureName, + async () => { + const fixturePath = path.join(FIXTURES_DIR, fixtureName); + const outputPath = path.join(fixturePath, "fern", "openapi", "openapi-overrides.yml"); + + await runFernCli(["write-overrides"], { + cwd: fixturePath + }); + + await sleep(5000); + + expect((await readFile(AbsoluteFilePath.of(outputPath))).toString()).toMatchSnapshot(); + }, + 90_000 + ); +} + +function sleep(ms: number) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} diff --git a/seed/python-sdk/alias/src/seed/client.py b/seed/python-sdk/alias/src/seed/client.py index dbaa0e31885..dd94a768e12 100644 --- a/seed/python-sdk/alias/src/seed/client.py +++ b/seed/python-sdk/alias/src/seed/client.py @@ -8,6 +8,23 @@ class SeedAlias: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedAlias + + client = SeedAlias( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -17,6 +34,23 @@ def __init__( class AsyncSeedAlias: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedAlias + + client = AsyncSeedAlias( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/api-wide-base-path/src/seed/client.py b/seed/python-sdk/api-wide-base-path/src/seed/client.py index d97787f8b74..5297cf899a7 100644 --- a/seed/python-sdk/api-wide-base-path/src/seed/client.py +++ b/seed/python-sdk/api-wide-base-path/src/seed/client.py @@ -9,6 +9,23 @@ class SeedApiWideBasePath: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedApiWideBasePath + + client = SeedApiWideBasePath( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedApiWideBasePath: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedApiWideBasePath + + client = AsyncSeedApiWideBasePath( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/audiences/src/seed/client.py b/seed/python-sdk/audiences/src/seed/client.py index 2fc32bb05fa..bb7215043ac 100644 --- a/seed/python-sdk/audiences/src/seed/client.py +++ b/seed/python-sdk/audiences/src/seed/client.py @@ -10,6 +10,23 @@ class SeedAudiences: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedAudiences + + client = SeedAudiences( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -21,6 +38,23 @@ def __init__( class AsyncSeedAudiences: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedAudiences + + client = AsyncSeedAudiences( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/auth-environment-variables/src/seed/client.py b/seed/python-sdk/auth-environment-variables/src/seed/client.py index fcf4fcb56c4..670526b9904 100644 --- a/seed/python-sdk/auth-environment-variables/src/seed/client.py +++ b/seed/python-sdk/auth-environment-variables/src/seed/client.py @@ -11,6 +11,26 @@ class SeedAuthEnvironmentVariables: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - api_key: typing.Optional[str]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedAuthEnvironmentVariables + + client = SeedAuthEnvironmentVariables( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -32,6 +52,26 @@ def __init__( class AsyncSeedAuthEnvironmentVariables: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - api_key: typing.Optional[str]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedAuthEnvironmentVariables + + client = AsyncSeedAuthEnvironmentVariables( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/basic-auth/src/seed/client.py b/seed/python-sdk/basic-auth/src/seed/client.py index 211f5b90e2c..878308e6de8 100644 --- a/seed/python-sdk/basic-auth/src/seed/client.py +++ b/seed/python-sdk/basic-auth/src/seed/client.py @@ -9,6 +9,29 @@ class SeedBasicAuth: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - username: typing.Union[str, typing.Callable[[], str]]. + + - password: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedBasicAuth + + client = SeedBasicAuth( + username="YOUR_USERNAME", + password="YOUR_PASSWORD", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -28,6 +51,29 @@ def __init__( class AsyncSeedBasicAuth: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - username: typing.Union[str, typing.Callable[[], str]]. + + - password: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedBasicAuth + + client = AsyncSeedBasicAuth( + username="YOUR_USERNAME", + password="YOUR_PASSWORD", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/bearer-token-environment-variable/src/seed/client.py b/seed/python-sdk/bearer-token-environment-variable/src/seed/client.py index 7f382649ce5..99bf74f27a2 100644 --- a/seed/python-sdk/bearer-token-environment-variable/src/seed/client.py +++ b/seed/python-sdk/bearer-token-environment-variable/src/seed/client.py @@ -11,6 +11,26 @@ class SeedBearerTokenEnvironmentVariable: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedBearerTokenEnvironmentVariable + + client = SeedBearerTokenEnvironmentVariable( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -32,6 +52,26 @@ def __init__( class AsyncSeedBearerTokenEnvironmentVariable: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - api_key: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedBearerTokenEnvironmentVariable + + client = AsyncSeedBearerTokenEnvironmentVariable( + api_key="YOUR_API_KEY", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/bytes/src/seed/client.py b/seed/python-sdk/bytes/src/seed/client.py index 7322c190941..15eaaa0e6e9 100644 --- a/seed/python-sdk/bytes/src/seed/client.py +++ b/seed/python-sdk/bytes/src/seed/client.py @@ -9,6 +9,23 @@ class SeedBytes: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedBytes + + client = SeedBytes( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedBytes: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedBytes + + client = AsyncSeedBytes( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/circular-references/src/seed/client.py b/seed/python-sdk/circular-references/src/seed/client.py index 4c0fed0e088..c5a1ba44656 100644 --- a/seed/python-sdk/circular-references/src/seed/client.py +++ b/seed/python-sdk/circular-references/src/seed/client.py @@ -8,6 +8,23 @@ class SeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedApi + + client = SeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -17,6 +34,23 @@ def __init__( class AsyncSeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedApi + + client = AsyncSeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/custom-auth/src/seed/client.py b/seed/python-sdk/custom-auth/src/seed/client.py index 16b02b4e131..0fa3dad4549 100644 --- a/seed/python-sdk/custom-auth/src/seed/client.py +++ b/seed/python-sdk/custom-auth/src/seed/client.py @@ -9,6 +9,26 @@ class SeedCustomAuth: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - custom_auth_scheme: str. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedCustomAuth + + client = SeedCustomAuth( + custom_auth_scheme="YOUR_CUSTOM_AUTH_SCHEME", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -26,6 +46,26 @@ def __init__( class AsyncSeedCustomAuth: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - custom_auth_scheme: str. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedCustomAuth + + client = AsyncSeedCustomAuth( + custom_auth_scheme="YOUR_CUSTOM_AUTH_SCHEME", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/enum/src/seed/client.py b/seed/python-sdk/enum/src/seed/client.py index 8e66d5e91cd..7bb5c1a6eff 100644 --- a/seed/python-sdk/enum/src/seed/client.py +++ b/seed/python-sdk/enum/src/seed/client.py @@ -11,6 +11,23 @@ class SeedEnum: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedEnum + + client = SeedEnum( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -23,6 +40,23 @@ def __init__( class AsyncSeedEnum: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedEnum + + client = AsyncSeedEnum( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/error-property/src/seed/client.py b/seed/python-sdk/error-property/src/seed/client.py index b089e6412db..abb834d8a0c 100644 --- a/seed/python-sdk/error-property/src/seed/client.py +++ b/seed/python-sdk/error-property/src/seed/client.py @@ -9,6 +9,23 @@ class SeedErrorProperty: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedErrorProperty + + client = SeedErrorProperty( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedErrorProperty: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedErrorProperty + + client = AsyncSeedErrorProperty( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/examples/src/seed/client.py b/seed/python-sdk/examples/src/seed/client.py index 07b470424e5..9fca21570e6 100644 --- a/seed/python-sdk/examples/src/seed/client.py +++ b/seed/python-sdk/examples/src/seed/client.py @@ -25,6 +25,29 @@ class SeedExamples: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: typing.Optional[SeedExamplesEnvironment]. The environment to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExamples + from seed.environment import SeedExamplesEnvironment + + client = SeedExamples( + token="YOUR_TOKEN", + environment=SeedExamplesEnvironment.PRODUCTION, + ) + """ + def __init__( self, *, @@ -90,6 +113,29 @@ def echo(self, *, request: str, request_options: typing.Optional[RequestOptions] class AsyncSeedExamples: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: typing.Optional[SeedExamplesEnvironment]. The environment to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExamples + from seed.environment import SeedExamplesEnvironment + + client = AsyncSeedExamples( + token="YOUR_TOKEN", + environment=SeedExamplesEnvironment.PRODUCTION, + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/exhaustive/additional_init_exports b/seed/python-sdk/exhaustive/additional_init_exports new file mode 160000 index 00000000000..39ada5cccb1 --- /dev/null +++ b/seed/python-sdk/exhaustive/additional_init_exports @@ -0,0 +1 @@ +Subproject commit 39ada5cccb116c211d76966344a2da18c944def8 diff --git a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/client.py b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/client.py index dbf97215fd8..02262763646 100644 --- a/seed/python-sdk/exhaustive/extra_dependencies/src/seed/client.py +++ b/seed/python-sdk/exhaustive/extra_dependencies/src/seed/client.py @@ -13,6 +13,26 @@ class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -34,6 +54,26 @@ def __init__( class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/client.py b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/client.py index c6d70222cee..edc3a83ec06 100644 --- a/seed/python-sdk/exhaustive/five-second-timeout/src/seed/client.py +++ b/seed/python-sdk/exhaustive/five-second-timeout/src/seed/client.py @@ -13,6 +13,26 @@ class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -34,6 +54,26 @@ def __init__( class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/client.py b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/client.py index 235b352fe41..8f94cd47633 100644 --- a/seed/python-sdk/exhaustive/infinite-timeout/src/seed/client.py +++ b/seed/python-sdk/exhaustive/infinite-timeout/src/seed/client.py @@ -13,6 +13,26 @@ class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -34,6 +54,26 @@ def __init__( class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/exhaustive/no-custom-config/src/seed/client.py b/seed/python-sdk/exhaustive/no-custom-config/src/seed/client.py index dbf97215fd8..02262763646 100644 --- a/seed/python-sdk/exhaustive/no-custom-config/src/seed/client.py +++ b/seed/python-sdk/exhaustive/no-custom-config/src/seed/client.py @@ -13,6 +13,26 @@ class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -34,6 +54,26 @@ def __init__( class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/client.py b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/client.py index dbf97215fd8..02262763646 100644 --- a/seed/python-sdk/exhaustive/pydantic-v1/src/seed/client.py +++ b/seed/python-sdk/exhaustive/pydantic-v1/src/seed/client.py @@ -13,6 +13,26 @@ class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -34,6 +54,26 @@ def __init__( class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/exhaustive/union-utils/src/seed/client.py b/seed/python-sdk/exhaustive/union-utils/src/seed/client.py index dbf97215fd8..02262763646 100644 --- a/seed/python-sdk/exhaustive/union-utils/src/seed/client.py +++ b/seed/python-sdk/exhaustive/union-utils/src/seed/client.py @@ -13,6 +13,26 @@ class SeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExhaustive + + client = SeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -34,6 +54,26 @@ def __init__( class AsyncSeedExhaustive: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExhaustive + + client = AsyncSeedExhaustive( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/extends/src/seed/client.py b/seed/python-sdk/extends/src/seed/client.py index fa183542d21..ecce653a705 100644 --- a/seed/python-sdk/extends/src/seed/client.py +++ b/seed/python-sdk/extends/src/seed/client.py @@ -8,6 +8,23 @@ class SeedExtends: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedExtends + + client = SeedExtends( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -17,6 +34,23 @@ def __init__( class AsyncSeedExtends: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedExtends + + client = AsyncSeedExtends( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/file-download/src/seed/client.py b/seed/python-sdk/file-download/src/seed/client.py index 4d4ec0984e2..0d2a3777387 100644 --- a/seed/python-sdk/file-download/src/seed/client.py +++ b/seed/python-sdk/file-download/src/seed/client.py @@ -9,6 +9,23 @@ class SeedFileDownload: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedFileDownload + + client = SeedFileDownload( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedFileDownload: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedFileDownload + + client = AsyncSeedFileDownload( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/file-upload/src/seed/client.py b/seed/python-sdk/file-upload/src/seed/client.py index fd4cb7eea18..5f8f8c68d9f 100644 --- a/seed/python-sdk/file-upload/src/seed/client.py +++ b/seed/python-sdk/file-upload/src/seed/client.py @@ -9,6 +9,23 @@ class SeedFileUpload: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedFileUpload + + client = SeedFileUpload( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedFileUpload: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedFileUpload + + client = AsyncSeedFileUpload( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/folders/src/seed/client.py b/seed/python-sdk/folders/src/seed/client.py index d8a8b0bb6e1..164583bd854 100644 --- a/seed/python-sdk/folders/src/seed/client.py +++ b/seed/python-sdk/folders/src/seed/client.py @@ -15,6 +15,23 @@ class SeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedApi + + client = SeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -60,6 +77,23 @@ def foo(self, *, request_options: typing.Optional[RequestOptions] = None) -> Non class AsyncSeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedApi + + client = AsyncSeedApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/idempotency-headers/src/seed/client.py b/seed/python-sdk/idempotency-headers/src/seed/client.py index dd21795630e..cf38a95d85a 100644 --- a/seed/python-sdk/idempotency-headers/src/seed/client.py +++ b/seed/python-sdk/idempotency-headers/src/seed/client.py @@ -9,6 +9,26 @@ class SeedIdempotencyHeaders: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedIdempotencyHeaders + + client = SeedIdempotencyHeaders( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -26,6 +46,26 @@ def __init__( class AsyncSeedIdempotencyHeaders: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedIdempotencyHeaders + + client = AsyncSeedIdempotencyHeaders( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/imdb/src/seed/client.py b/seed/python-sdk/imdb/src/seed/client.py index 02808d1a119..933e2e4e9c5 100644 --- a/seed/python-sdk/imdb/src/seed/client.py +++ b/seed/python-sdk/imdb/src/seed/client.py @@ -9,6 +9,26 @@ class SeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedApi + + client = SeedApi( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -26,6 +46,26 @@ def __init__( class AsyncSeedApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedApi + + client = AsyncSeedApi( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/literal/src/seed/client.py b/seed/python-sdk/literal/src/seed/client.py index 1167dacbf05..7d846ae2465 100644 --- a/seed/python-sdk/literal/src/seed/client.py +++ b/seed/python-sdk/literal/src/seed/client.py @@ -13,6 +13,23 @@ class SeedLiteral: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedLiteral + + client = SeedLiteral( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -27,6 +44,23 @@ def __init__( class AsyncSeedLiteral: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedLiteral + + client = AsyncSeedLiteral( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/multi-url-environment/src/seed/client.py b/seed/python-sdk/multi-url-environment/src/seed/client.py index 666c3f56673..89d70a83e08 100644 --- a/seed/python-sdk/multi-url-environment/src/seed/client.py +++ b/seed/python-sdk/multi-url-environment/src/seed/client.py @@ -11,6 +11,27 @@ class SeedMultiUrlEnvironment: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - environment: SeedMultiUrlEnvironmentEnvironment. The environment to use for requests from the client. from .environment import SeedMultiUrlEnvironmentEnvironment + + Defaults to SeedMultiUrlEnvironmentEnvironment.PRODUCTION + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedMultiUrlEnvironment + + client = SeedMultiUrlEnvironment( + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, @@ -29,6 +50,27 @@ def __init__( class AsyncSeedMultiUrlEnvironment: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - environment: SeedMultiUrlEnvironmentEnvironment. The environment to use for requests from the client. from .environment import SeedMultiUrlEnvironmentEnvironment + + Defaults to SeedMultiUrlEnvironmentEnvironment.PRODUCTION + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedMultiUrlEnvironment + + client = AsyncSeedMultiUrlEnvironment( + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/no-environment/src/seed/client.py b/seed/python-sdk/no-environment/src/seed/client.py index 3d61ea5aaa0..9673161af4a 100644 --- a/seed/python-sdk/no-environment/src/seed/client.py +++ b/seed/python-sdk/no-environment/src/seed/client.py @@ -9,6 +9,26 @@ class SeedNoEnvironment: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedNoEnvironment + + client = SeedNoEnvironment( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, @@ -26,6 +46,26 @@ def __init__( class AsyncSeedNoEnvironment: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedNoEnvironment + + client = AsyncSeedNoEnvironment( + token="YOUR_TOKEN", + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/object/src/seed/client.py b/seed/python-sdk/object/src/seed/client.py index cb76b51bcf8..ca34646ede5 100644 --- a/seed/python-sdk/object/src/seed/client.py +++ b/seed/python-sdk/object/src/seed/client.py @@ -8,6 +8,23 @@ class SeedObject: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedObject + + client = SeedObject( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -17,6 +34,23 @@ def __init__( class AsyncSeedObject: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedObject + + client = AsyncSeedObject( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/objects-with-imports/src/seed/client.py b/seed/python-sdk/objects-with-imports/src/seed/client.py index 41bf973a7d8..9f8423d7cba 100644 --- a/seed/python-sdk/objects-with-imports/src/seed/client.py +++ b/seed/python-sdk/objects-with-imports/src/seed/client.py @@ -8,6 +8,23 @@ class SeedObjectsWithImports: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedObjectsWithImports + + client = SeedObjectsWithImports( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -17,6 +34,23 @@ def __init__( class AsyncSeedObjectsWithImports: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedObjectsWithImports + + client = AsyncSeedObjectsWithImports( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/optional/src/seed/client.py b/seed/python-sdk/optional/src/seed/client.py index 64a0a0e1a02..2d6d976d3e2 100644 --- a/seed/python-sdk/optional/src/seed/client.py +++ b/seed/python-sdk/optional/src/seed/client.py @@ -9,6 +9,23 @@ class SeedObjectsWithImports: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedObjectsWithImports + + client = SeedObjectsWithImports( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedObjectsWithImports: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedObjectsWithImports + + client = AsyncSeedObjectsWithImports( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/package-yml/src/seed/client.py b/seed/python-sdk/package-yml/src/seed/client.py index c5537373ba5..5e16ef932ae 100644 --- a/seed/python-sdk/package-yml/src/seed/client.py +++ b/seed/python-sdk/package-yml/src/seed/client.py @@ -23,6 +23,23 @@ class SeedPackageYml: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedPackageYml + + client = SeedPackageYml( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -79,6 +96,23 @@ def echo(self, id: str, *, request: str, request_options: typing.Optional[Reques class AsyncSeedPackageYml: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedPackageYml + + client = AsyncSeedPackageYml( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/plain-text/src/seed/client.py b/seed/python-sdk/plain-text/src/seed/client.py index ad644d6b19e..ed9c5b499ab 100644 --- a/seed/python-sdk/plain-text/src/seed/client.py +++ b/seed/python-sdk/plain-text/src/seed/client.py @@ -9,6 +9,23 @@ class SeedPlainText: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedPlainText + + client = SeedPlainText( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedPlainText: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedPlainText + + client = AsyncSeedPlainText( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/query-parameters/src/seed/client.py b/seed/python-sdk/query-parameters/src/seed/client.py index f70d9f58188..2a753fc477e 100644 --- a/seed/python-sdk/query-parameters/src/seed/client.py +++ b/seed/python-sdk/query-parameters/src/seed/client.py @@ -9,6 +9,23 @@ class SeedQueryParameters: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedQueryParameters + + client = SeedQueryParameters( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedQueryParameters: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedQueryParameters + + client = AsyncSeedQueryParameters( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/reserved-keywords/src/seed/client.py b/seed/python-sdk/reserved-keywords/src/seed/client.py index 7493fe286c8..e4ecada6d5b 100644 --- a/seed/python-sdk/reserved-keywords/src/seed/client.py +++ b/seed/python-sdk/reserved-keywords/src/seed/client.py @@ -9,6 +9,23 @@ class SeedNurseryApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedNurseryApi + + client = SeedNurseryApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedNurseryApi: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedNurseryApi + + client = AsyncSeedNurseryApi( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/seed.yml b/seed/python-sdk/seed.yml index 40da9af90e5..f180fc4b99e 100644 --- a/seed/python-sdk/seed.yml +++ b/seed/python-sdk/seed.yml @@ -26,6 +26,13 @@ fixtures: extra_dependencies: boto3: 1.28.57 outputFolder: extra_dependencies + - customConfig: + additional_init_exports: + - from: client_additions + imports: + - myCustomFunction + - AnotherCustomClient + outputFolder: additional_init_exports scripts: - docker: fernapi/python-seed commands: @@ -42,4 +49,5 @@ allowedFailures: - auth-environment-variables - bearer-token-environment-variable - websocket - - exhaustive:union-utils \ No newline at end of file + - exhaustive:union-utils + - exhaustive:additional_init_exports \ No newline at end of file diff --git a/seed/python-sdk/single-url-environment-default/src/seed/client.py b/seed/python-sdk/single-url-environment-default/src/seed/client.py index eb177014c4a..ddf2181ab94 100644 --- a/seed/python-sdk/single-url-environment-default/src/seed/client.py +++ b/seed/python-sdk/single-url-environment-default/src/seed/client.py @@ -10,6 +10,29 @@ class SeedSingleUrlEnvironmentDefault: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: SeedSingleUrlEnvironmentDefaultEnvironment. The environment to use for requests from the client. from .environment import SeedSingleUrlEnvironmentDefaultEnvironment + + Defaults to SeedSingleUrlEnvironmentDefaultEnvironment.PRODUCTION + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedSingleUrlEnvironmentDefault + + client = SeedSingleUrlEnvironmentDefault( + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, @@ -28,6 +51,29 @@ def __init__( class AsyncSeedSingleUrlEnvironmentDefault: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: SeedSingleUrlEnvironmentDefaultEnvironment. The environment to use for requests from the client. from .environment import SeedSingleUrlEnvironmentDefaultEnvironment + + Defaults to SeedSingleUrlEnvironmentDefaultEnvironment.PRODUCTION + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedSingleUrlEnvironmentDefault + + client = AsyncSeedSingleUrlEnvironmentDefault( + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/single-url-environment-no-default/src/seed/client.py b/seed/python-sdk/single-url-environment-no-default/src/seed/client.py index dab18b8deaf..cd425b646cf 100644 --- a/seed/python-sdk/single-url-environment-no-default/src/seed/client.py +++ b/seed/python-sdk/single-url-environment-no-default/src/seed/client.py @@ -10,6 +10,29 @@ class SeedSingleUrlEnvironmentNoDefault: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: typing.Optional[SeedSingleUrlEnvironmentNoDefaultEnvironment]. The environment to use for requests from the client. + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedSingleUrlEnvironmentNoDefault + from seed.environment import SeedSingleUrlEnvironmentNoDefaultEnvironment + + client = SeedSingleUrlEnvironmentNoDefault( + token="YOUR_TOKEN", + environment=SeedSingleUrlEnvironmentNoDefaultEnvironment.PRODUCTION, + ) + """ + def __init__( self, *, @@ -28,6 +51,29 @@ def __init__( class AsyncSeedSingleUrlEnvironmentNoDefault: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: typing.Optional[SeedSingleUrlEnvironmentNoDefaultEnvironment]. The environment to use for requests from the client. + + - token: typing.Union[str, typing.Callable[[], str]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedSingleUrlEnvironmentNoDefault + from seed.environment import SeedSingleUrlEnvironmentNoDefaultEnvironment + + client = AsyncSeedSingleUrlEnvironmentNoDefault( + token="YOUR_TOKEN", + environment=SeedSingleUrlEnvironmentNoDefaultEnvironment.PRODUCTION, + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/streaming/src/seed/client.py b/seed/python-sdk/streaming/src/seed/client.py index b37406bf02e..55a5a94b1ba 100644 --- a/seed/python-sdk/streaming/src/seed/client.py +++ b/seed/python-sdk/streaming/src/seed/client.py @@ -9,6 +9,23 @@ class SeedStreaming: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedStreaming + + client = SeedStreaming( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedStreaming: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedStreaming + + client = AsyncSeedStreaming( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/trace/src/seed/client.py b/seed/python-sdk/trace/src/seed/client.py index 45d077f631a..69fa40b1d9c 100644 --- a/seed/python-sdk/trace/src/seed/client.py +++ b/seed/python-sdk/trace/src/seed/client.py @@ -17,6 +17,32 @@ class SeedTrace: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: SeedTraceEnvironment. The environment to use for requests from the client. from .environment import SeedTraceEnvironment + + Defaults to SeedTraceEnvironment.PROD + + - x_random_header: typing.Optional[str]. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedTrace + + client = SeedTrace( + x_random_header="YOUR_X_RANDOM_HEADER", + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, @@ -44,6 +70,32 @@ def __init__( class AsyncSeedTrace: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: typing.Optional[str]. The base url to use for requests from the client. + + - environment: SeedTraceEnvironment. The environment to use for requests from the client. from .environment import SeedTraceEnvironment + + Defaults to SeedTraceEnvironment.PROD + + - x_random_header: typing.Optional[str]. + + - token: typing.Optional[typing.Union[str, typing.Callable[[], str]]]. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedTrace + + client = AsyncSeedTrace( + x_random_header="YOUR_X_RANDOM_HEADER", + token="YOUR_TOKEN", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/undiscriminated-unions/src/seed/client.py b/seed/python-sdk/undiscriminated-unions/src/seed/client.py index 4aab784c688..c4128c7e6e1 100644 --- a/seed/python-sdk/undiscriminated-unions/src/seed/client.py +++ b/seed/python-sdk/undiscriminated-unions/src/seed/client.py @@ -9,6 +9,23 @@ class SeedUndiscriminatedUnions: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedUndiscriminatedUnions + + client = SeedUndiscriminatedUnions( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedUndiscriminatedUnions: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedUndiscriminatedUnions + + client = AsyncSeedUndiscriminatedUnions( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/unknown/src/seed/client.py b/seed/python-sdk/unknown/src/seed/client.py index d27d6288313..d840138ecf7 100644 --- a/seed/python-sdk/unknown/src/seed/client.py +++ b/seed/python-sdk/unknown/src/seed/client.py @@ -9,6 +9,23 @@ class SeedUnknownAsAny: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedUnknownAsAny + + client = SeedUnknownAsAny( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedUnknownAsAny: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedUnknownAsAny + + client = AsyncSeedUnknownAsAny( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, diff --git a/seed/python-sdk/variables/src/seed/client.py b/seed/python-sdk/variables/src/seed/client.py index 2f3a9534e4b..0dc26617138 100644 --- a/seed/python-sdk/variables/src/seed/client.py +++ b/seed/python-sdk/variables/src/seed/client.py @@ -9,6 +9,23 @@ class SeedVariables: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.Client]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import SeedVariables + + client = SeedVariables( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *, base_url: str, timeout: typing.Optional[float] = 60, httpx_client: typing.Optional[httpx.Client] = None ): @@ -19,6 +36,23 @@ def __init__( class AsyncSeedVariables: + """ + Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propogate to these functions. + + Parameters: + - base_url: str. The base url to use for requests from the client. + + - timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds. + + - httpx_client: typing.Optional[httpx.AsyncClient]. The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration. + --- + from seed.client import AsyncSeedVariables + + client = AsyncSeedVariables( + base_url="https://yourhost.com/path/to/api", + ) + """ + def __init__( self, *,