From ded1b143791e7d94e339035edb62e1cfbb55c5c1 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 26 Feb 2025 00:10:47 +0000 Subject: [PATCH 1/2] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.504.1 --- .speakeasy/gen.lock | 16 +++++------ .speakeasy/workflow.lock | 10 +++---- README.md | 31 +++++++++++++++------ RELEASES.md | 10 +++++++ USAGE.md | 8 ++++-- docs/sdks/destinations/README.md | 20 +++++++++---- docs/sdks/general/README.md | 4 ++- docs/sdks/jobs/README.md | 12 ++++++-- docs/sdks/sources/README.md | 20 +++++++++---- docs/sdks/workflows/README.md | 24 ++++++++++++---- gen.yaml | 5 ++-- pyproject.toml | 2 +- src/unstructured_client/_version.py | 6 ++-- src/unstructured_client/sdk.py | 10 ++----- src/unstructured_client/sdkconfiguration.py | 5 +--- src/unstructured_client/utils/__init__.py | 2 ++ src/unstructured_client/utils/values.py | 5 +++- 17 files changed, 127 insertions(+), 63 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c868cefc..598b6740 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b5fa338-9106-4734-abf0-e30d67044a90 management: - docChecksum: 622461ba121cc2a105e29eab97b6bee3 + docChecksum: eb050201e8bfff645042e3b2847104cc docVersion: 1.0.68 - speakeasyVersion: 1.490.0 - generationVersion: 2.512.0 - releaseVersion: 0.30.4 - configChecksum: 87e53f0ca57296c4cae62d4792edc2cf + speakeasyVersion: 1.504.1 + generationVersion: 2.529.2 + releaseVersion: 0.31.0 + configChecksum: faf5191e78f1597b78cd7600af4f1d96 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -16,7 +16,7 @@ features: acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.11.0 + core: 5.12.1 defaultEnabledRetries: 0.2.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 @@ -27,11 +27,11 @@ features: methodServerURLs: 3.1.1 multipartFileContentType: 1.0.0 nameOverrides: 3.0.1 - nullables: 1.0.0 + nullables: 1.0.1 openEnums: 1.0.0 responseFormat: 1.0.1 retries: 3.0.2 - sdkHooks: 1.0.0 + sdkHooks: 1.0.1 serverIDs: 3.0.0 unions: 3.0.4 uploadStreams: 1.0.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d2a0e0e9..b5b27aa7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.501.0 +speakeasyVersion: 1.504.1 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:aafca097133621c9d805647795672de6a443518d28ccff1ba4ad207084ada140 + sourceRevisionDigest: sha256:4f63229dca06781c54905bcb9c2769ef714dccbd7b347d72ed6b9c0a57f768f9 sourceBlobDigest: sha256:24d7c75ebda9119f02eec391b4ac5697e7f909341f1694177d9d164ff90e39be tags: - latest - - speakeasy-sdk-regen-1740182957 + - speakeasy-sdk-regen-1740499439 - 1.0.68 targets: unstructured-python: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:aafca097133621c9d805647795672de6a443518d28ccff1ba4ad207084ada140 + sourceRevisionDigest: sha256:4f63229dca06781c54905bcb9c2769ef714dccbd7b347d72ed6b9c0a57f768f9 sourceBlobDigest: sha256:24d7c75ebda9119f02eec391b4ac5697e7f909341f1694177d9d164ff90e39be codeSamplesNamespace: my-source-code-samples - codeSamplesRevisionDigest: sha256:45129928113c916a9525093bb2e25021b8e62477fa2b86de2af2dc369294a555 + codeSamplesRevisionDigest: sha256:c7f49ae4ef636cb4f1f872f62dbec7312d7cff92d59e1de774428843f0474b91 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index fff05426..d9b3c045 100755 --- a/README.md +++ b/README.md @@ -113,7 +113,9 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -142,6 +144,7 @@ from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig with UnstructuredClient( + server_url="https://api.example.com", retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), ) as uc_client: @@ -193,7 +196,9 @@ When custom error responses are specified for an operation, the SDK may also rai from unstructured_client import UnstructuredClient from unstructured_client.models import errors, shared -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = None try: @@ -325,7 +330,9 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -355,7 +362,9 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared async def main(): - async with UnstructuredClient() as uc_client: + async with UnstructuredClient( + server_url="https://api.example.com", + ) as uc_client: res = await uc_client.destinations.create_destination_async(request={ "create_destination_connector": { @@ -450,7 +459,9 @@ Certain SDK methods accept file objects as part of a request body or multi-part ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.general.partition(request={ "partition_parameters": { @@ -483,13 +494,17 @@ The `UnstructuredClient` class implements the context manager protocol and regis ```python from unstructured_client import UnstructuredClient def main(): - with UnstructuredClient() as uc_client: + with UnstructuredClient( + server_url="https://api.example.com", + ) as uc_client: # Rest of application here... # Or when using async: async def amain(): - async with UnstructuredClient() as uc_client: + async with UnstructuredClient( + server_url="https://api.example.com", + ) as uc_client: # Rest of application here... ``` @@ -505,7 +520,7 @@ from unstructured_client import UnstructuredClient import logging logging.basicConfig(level=logging.DEBUG) -s = UnstructuredClient(debug_logger=logging.getLogger("unstructured_client")) +s = UnstructuredClient(server_url="https://example.com", debug_logger=logging.getLogger("unstructured_client")) ``` diff --git a/RELEASES.md b/RELEASES.md index 20a2b015..24787505 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -814,4 +814,14 @@ Based on: ### Generated - [python v0.31.0] . ### Releases +- [PyPI v0.31.0] https://pypi.org/project/unstructured-client/0.31.0 - . + +## 2025-02-26 00:09:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.504.1 (2.529.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.31.0] . +### Releases - [PyPI v0.31.0] https://pypi.org/project/unstructured-client/0.31.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 808460d6..85d3bb7e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,7 +4,9 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -34,7 +36,9 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared async def main(): - async with UnstructuredClient() as uc_client: + async with UnstructuredClient( + server_url="https://api.example.com", + ) as uc_client: res = await uc_client.destinations.create_destination_async(request={ "create_destination_connector": { diff --git a/docs/sdks/destinations/README.md b/docs/sdks/destinations/README.md index bbaacac1..e8dc7237 100644 --- a/docs/sdks/destinations/README.md +++ b/docs/sdks/destinations/README.md @@ -21,7 +21,9 @@ Create a new destination connector using the provided configuration and name. from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -70,7 +72,9 @@ Delete a specific destination connector by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.delete_destination(request={ "destination_id": "10a88d76-65fb-4c88-8488-9e7d272c6373", @@ -111,7 +115,9 @@ Retrieve detailed information for a specific destination connector by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.get_destination(request={ "destination_id": "41ba03fb-faa3-4e9e-8cfb-27f133c4198a", @@ -152,7 +158,9 @@ Retrieve a list of available destination connectors. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.list_destinations(request={}) @@ -191,7 +199,9 @@ Update the configuration of an existing destination connector. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.destinations.update_destination(request={ "update_destination_connector": { diff --git a/docs/sdks/general/README.md b/docs/sdks/general/README.md index 42d934a9..01478d1e 100644 --- a/docs/sdks/general/README.md +++ b/docs/sdks/general/README.md @@ -16,7 +16,9 @@ Description ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.general.partition(request={ "partition_parameters": { diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index b92d2baa..0f5ca224 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -18,7 +18,9 @@ Cancel the specified job. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.jobs.cancel_job(request={ "job_id": "ec29bf67-0f30-4793-b5ee-8fc0da196032", @@ -59,7 +61,9 @@ Retrieve detailed information for a specific job by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.jobs.get_job(request={ "job_id": "6bb4cb72-a072-4398-9de3-194e59352a3c", @@ -100,7 +104,9 @@ Retrieve a list of jobs with optional filtering by workflow ID or job status. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.jobs.list_jobs(request={}) diff --git a/docs/sdks/sources/README.md b/docs/sdks/sources/README.md index 49b165c8..28a3382e 100644 --- a/docs/sdks/sources/README.md +++ b/docs/sdks/sources/README.md @@ -21,7 +21,9 @@ Create a new source connector using the provided configuration and name. from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.sources.create_source(request={ "create_source_connector": { @@ -75,7 +77,9 @@ Delete a specific source connector identified by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.sources.delete_source(request={ "source_id": "8a24d7ae-5524-45e9-83f9-b0adba5303d4", @@ -116,7 +120,9 @@ Retrieve detailed information for a specific source connector by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.sources.get_source(request={ "source_id": "e02d8147-b614-4e4c-9c6d-0cd9c4492ea0", @@ -157,7 +163,9 @@ Retrieve a list of available source connectors. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.sources.list_sources(request={}) @@ -196,7 +204,9 @@ Update the configuration of an existing source connector. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.sources.update_source(request={ "update_source_connector": { diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index a420809a..a73c9d4c 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -22,7 +22,9 @@ Create a new workflow, either custom or auto, and configure its settings. from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.workflows.create_workflow(request={ "create_workflow": { @@ -69,7 +71,9 @@ Delete a workflow by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.workflows.delete_workflow(request={ "workflow_id": "26c0bd77-269e-4239-86b8-71541359440c", @@ -110,7 +114,9 @@ Retrieve detailed information for a specific workflow by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.workflows.get_workflow(request={ "workflow_id": "270d9bb5-13f1-4e4d-bb84-4bcc30c93967", @@ -151,7 +157,9 @@ Retrieve a list of workflows, optionally filtered by source, destination, or sta ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.workflows.list_workflows(request={}) @@ -190,7 +198,9 @@ Run a workflow by triggering a new job if none is currently active. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.workflows.run_workflow(request={ "workflow_id": "6b67be6d-98e9-440c-88fd-721e5d2d0036", @@ -231,7 +241,9 @@ Update an existing workflow's name, connectors, schedule, or workflow type. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient() as uc_client: +with UnstructuredClient( + server_url="https://api.example.com", +) as uc_client: res = uc_client.workflows.update_workflow(request={ "update_workflow": {}, diff --git a/gen.yaml b/gen.yaml index 74a52973..0063214f 100644 --- a/gen.yaml +++ b/gen.yaml @@ -4,16 +4,15 @@ generation: usageSnippets: optionalPropertyRendering: withExample fixes: - nameResolutionDec2023: false + nameResolutionFeb2025: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false securityFeb2025: false - nameResolutionFeb2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.30.4 + version: 0.31.0 additionalDependencies: dev: deepdiff: '>=6.0' diff --git a/pyproject.toml b/pyproject.toml index 2f73c51d..f098ea67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.30.4" +version = "0.31.0" description = "Python Client SDK for Unstructured API" authors = [{ name = "Unstructured" },] readme = "README-PYPI.md" diff --git a/src/unstructured_client/_version.py b/src/unstructured_client/_version.py index c59772f1..18ffb22b 100644 --- a/src/unstructured_client/_version.py +++ b/src/unstructured_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "unstructured-client" -__version__: str = "0.30.4" +__version__: str = "0.31.0" __openapi_doc_version__: str = "1.0.68" -__gen_version__: str = "2.512.0" -__user_agent__: str = "speakeasy-sdk/python 0.30.4 2.512.0 1.0.68 unstructured-client" +__gen_version__: str = "2.529.2" +__user_agent__: str = "speakeasy-sdk/python 0.31.0 2.529.2 1.0.68 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/sdk.py b/src/unstructured_client/sdk.py index e21b56e2..92f3114d 100644 --- a/src/unstructured_client/sdk.py +++ b/src/unstructured_client/sdk.py @@ -6,8 +6,7 @@ from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig import httpx -from typing import Any, Callable, Dict, Optional, Union, cast -from unstructured_client import utils +from typing import Any, Callable, Optional, Union, cast from unstructured_client._hooks import SDKHooks from unstructured_client.destinations import Destinations from unstructured_client.general import General @@ -28,11 +27,10 @@ class UnstructuredClient(BaseSDK): def __init__( self, + server_url: str, api_key_auth: Optional[ Union[Optional[str], Callable[[], Optional[str]]] ] = None, - server_url: Optional[str] = None, - url_params: Optional[Dict[str, str]] = None, client: Optional[HttpClient] = None, async_client: Optional[AsyncHttpClient] = None, retry_config: OptionalNullable[RetryConfig] = UNSET, @@ -73,10 +71,6 @@ def __init__( else: security = shared.Security(api_key_auth=api_key_auth) - if server_url is not None: - if url_params is not None: - server_url = utils.template_url(server_url, url_params) - BaseSDK.__init__( self, SDKConfiguration( diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index 5850fb5d..336d2488 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -21,8 +21,8 @@ class SDKConfiguration: client: HttpClient async_client: AsyncHttpClient debug_logger: Logger + server_url: str security: Optional[Union[shared.Security, Callable[[], shared.Security]]] = None - server_url: Optional[str] = "" language: str = "python" openapi_doc_version: str = __openapi_doc_version__ sdk_version: str = __version__ @@ -35,9 +35,6 @@ def __post_init__(self): self._hooks = SDKHooks() def get_server_details(self) -> Tuple[str, Dict[str, str]]: - if self.server_url is None: - return "", {} - return remove_suffix(self.server_url, "/"), {} def get_hooks(self) -> SDKHooks: diff --git a/src/unstructured_client/utils/__init__.py b/src/unstructured_client/utils/__init__.py index 26d51ae8..3cded8fe 100644 --- a/src/unstructured_client/utils/__init__.py +++ b/src/unstructured_client/utils/__init__.py @@ -42,6 +42,7 @@ match_content_type, match_status_codes, match_response, + cast_partial, ) from .logger import Logger, get_body_content, get_default_logger @@ -94,4 +95,5 @@ "validate_float", "validate_int", "validate_open_enum", + "cast_partial", ] diff --git a/src/unstructured_client/utils/values.py b/src/unstructured_client/utils/values.py index 2b4b6832..dae01a44 100644 --- a/src/unstructured_client/utils/values.py +++ b/src/unstructured_client/utils/values.py @@ -3,8 +3,9 @@ from datetime import datetime from enum import Enum from email.message import Message +from functools import partial import os -from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast from httpx import Response from pydantic import BaseModel @@ -51,6 +52,8 @@ def match_status_codes(status_codes: List[str], status_code: int) -> bool: T = TypeVar("T") +def cast_partial(typ): + return partial(cast, typ) def get_global_from_env( value: Optional[T], env_key: str, type_cast: Callable[[str], T] From 9887cd5e263b1bb449ef0196041d1018f2067bc5 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Wed, 26 Feb 2025 11:13:06 -0500 Subject: [PATCH 2/2] Revert to speakeasy==1.490.0 and regenerate Spec changes: - Add Box as source connector - Fix WorkflowNodeSettings not accepting any fields --- .speakeasy/gen.lock | 21 +++++++------ README.md | 31 +++++-------------- USAGE.md | 8 ++--- .../models/shared/boxsourceconnectorconfig.md | 9 ++++++ .../shared/boxsourceconnectorconfiginput.md | 10 ++++++ .../shared/createsourceconnectorconfig.md | 6 ++++ docs/models/shared/settings.md | 7 ----- .../sourceconnectorinformationconfig.md | 6 ++++ docs/models/shared/sourceconnectortype.md | 1 + .../shared/updatesourceconnectorconfig.md | 6 ++++ docs/models/shared/workflownode.md | 12 +++---- docs/sdks/destinations/README.md | 20 +++--------- docs/sdks/general/README.md | 4 +-- docs/sdks/jobs/README.md | 12 ++----- docs/sdks/sources/README.md | 20 +++--------- docs/sdks/workflows/README.md | 24 ++++---------- gen.yaml | 5 +-- pyproject.toml | 2 +- src/unstructured_client/_version.py | 6 ++-- .../models/shared/__init__.py | 21 ++++++++----- .../models/shared/boxsourceconnectorconfig.py | 16 ++++++++++ .../shared/boxsourceconnectorconfiginput.py | 20 ++++++++++++ .../models/shared/createsourceconnector.py | 10 ++++-- .../shared/sourceconnectorinformation.py | 10 ++++-- .../models/shared/sourceconnectortype.py | 1 + .../models/shared/updatesourceconnector.py | 10 ++++-- .../models/shared/workflownode.py | 13 ++------ src/unstructured_client/sdk.py | 10 ++++-- src/unstructured_client/sdkconfiguration.py | 5 ++- src/unstructured_client/utils/__init__.py | 2 -- src/unstructured_client/utils/values.py | 5 +-- 31 files changed, 183 insertions(+), 150 deletions(-) create mode 100644 docs/models/shared/boxsourceconnectorconfig.md create mode 100644 docs/models/shared/boxsourceconnectorconfiginput.md delete mode 100644 docs/models/shared/settings.md create mode 100644 src/unstructured_client/models/shared/boxsourceconnectorconfig.py create mode 100644 src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 598b6740..ef835b94 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b5fa338-9106-4734-abf0-e30d67044a90 management: - docChecksum: eb050201e8bfff645042e3b2847104cc + docChecksum: 0f9100e28d13105be2af4e576ea4572c docVersion: 1.0.68 - speakeasyVersion: 1.504.1 - generationVersion: 2.529.2 - releaseVersion: 0.31.0 - configChecksum: faf5191e78f1597b78cd7600af4f1d96 + speakeasyVersion: 1.490.0 + generationVersion: 2.512.0 + releaseVersion: 0.30.5 + configChecksum: 25a75f7add3305b685de164ad454cb9a repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -16,7 +16,7 @@ features: acceptHeaders: 3.0.0 additionalDependencies: 1.0.0 constsAndDefaults: 1.0.5 - core: 5.12.1 + core: 5.11.0 defaultEnabledRetries: 0.2.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.3.2 @@ -27,11 +27,11 @@ features: methodServerURLs: 3.1.1 multipartFileContentType: 1.0.0 nameOverrides: 3.0.1 - nullables: 1.0.1 + nullables: 1.0.0 openEnums: 1.0.0 responseFormat: 1.0.1 retries: 3.0.2 - sdkHooks: 1.0.1 + sdkHooks: 1.0.0 serverIDs: 3.0.0 unions: 3.0.4 uploadStreams: 1.0.0 @@ -89,6 +89,8 @@ generatedFiles: - docs/models/shared/azureaisearchconnectorconfiginput.md - docs/models/shared/azuresourceconnectorconfig.md - docs/models/shared/azuresourceconnectorconfiginput.md + - docs/models/shared/boxsourceconnectorconfig.md + - docs/models/shared/boxsourceconnectorconfiginput.md - docs/models/shared/config.md - docs/models/shared/confluencesourceconnectorconfig.md - docs/models/shared/confluencesourceconnectorconfiginput.md @@ -155,7 +157,6 @@ generatedFiles: - docs/models/shared/salesforcesourceconnectorconfiginput.md - docs/models/shared/schedule.md - docs/models/shared/security.md - - docs/models/shared/settings.md - docs/models/shared/sharepointsourceconnectorconfig.md - docs/models/shared/sharepointsourceconnectorconfiginput.md - docs/models/shared/snowflakedestinationconnectorconfig.md @@ -235,6 +236,8 @@ generatedFiles: - src/unstructured_client/models/shared/azureaisearchconnectorconfiginput.py - src/unstructured_client/models/shared/azuresourceconnectorconfig.py - src/unstructured_client/models/shared/azuresourceconnectorconfiginput.py + - src/unstructured_client/models/shared/boxsourceconnectorconfig.py + - src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py - src/unstructured_client/models/shared/confluencesourceconnectorconfig.py - src/unstructured_client/models/shared/confluencesourceconnectorconfiginput.py - src/unstructured_client/models/shared/couchbasedestinationconnectorconfig.py diff --git a/README.md b/README.md index d9b3c045..fff05426 100755 --- a/README.md +++ b/README.md @@ -113,9 +113,7 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -144,7 +142,6 @@ from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig with UnstructuredClient( - server_url="https://api.example.com", retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), ) as uc_client: @@ -196,9 +193,7 @@ When custom error responses are specified for an operation, the SDK may also rai from unstructured_client import UnstructuredClient from unstructured_client.models import errors, shared -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = None try: @@ -330,9 +325,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -362,9 +355,7 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared async def main(): - async with UnstructuredClient( - server_url="https://api.example.com", - ) as uc_client: + async with UnstructuredClient() as uc_client: res = await uc_client.destinations.create_destination_async(request={ "create_destination_connector": { @@ -459,9 +450,7 @@ Certain SDK methods accept file objects as part of a request body or multi-part ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.general.partition(request={ "partition_parameters": { @@ -494,17 +483,13 @@ The `UnstructuredClient` class implements the context manager protocol and regis ```python from unstructured_client import UnstructuredClient def main(): - with UnstructuredClient( - server_url="https://api.example.com", - ) as uc_client: + with UnstructuredClient() as uc_client: # Rest of application here... # Or when using async: async def amain(): - async with UnstructuredClient( - server_url="https://api.example.com", - ) as uc_client: + async with UnstructuredClient() as uc_client: # Rest of application here... ``` @@ -520,7 +505,7 @@ from unstructured_client import UnstructuredClient import logging logging.basicConfig(level=logging.DEBUG) -s = UnstructuredClient(server_url="https://example.com", debug_logger=logging.getLogger("unstructured_client")) +s = UnstructuredClient(debug_logger=logging.getLogger("unstructured_client")) ``` diff --git a/USAGE.md b/USAGE.md index 85d3bb7e..808460d6 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,9 +4,7 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -36,9 +34,7 @@ from unstructured_client import UnstructuredClient from unstructured_client.models import shared async def main(): - async with UnstructuredClient( - server_url="https://api.example.com", - ) as uc_client: + async with UnstructuredClient() as uc_client: res = await uc_client.destinations.create_destination_async(request={ "create_destination_connector": { diff --git a/docs/models/shared/boxsourceconnectorconfig.md b/docs/models/shared/boxsourceconnectorconfig.md new file mode 100644 index 00000000..37497ee9 --- /dev/null +++ b/docs/models/shared/boxsourceconnectorconfig.md @@ -0,0 +1,9 @@ +# BoxSourceConnectorConfig + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `box_app_config` | *str* | :heavy_check_mark: | N/A | +| `recursive` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/boxsourceconnectorconfiginput.md b/docs/models/shared/boxsourceconnectorconfiginput.md new file mode 100644 index 00000000..bca0c2c3 --- /dev/null +++ b/docs/models/shared/boxsourceconnectorconfiginput.md @@ -0,0 +1,10 @@ +# BoxSourceConnectorConfigInput + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `box_app_config` | *str* | :heavy_check_mark: | N/A | +| `remote_url` | *str* | :heavy_check_mark: | N/A | +| `recursive` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createsourceconnectorconfig.md b/docs/models/shared/createsourceconnectorconfig.md index f439be7e..3d302e5c 100644 --- a/docs/models/shared/createsourceconnectorconfig.md +++ b/docs/models/shared/createsourceconnectorconfig.md @@ -9,6 +9,12 @@ value: shared.AzureSourceConnectorConfigInput = /* values here */ ``` +### `shared.BoxSourceConnectorConfigInput` + +```python +value: shared.BoxSourceConnectorConfigInput = /* values here */ +``` + ### `shared.ConfluenceSourceConnectorConfigInput` ```python diff --git a/docs/models/shared/settings.md b/docs/models/shared/settings.md deleted file mode 100644 index a1173742..00000000 --- a/docs/models/shared/settings.md +++ /dev/null @@ -1,7 +0,0 @@ -# Settings - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/shared/sourceconnectorinformationconfig.md b/docs/models/shared/sourceconnectorinformationconfig.md index e6c3bb9a..4752b840 100644 --- a/docs/models/shared/sourceconnectorinformationconfig.md +++ b/docs/models/shared/sourceconnectorinformationconfig.md @@ -9,6 +9,12 @@ value: shared.AzureSourceConnectorConfig = /* values here */ ``` +### `shared.BoxSourceConnectorConfig` + +```python +value: shared.BoxSourceConnectorConfig = /* values here */ +``` + ### `shared.ConfluenceSourceConnectorConfig` ```python diff --git a/docs/models/shared/sourceconnectortype.md b/docs/models/shared/sourceconnectortype.md index b98d389b..acd81831 100644 --- a/docs/models/shared/sourceconnectortype.md +++ b/docs/models/shared/sourceconnectortype.md @@ -6,6 +6,7 @@ | Name | Value | | -------------------- | -------------------- | | `AZURE` | azure | +| `BOX` | box | | `CONFLUENCE` | confluence | | `COUCHBASE` | couchbase | | `DATABRICKS_VOLUMES` | databricks_volumes | diff --git a/docs/models/shared/updatesourceconnectorconfig.md b/docs/models/shared/updatesourceconnectorconfig.md index d557f03d..43ad9588 100644 --- a/docs/models/shared/updatesourceconnectorconfig.md +++ b/docs/models/shared/updatesourceconnectorconfig.md @@ -9,6 +9,12 @@ value: shared.AzureSourceConnectorConfigInput = /* values here */ ``` +### `shared.BoxSourceConnectorConfigInput` + +```python +value: shared.BoxSourceConnectorConfigInput = /* values here */ +``` + ### `shared.ConfluenceSourceConnectorConfigInput` ```python diff --git a/docs/models/shared/workflownode.md b/docs/models/shared/workflownode.md index 192770e4..378657bd 100644 --- a/docs/models/shared/workflownode.md +++ b/docs/models/shared/workflownode.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | -| `subtype` | *str* | :heavy_check_mark: | N/A | -| `type` | [shared.WorkflowNodeType](../../models/shared/workflownodetype.md) | :heavy_check_mark: | N/A | -| `settings` | [OptionalNullable[shared.Settings]](../../models/shared/settings.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | +| `subtype` | *str* | :heavy_check_mark: | N/A | +| `type` | [shared.WorkflowNodeType](../../models/shared/workflownodetype.md) | :heavy_check_mark: | N/A | +| `settings` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/destinations/README.md b/docs/sdks/destinations/README.md index e8dc7237..bbaacac1 100644 --- a/docs/sdks/destinations/README.md +++ b/docs/sdks/destinations/README.md @@ -21,9 +21,7 @@ Create a new destination connector using the provided configuration and name. from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.create_destination(request={ "create_destination_connector": { @@ -72,9 +70,7 @@ Delete a specific destination connector by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.delete_destination(request={ "destination_id": "10a88d76-65fb-4c88-8488-9e7d272c6373", @@ -115,9 +111,7 @@ Retrieve detailed information for a specific destination connector by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.get_destination(request={ "destination_id": "41ba03fb-faa3-4e9e-8cfb-27f133c4198a", @@ -158,9 +152,7 @@ Retrieve a list of available destination connectors. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.list_destinations(request={}) @@ -199,9 +191,7 @@ Update the configuration of an existing destination connector. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.destinations.update_destination(request={ "update_destination_connector": { diff --git a/docs/sdks/general/README.md b/docs/sdks/general/README.md index 01478d1e..42d934a9 100644 --- a/docs/sdks/general/README.md +++ b/docs/sdks/general/README.md @@ -16,9 +16,7 @@ Description ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.general.partition(request={ "partition_parameters": { diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index 0f5ca224..b92d2baa 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -18,9 +18,7 @@ Cancel the specified job. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.jobs.cancel_job(request={ "job_id": "ec29bf67-0f30-4793-b5ee-8fc0da196032", @@ -61,9 +59,7 @@ Retrieve detailed information for a specific job by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.jobs.get_job(request={ "job_id": "6bb4cb72-a072-4398-9de3-194e59352a3c", @@ -104,9 +100,7 @@ Retrieve a list of jobs with optional filtering by workflow ID or job status. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.jobs.list_jobs(request={}) diff --git a/docs/sdks/sources/README.md b/docs/sdks/sources/README.md index 28a3382e..49b165c8 100644 --- a/docs/sdks/sources/README.md +++ b/docs/sdks/sources/README.md @@ -21,9 +21,7 @@ Create a new source connector using the provided configuration and name. from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.sources.create_source(request={ "create_source_connector": { @@ -77,9 +75,7 @@ Delete a specific source connector identified by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.sources.delete_source(request={ "source_id": "8a24d7ae-5524-45e9-83f9-b0adba5303d4", @@ -120,9 +116,7 @@ Retrieve detailed information for a specific source connector by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.sources.get_source(request={ "source_id": "e02d8147-b614-4e4c-9c6d-0cd9c4492ea0", @@ -163,9 +157,7 @@ Retrieve a list of available source connectors. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.sources.list_sources(request={}) @@ -204,9 +196,7 @@ Update the configuration of an existing source connector. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.sources.update_source(request={ "update_source_connector": { diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index a73c9d4c..a420809a 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -22,9 +22,7 @@ Create a new workflow, either custom or auto, and configure its settings. from unstructured_client import UnstructuredClient from unstructured_client.models import shared -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.workflows.create_workflow(request={ "create_workflow": { @@ -71,9 +69,7 @@ Delete a workflow by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.workflows.delete_workflow(request={ "workflow_id": "26c0bd77-269e-4239-86b8-71541359440c", @@ -114,9 +110,7 @@ Retrieve detailed information for a specific workflow by its ID. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.workflows.get_workflow(request={ "workflow_id": "270d9bb5-13f1-4e4d-bb84-4bcc30c93967", @@ -157,9 +151,7 @@ Retrieve a list of workflows, optionally filtered by source, destination, or sta ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.workflows.list_workflows(request={}) @@ -198,9 +190,7 @@ Run a workflow by triggering a new job if none is currently active. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.workflows.run_workflow(request={ "workflow_id": "6b67be6d-98e9-440c-88fd-721e5d2d0036", @@ -241,9 +231,7 @@ Update an existing workflow's name, connectors, schedule, or workflow type. ```python from unstructured_client import UnstructuredClient -with UnstructuredClient( - server_url="https://api.example.com", -) as uc_client: +with UnstructuredClient() as uc_client: res = uc_client.workflows.update_workflow(request={ "update_workflow": {}, diff --git a/gen.yaml b/gen.yaml index 0063214f..0b16d552 100644 --- a/gen.yaml +++ b/gen.yaml @@ -4,15 +4,16 @@ generation: usageSnippets: optionalPropertyRendering: withExample fixes: - nameResolutionFeb2025: false + nameResolutionDec2023: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false securityFeb2025: false + nameResolutionFeb2025: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.31.0 + version: 0.30.5 additionalDependencies: dev: deepdiff: '>=6.0' diff --git a/pyproject.toml b/pyproject.toml index f098ea67..c2ad1c3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.31.0" +version = "0.30.5" description = "Python Client SDK for Unstructured API" authors = [{ name = "Unstructured" },] readme = "README-PYPI.md" diff --git a/src/unstructured_client/_version.py b/src/unstructured_client/_version.py index 18ffb22b..e157e7e2 100644 --- a/src/unstructured_client/_version.py +++ b/src/unstructured_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "unstructured-client" -__version__: str = "0.31.0" +__version__: str = "0.30.5" __openapi_doc_version__: str = "1.0.68" -__gen_version__: str = "2.529.2" -__user_agent__: str = "speakeasy-sdk/python 0.31.0 2.529.2 1.0.68 unstructured-client" +__gen_version__: str = "2.512.0" +__user_agent__: str = "speakeasy-sdk/python 0.30.5 2.512.0 1.0.68 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/models/shared/__init__.py b/src/unstructured_client/models/shared/__init__.py index e4b08e08..f12f7a47 100644 --- a/src/unstructured_client/models/shared/__init__.py +++ b/src/unstructured_client/models/shared/__init__.py @@ -24,6 +24,14 @@ AzureSourceConnectorConfigInput, AzureSourceConnectorConfigInputTypedDict, ) +from .boxsourceconnectorconfig import ( + BoxSourceConnectorConfig, + BoxSourceConnectorConfigTypedDict, +) +from .boxsourceconnectorconfiginput import ( + BoxSourceConnectorConfigInput, + BoxSourceConnectorConfigInputTypedDict, +) from .confluencesourceconnectorconfig import ( ConfluenceSourceConnectorConfig, ConfluenceSourceConnectorConfigTypedDict, @@ -318,12 +326,7 @@ WeaviateDestinationConnectorConfigInputTypedDict, ) from .workflowinformation import WorkflowInformation, WorkflowInformationTypedDict -from .workflownode import ( - Settings, - SettingsTypedDict, - WorkflowNode, - WorkflowNodeTypedDict, -) +from .workflownode import WorkflowNode, WorkflowNodeTypedDict from .workflownodetype import WorkflowNodeType from .workflowschedule import WorkflowSchedule, WorkflowScheduleTypedDict from .workflowstate import WorkflowState @@ -343,6 +346,10 @@ "AzureSourceConnectorConfigInput", "AzureSourceConnectorConfigInputTypedDict", "AzureSourceConnectorConfigTypedDict", + "BoxSourceConnectorConfig", + "BoxSourceConnectorConfigInput", + "BoxSourceConnectorConfigInputTypedDict", + "BoxSourceConnectorConfigTypedDict", "Config", "ConfigTypedDict", "ConfluenceSourceConnectorConfig", @@ -472,8 +479,6 @@ "Schedule", "Security", "SecurityTypedDict", - "Settings", - "SettingsTypedDict", "SharePointSourceConnectorConfig", "SharePointSourceConnectorConfigInput", "SharePointSourceConnectorConfigInputTypedDict", diff --git a/src/unstructured_client/models/shared/boxsourceconnectorconfig.py b/src/unstructured_client/models/shared/boxsourceconnectorconfig.py new file mode 100644 index 00000000..6c787038 --- /dev/null +++ b/src/unstructured_client/models/shared/boxsourceconnectorconfig.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing_extensions import TypedDict +from unstructured_client.types import BaseModel + + +class BoxSourceConnectorConfigTypedDict(TypedDict): + box_app_config: str + recursive: bool + + +class BoxSourceConnectorConfig(BaseModel): + box_app_config: str + + recursive: bool diff --git a/src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py b/src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py new file mode 100644 index 00000000..13572316 --- /dev/null +++ b/src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing import Optional +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import BaseModel + + +class BoxSourceConnectorConfigInputTypedDict(TypedDict): + box_app_config: str + remote_url: str + recursive: NotRequired[bool] + + +class BoxSourceConnectorConfigInput(BaseModel): + box_app_config: str + + remote_url: str + + recursive: Optional[bool] = True diff --git a/src/unstructured_client/models/shared/createsourceconnector.py b/src/unstructured_client/models/shared/createsourceconnector.py index c0b51d19..db53d233 100644 --- a/src/unstructured_client/models/shared/createsourceconnector.py +++ b/src/unstructured_client/models/shared/createsourceconnector.py @@ -5,6 +5,10 @@ AzureSourceConnectorConfigInput, AzureSourceConnectorConfigInputTypedDict, ) +from .boxsourceconnectorconfiginput import ( + BoxSourceConnectorConfigInput, + BoxSourceConnectorConfigInputTypedDict, +) from .confluencesourceconnectorconfiginput import ( ConfluenceSourceConnectorConfigInput, ConfluenceSourceConnectorConfigInputTypedDict, @@ -75,6 +79,7 @@ "CreateSourceConnectorConfigTypedDict", Union[ MongoDBConnectorConfigInputTypedDict, + BoxSourceConnectorConfigInputTypedDict, DropboxSourceConnectorConfigInputTypedDict, ElasticsearchConnectorConfigInputTypedDict, GCSSourceConnectorConfigInputTypedDict, @@ -82,8 +87,8 @@ GoogleDriveSourceConnectorConfigInputTypedDict, SharePointSourceConnectorConfigInputTypedDict, AzureSourceConnectorConfigInputTypedDict, - KafkaCloudSourceConnectorConfigInputTypedDict, DatabricksVolumesConnectorConfigInputTypedDict, + KafkaCloudSourceConnectorConfigInputTypedDict, OneDriveSourceConnectorConfigInputTypedDict, OutlookSourceConnectorConfigInputTypedDict, S3SourceConnectorConfigInputTypedDict, @@ -98,6 +103,7 @@ "CreateSourceConnectorConfig", Union[ MongoDBConnectorConfigInput, + BoxSourceConnectorConfigInput, DropboxSourceConnectorConfigInput, ElasticsearchConnectorConfigInput, GCSSourceConnectorConfigInput, @@ -105,8 +111,8 @@ GoogleDriveSourceConnectorConfigInput, SharePointSourceConnectorConfigInput, AzureSourceConnectorConfigInput, - KafkaCloudSourceConnectorConfigInput, DatabricksVolumesConnectorConfigInput, + KafkaCloudSourceConnectorConfigInput, OneDriveSourceConnectorConfigInput, OutlookSourceConnectorConfigInput, S3SourceConnectorConfigInput, diff --git a/src/unstructured_client/models/shared/sourceconnectorinformation.py b/src/unstructured_client/models/shared/sourceconnectorinformation.py index ea84e656..2b879bdc 100644 --- a/src/unstructured_client/models/shared/sourceconnectorinformation.py +++ b/src/unstructured_client/models/shared/sourceconnectorinformation.py @@ -5,6 +5,10 @@ AzureSourceConnectorConfig, AzureSourceConnectorConfigTypedDict, ) +from .boxsourceconnectorconfig import ( + BoxSourceConnectorConfig, + BoxSourceConnectorConfigTypedDict, +) from .confluencesourceconnectorconfig import ( ConfluenceSourceConnectorConfig, ConfluenceSourceConnectorConfigTypedDict, @@ -82,6 +86,7 @@ SourceConnectorInformationConfigTypedDict = TypeAliasType( "SourceConnectorInformationConfigTypedDict", Union[ + BoxSourceConnectorConfigTypedDict, MongoDBConnectorConfigTypedDict, DropboxSourceConnectorConfigTypedDict, ElasticsearchConnectorConfigTypedDict, @@ -90,8 +95,8 @@ GoogleDriveSourceConnectorConfigTypedDict, SharePointSourceConnectorConfigTypedDict, AzureSourceConnectorConfigTypedDict, - KafkaCloudSourceConnectorConfigTypedDict, DatabricksVolumesConnectorConfigTypedDict, + KafkaCloudSourceConnectorConfigTypedDict, OneDriveSourceConnectorConfigTypedDict, OutlookSourceConnectorConfigTypedDict, S3SourceConnectorConfigTypedDict, @@ -105,6 +110,7 @@ SourceConnectorInformationConfig = TypeAliasType( "SourceConnectorInformationConfig", Union[ + BoxSourceConnectorConfig, MongoDBConnectorConfig, DropboxSourceConnectorConfig, ElasticsearchConnectorConfig, @@ -113,8 +119,8 @@ GoogleDriveSourceConnectorConfig, SharePointSourceConnectorConfig, AzureSourceConnectorConfig, - KafkaCloudSourceConnectorConfig, DatabricksVolumesConnectorConfig, + KafkaCloudSourceConnectorConfig, OneDriveSourceConnectorConfig, OutlookSourceConnectorConfig, S3SourceConnectorConfig, diff --git a/src/unstructured_client/models/shared/sourceconnectortype.py b/src/unstructured_client/models/shared/sourceconnectortype.py index 5eef21f3..26e7b123 100644 --- a/src/unstructured_client/models/shared/sourceconnectortype.py +++ b/src/unstructured_client/models/shared/sourceconnectortype.py @@ -6,6 +6,7 @@ class SourceConnectorType(str, Enum): AZURE = "azure" + BOX = "box" CONFLUENCE = "confluence" COUCHBASE = "couchbase" DATABRICKS_VOLUMES = "databricks_volumes" diff --git a/src/unstructured_client/models/shared/updatesourceconnector.py b/src/unstructured_client/models/shared/updatesourceconnector.py index c8286a9c..5e28ab2e 100644 --- a/src/unstructured_client/models/shared/updatesourceconnector.py +++ b/src/unstructured_client/models/shared/updatesourceconnector.py @@ -5,6 +5,10 @@ AzureSourceConnectorConfigInput, AzureSourceConnectorConfigInputTypedDict, ) +from .boxsourceconnectorconfiginput import ( + BoxSourceConnectorConfigInput, + BoxSourceConnectorConfigInputTypedDict, +) from .confluencesourceconnectorconfiginput import ( ConfluenceSourceConnectorConfigInput, ConfluenceSourceConnectorConfigInputTypedDict, @@ -74,6 +78,7 @@ "UpdateSourceConnectorConfigTypedDict", Union[ MongoDBConnectorConfigInputTypedDict, + BoxSourceConnectorConfigInputTypedDict, DropboxSourceConnectorConfigInputTypedDict, ElasticsearchConnectorConfigInputTypedDict, GCSSourceConnectorConfigInputTypedDict, @@ -81,8 +86,8 @@ GoogleDriveSourceConnectorConfigInputTypedDict, SharePointSourceConnectorConfigInputTypedDict, AzureSourceConnectorConfigInputTypedDict, - KafkaCloudSourceConnectorConfigInputTypedDict, DatabricksVolumesConnectorConfigInputTypedDict, + KafkaCloudSourceConnectorConfigInputTypedDict, OneDriveSourceConnectorConfigInputTypedDict, OutlookSourceConnectorConfigInputTypedDict, S3SourceConnectorConfigInputTypedDict, @@ -97,6 +102,7 @@ "UpdateSourceConnectorConfig", Union[ MongoDBConnectorConfigInput, + BoxSourceConnectorConfigInput, DropboxSourceConnectorConfigInput, ElasticsearchConnectorConfigInput, GCSSourceConnectorConfigInput, @@ -104,8 +110,8 @@ GoogleDriveSourceConnectorConfigInput, SharePointSourceConnectorConfigInput, AzureSourceConnectorConfigInput, - KafkaCloudSourceConnectorConfigInput, DatabricksVolumesConnectorConfigInput, + KafkaCloudSourceConnectorConfigInput, OneDriveSourceConnectorConfigInput, OutlookSourceConnectorConfigInput, S3SourceConnectorConfigInput, diff --git a/src/unstructured_client/models/shared/workflownode.py b/src/unstructured_client/models/shared/workflownode.py index 464d62d2..8fc31532 100644 --- a/src/unstructured_client/models/shared/workflownode.py +++ b/src/unstructured_client/models/shared/workflownode.py @@ -3,6 +3,7 @@ from __future__ import annotations from .workflownodetype import WorkflowNodeType from pydantic import model_serializer +from typing import Any, Dict from typing_extensions import NotRequired, TypedDict from unstructured_client.types import ( BaseModel, @@ -13,19 +14,11 @@ ) -class SettingsTypedDict(TypedDict): - pass - - -class Settings(BaseModel): - pass - - class WorkflowNodeTypedDict(TypedDict): name: str subtype: str type: WorkflowNodeType - settings: NotRequired[Nullable[SettingsTypedDict]] + settings: NotRequired[Nullable[Dict[str, Any]]] class WorkflowNode(BaseModel): @@ -35,7 +28,7 @@ class WorkflowNode(BaseModel): type: WorkflowNodeType - settings: OptionalNullable[Settings] = UNSET + settings: OptionalNullable[Dict[str, Any]] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): diff --git a/src/unstructured_client/sdk.py b/src/unstructured_client/sdk.py index 92f3114d..e21b56e2 100644 --- a/src/unstructured_client/sdk.py +++ b/src/unstructured_client/sdk.py @@ -6,7 +6,8 @@ from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig import httpx -from typing import Any, Callable, Optional, Union, cast +from typing import Any, Callable, Dict, Optional, Union, cast +from unstructured_client import utils from unstructured_client._hooks import SDKHooks from unstructured_client.destinations import Destinations from unstructured_client.general import General @@ -27,10 +28,11 @@ class UnstructuredClient(BaseSDK): def __init__( self, - server_url: str, api_key_auth: Optional[ Union[Optional[str], Callable[[], Optional[str]]] ] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, client: Optional[HttpClient] = None, async_client: Optional[AsyncHttpClient] = None, retry_config: OptionalNullable[RetryConfig] = UNSET, @@ -71,6 +73,10 @@ def __init__( else: security = shared.Security(api_key_auth=api_key_auth) + if server_url is not None: + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + BaseSDK.__init__( self, SDKConfiguration( diff --git a/src/unstructured_client/sdkconfiguration.py b/src/unstructured_client/sdkconfiguration.py index 336d2488..5850fb5d 100644 --- a/src/unstructured_client/sdkconfiguration.py +++ b/src/unstructured_client/sdkconfiguration.py @@ -21,8 +21,8 @@ class SDKConfiguration: client: HttpClient async_client: AsyncHttpClient debug_logger: Logger - server_url: str security: Optional[Union[shared.Security, Callable[[], shared.Security]]] = None + server_url: Optional[str] = "" language: str = "python" openapi_doc_version: str = __openapi_doc_version__ sdk_version: str = __version__ @@ -35,6 +35,9 @@ def __post_init__(self): self._hooks = SDKHooks() def get_server_details(self) -> Tuple[str, Dict[str, str]]: + if self.server_url is None: + return "", {} + return remove_suffix(self.server_url, "/"), {} def get_hooks(self) -> SDKHooks: diff --git a/src/unstructured_client/utils/__init__.py b/src/unstructured_client/utils/__init__.py index 3cded8fe..26d51ae8 100644 --- a/src/unstructured_client/utils/__init__.py +++ b/src/unstructured_client/utils/__init__.py @@ -42,7 +42,6 @@ match_content_type, match_status_codes, match_response, - cast_partial, ) from .logger import Logger, get_body_content, get_default_logger @@ -95,5 +94,4 @@ "validate_float", "validate_int", "validate_open_enum", - "cast_partial", ] diff --git a/src/unstructured_client/utils/values.py b/src/unstructured_client/utils/values.py index dae01a44..2b4b6832 100644 --- a/src/unstructured_client/utils/values.py +++ b/src/unstructured_client/utils/values.py @@ -3,9 +3,8 @@ from datetime import datetime from enum import Enum from email.message import Message -from functools import partial import os -from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union from httpx import Response from pydantic import BaseModel @@ -52,8 +51,6 @@ def match_status_codes(status_codes: List[str], status_code: int) -> bool: T = TypeVar("T") -def cast_partial(typ): - return partial(cast, typ) def get_global_from_env( value: Optional[T], env_key: str, type_cast: Callable[[str], T]