From 84c407572e77663f6ac8d85493e5363f5be17254 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 20 Feb 2025 17:18:02 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.498.0 --- .speakeasy/gen.lock | 16 ++++---- .speakeasy/workflow.lock | 14 +++---- RELEASES.md | 12 +++++- codeSamples.yaml | 2 +- docs/models/shared/createworkflow.md | 16 ++++---- docs/models/shared/updateworkflow.md | 14 +++---- ...wschedule.md => updateworkflowschedule.md} | 2 +- docs/sdks/destinations/README.md | 20 +++++----- docs/sdks/jobs/README.md | 6 +-- docs/sdks/sources/README.md | 20 +++++----- docs/sdks/workflows/README.md | 14 +++---- gen.yaml | 4 +- poetry.lock | 12 +++--- pyproject.toml | 2 +- src/unstructured_client/_version.py | 6 +-- src/unstructured_client/destinations.py | 40 ++++++++++++++----- src/unstructured_client/jobs.py | 12 ++++++ .../models/shared/__init__.py | 14 +++---- .../models/shared/createworkflow.py | 12 +++--- .../models/shared/updateworkflow.py | 6 +-- src/unstructured_client/sources.py | 40 ++++++++++++++----- src/unstructured_client/utils/__init__.py | 2 + src/unstructured_client/utils/values.py | 5 ++- src/unstructured_client/workflows.py | 24 +++++++++++ 24 files changed, 203 insertions(+), 112 deletions(-) rename docs/models/shared/{createworkflowschedule.md => updateworkflowschedule.md} (95%) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 483962b0..cb39e589 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: 500f51b9ece99e4d8171e8074adb5c57 + docChecksum: 55560f658152696f9515aab6d5d87d02 docVersion: 1.0.0 - speakeasyVersion: 1.493.0 - generationVersion: 2.512.4 - releaseVersion: 0.30.1 - configChecksum: 221b178c402e9d1c592b066e2207dbe7 + speakeasyVersion: 1.498.0 + generationVersion: 2.518.0 + releaseVersion: 0.30.2 + configChecksum: d3d1b9d76ad643645f8dc5e232a56669 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -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 @@ -85,7 +85,6 @@ generatedFiles: - docs/models/shared/createdestinationconnector.md - docs/models/shared/createsourceconnector.md - docs/models/shared/createworkflow.md - - docs/models/shared/createworkflowschedule.md - docs/models/shared/crontabentry.md - docs/models/shared/destinationconnectorinformation.md - docs/models/shared/destinationconnectortype.md @@ -103,6 +102,7 @@ generatedFiles: - docs/models/shared/updatedestinationconnector.md - docs/models/shared/updatesourceconnector.md - docs/models/shared/updateworkflow.md + - docs/models/shared/updateworkflowschedule.md - docs/models/shared/validationerror.md - docs/models/shared/workflowinformation.md - docs/models/shared/workflownode.md diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 45e61b74..2a6c9f12 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.493.0 +speakeasyVersion: 1.498.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:b64c6663fac204ca5c6a94b8e8c5bb8826ccd471d58dbea28dd7907e92530694 - sourceBlobDigest: sha256:6c9f0660f6595627ded66c15cbb722d4783185d9bf4e6ef14e924bf4dcda5a20 + sourceRevisionDigest: sha256:3f0b1ceea00a0e10f5e8e22a5bc9a6e7e7da3d1fb6bfcd7d2a832185e6c7fbc9 + sourceBlobDigest: sha256:b9141ea121d6bc1aa41cd57b544dc7e2111d68a80a207fd394ef368481e86ba4 tags: - latest - - speakeasy-sdk-regen-1739578178 + - speakeasy-sdk-regen-1740071825 - 1.0.0 targets: unstructured-python: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:b64c6663fac204ca5c6a94b8e8c5bb8826ccd471d58dbea28dd7907e92530694 - sourceBlobDigest: sha256:6c9f0660f6595627ded66c15cbb722d4783185d9bf4e6ef14e924bf4dcda5a20 + sourceRevisionDigest: sha256:3f0b1ceea00a0e10f5e8e22a5bc9a6e7e7da3d1fb6bfcd7d2a832185e6c7fbc9 + sourceBlobDigest: sha256:b9141ea121d6bc1aa41cd57b544dc7e2111d68a80a207fd394ef368481e86ba4 codeSamplesNamespace: my-source-code-samples - codeSamplesRevisionDigest: sha256:64a726686ef3036335a4803c9761b4ff9cc346a3ebc1d93d4b6aeea33358a769 + codeSamplesRevisionDigest: sha256:e60ad5d07ffc2e9dad358e7cf8f3c55f25f97848ecb6f8f4f6d95017e04e767d workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index 388d4c6b..7405d2ef 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -784,4 +784,14 @@ Based on: ### Generated - [python v0.30.1] . ### Releases -- [PyPI v0.30.1] https://pypi.org/project/unstructured-client/0.30.1 - . \ No newline at end of file +- [PyPI v0.30.1] https://pypi.org/project/unstructured-client/0.30.1 - . + +## 2025-02-20 17:16:49 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.498.0 (2.518.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.30.2] . +### Releases +- [PyPI v0.30.2] https://pypi.org/project/unstructured-client/0.30.2 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 47456cd5..cb4f3836 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -92,7 +92,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "create_workflow" - "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.create_workflow(request={\n \"create_workflow\": {\n \"name\": \"\",\n \"source_id\": \"b5baba90-bc88-4ea4-b45f-e894788e3f38\",\n \"destination_id\": \"0efa0612-4dfe-411e-b84d-d7cfa1e3fe9e\",\n \"workflow_type\": shared.WorkflowType.ADVANCED,\n \"schedule\": shared.CreateWorkflowSchedule.EVERY_10_HOURS,\n },\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" + "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.workflows.create_workflow(request={\n \"create_workflow\": {\n \"name\": \"\",\n \"source_id\": \"b5baba90-bc88-4ea4-b45f-e894788e3f38\",\n \"destination_id\": \"0efa0612-4dfe-411e-b84d-d7cfa1e3fe9e\",\n \"workflow_type\": shared.WorkflowType.ADVANCED,\n },\n })\n\n assert res.workflow_information is not None\n\n # Handle response\n print(res.workflow_information)" - target: $["paths"]["/api/v1/workflows/{workflow_id}"]["delete"] update: "x-codeSamples": diff --git a/docs/models/shared/createworkflow.md b/docs/models/shared/createworkflow.md index aaf11749..3682d997 100644 --- a/docs/models/shared/createworkflow.md +++ b/docs/models/shared/createworkflow.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `destination_id` | *str* | :heavy_check_mark: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `schedule` | [shared.CreateWorkflowSchedule](../../models/shared/createworkflowschedule.md) | :heavy_check_mark: | N/A | -| `source_id` | *str* | :heavy_check_mark: | N/A | -| `workflow_type` | [shared.WorkflowType](../../models/shared/workflowtype.md) | :heavy_check_mark: | N/A | -| `workflow_nodes` | List[[shared.WorkflowNode](../../models/shared/workflownode.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `destination_id` | *str* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `source_id` | *str* | :heavy_check_mark: | N/A | +| `workflow_type` | [shared.WorkflowType](../../models/shared/workflowtype.md) | :heavy_check_mark: | N/A | +| `schedule` | [OptionalNullable[shared.Schedule]](../../models/shared/schedule.md) | :heavy_minus_sign: | N/A | +| `workflow_nodes` | List[[shared.WorkflowNode](../../models/shared/workflownode.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/updateworkflow.md b/docs/models/shared/updateworkflow.md index 2db13b41..774d3c0e 100644 --- a/docs/models/shared/updateworkflow.md +++ b/docs/models/shared/updateworkflow.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `destination_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `schedule` | [OptionalNullable[shared.Schedule]](../../models/shared/schedule.md) | :heavy_minus_sign: | N/A | -| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `workflow_type` | [OptionalNullable[shared.WorkflowType]](../../models/shared/workflowtype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `destination_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `schedule` | [OptionalNullable[shared.UpdateWorkflowSchedule]](../../models/shared/updateworkflowschedule.md) | :heavy_minus_sign: | N/A | +| `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `workflow_type` | [OptionalNullable[shared.WorkflowType]](../../models/shared/workflowtype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/createworkflowschedule.md b/docs/models/shared/updateworkflowschedule.md similarity index 95% rename from docs/models/shared/createworkflowschedule.md rename to docs/models/shared/updateworkflowschedule.md index 0ef31f5b..2d105745 100644 --- a/docs/models/shared/createworkflowschedule.md +++ b/docs/models/shared/updateworkflowschedule.md @@ -1,4 +1,4 @@ -# CreateWorkflowSchedule +# UpdateWorkflowSchedule ## Values diff --git a/docs/sdks/destinations/README.md b/docs/sdks/destinations/README.md index 6539e7e4..239be32f 100644 --- a/docs/sdks/destinations/README.md +++ b/docs/sdks/destinations/README.md @@ -5,15 +5,15 @@ ### Available Operations -* [create_destination](#create_destination) - Create Destination -* [delete_destination](#delete_destination) - Delete Destination -* [get_destination](#get_destination) - Get Destination -* [list_destinations](#list_destinations) - List Destinations -* [update_destination](#update_destination) - Update Destination +* [create_destination](#create_destination) - Create destination connector +* [delete_destination](#delete_destination) - Delete destination connector +* [get_destination](#get_destination) - Get destination connector +* [list_destinations](#list_destinations) - List destination connectors +* [update_destination](#update_destination) - Update destination connector ## create_destination -Create Destination +Create a new destination connector using the provided configuration and name. ### Example Usage @@ -65,7 +65,7 @@ with UnstructuredClient() as uc_client: ## delete_destination -Delete Destination +Delete a specific destination connector by its ID. ### Example Usage @@ -106,7 +106,7 @@ with UnstructuredClient() as uc_client: ## get_destination -Get Destination +Retrieve detailed information for a specific destination connector by its ID. ### Example Usage @@ -147,7 +147,7 @@ with UnstructuredClient() as uc_client: ## list_destinations -List Destinations +Retrieve a list of available destination connectors. ### Example Usage @@ -186,7 +186,7 @@ with UnstructuredClient() as uc_client: ## update_destination -Update Destination +Update the configuration of an existing destination connector. ### Example Usage diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index 217c52af..b92d2baa 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -11,7 +11,7 @@ ## cancel_job -Cancel Job +Cancel the specified job. ### Example Usage @@ -52,7 +52,7 @@ with UnstructuredClient() as uc_client: ## get_job -Get Job +Retrieve detailed information for a specific job by its ID. ### Example Usage @@ -93,7 +93,7 @@ with UnstructuredClient() as uc_client: ## list_jobs -List Jobs +Retrieve a list of jobs with optional filtering by workflow ID or job status. ### Example Usage diff --git a/docs/sdks/sources/README.md b/docs/sdks/sources/README.md index 3d1828ae..bd844bf9 100644 --- a/docs/sdks/sources/README.md +++ b/docs/sdks/sources/README.md @@ -5,15 +5,15 @@ ### Available Operations -* [create_source](#create_source) - Create Source -* [delete_source](#delete_source) - Delete Source -* [get_source](#get_source) - Get Source -* [list_sources](#list_sources) - List Sources -* [update_source](#update_source) - Update Source +* [create_source](#create_source) - Create source connector +* [delete_source](#delete_source) - Delete source connector +* [get_source](#get_source) - Get source connector +* [list_sources](#list_sources) - List available source connectors +* [update_source](#update_source) - Update source connector ## create_source -Create Source +Create a new source connector using the provided configuration and name. ### Example Usage @@ -68,7 +68,7 @@ with UnstructuredClient() as uc_client: ## delete_source -Delete Source +Delete a specific source connector identified by its ID. ### Example Usage @@ -109,7 +109,7 @@ with UnstructuredClient() as uc_client: ## get_source -Get Source +Retrieve detailed information for a specific source connector by its ID. ### Example Usage @@ -150,7 +150,7 @@ with UnstructuredClient() as uc_client: ## list_sources -List Sources +Retrieve a list of available source connectors. ### Example Usage @@ -189,7 +189,7 @@ with UnstructuredClient() as uc_client: ## update_source -Update Source +Update the configuration of an existing source connector. ### Example Usage diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index 28e6070b..a420809a 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -14,7 +14,7 @@ ## create_workflow -Create Workflow +Create a new workflow, either custom or auto, and configure its settings. ### Example Usage @@ -28,9 +28,9 @@ with UnstructuredClient() as uc_client: "create_workflow": { "destination_id": "b5baba90-bc88-4ea4-b45f-e894788e3f38", "name": "", - "schedule": shared.CreateWorkflowSchedule.EVERY_15_MINUTES, "source_id": "efa06124-dfe1-41e8-94dd-7cfa1e3fe9ec", "workflow_type": shared.WorkflowType.PLATINUM, + "schedule": shared.Schedule.EVERY_15_MINUTES, }, }) @@ -62,7 +62,7 @@ with UnstructuredClient() as uc_client: ## delete_workflow -Delete Workflow +Delete a workflow by its ID. ### Example Usage @@ -103,7 +103,7 @@ with UnstructuredClient() as uc_client: ## get_workflow -Get Workflow +Retrieve detailed information for a specific workflow by its ID. ### Example Usage @@ -144,7 +144,7 @@ with UnstructuredClient() as uc_client: ## list_workflows -List Workflows +Retrieve a list of workflows, optionally filtered by source, destination, or state. ### Example Usage @@ -183,7 +183,7 @@ with UnstructuredClient() as uc_client: ## run_workflow -Run Workflow +Run a workflow by triggering a new job if none is currently active. ### Example Usage @@ -224,7 +224,7 @@ with UnstructuredClient() as uc_client: ## update_workflow -Update Workflow +Update an existing workflow's name, connectors, schedule, or workflow type. ### Example Usage diff --git a/gen.yaml b/gen.yaml index 8142c557..3842ff34 100644 --- a/gen.yaml +++ b/gen.yaml @@ -4,7 +4,7 @@ generation: usageSnippets: optionalPropertyRendering: withExample fixes: - nameResolutionDec2023: false + nameResolutionFeb2025: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false securityFeb2025: false @@ -12,7 +12,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.30.1 + version: 0.30.2 additionalDependencies: dev: deepdiff: '>=6.0' diff --git a/poetry.lock b/poetry.lock index 37fd2245..542e9380 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -44,7 +44,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21.0b1) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] trio = ["trio (>=0.26.1)"] [[package]] @@ -453,7 +453,7 @@ idna = "*" sniffio = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -686,7 +686,7 @@ typing-extensions = ">=4.12.2" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" @@ -819,7 +819,7 @@ colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.6", markers = "python_version == \"3.11\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -1081,7 +1081,7 @@ files = [ ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] diff --git a/pyproject.toml b/pyproject.toml index 29d057af..1d0cfee1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.30.1" +version = "0.30.2" 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 1ace2356..60b3e4d1 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.1" +__version__: str = "0.30.2" __openapi_doc_version__: str = "1.0.0" -__gen_version__: str = "2.512.4" -__user_agent__: str = "speakeasy-sdk/python 0.30.1 2.512.4 1.0.0 unstructured-client" +__gen_version__: str = "2.518.0" +__user_agent__: str = "speakeasy-sdk/python 0.30.2 2.518.0 1.0.0 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/destinations.py b/src/unstructured_client/destinations.py index 3f6d39f5..e152390a 100644 --- a/src/unstructured_client/destinations.py +++ b/src/unstructured_client/destinations.py @@ -21,7 +21,9 @@ def create_destination( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateDestinationResponse: - r"""Create Destination + r"""Create destination connector + + Create a new destination connector using the provided configuration and name. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -139,7 +141,9 @@ async def create_destination_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateDestinationResponse: - r"""Create Destination + r"""Create destination connector + + Create a new destination connector using the provided configuration and name. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -257,7 +261,9 @@ def delete_destination( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteDestinationResponse: - r"""Delete Destination + r"""Delete destination connector + + Delete a specific destination connector by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -366,7 +372,9 @@ async def delete_destination_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteDestinationResponse: - r"""Delete Destination + r"""Delete destination connector + + Delete a specific destination connector by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -474,7 +482,9 @@ def get_destination( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetDestinationResponse: - r"""Get Destination + r"""Get destination connector + + Retrieve detailed information for a specific destination connector by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -584,7 +594,9 @@ async def get_destination_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetDestinationResponse: - r"""Get Destination + r"""Get destination connector + + Retrieve detailed information for a specific destination connector by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -695,7 +707,9 @@ def list_destinations( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.ListDestinationsResponse: - r"""List Destinations + r"""List destination connectors + + Retrieve a list of available destination connectors. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -807,7 +821,9 @@ async def list_destinations_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.ListDestinationsResponse: - r"""List Destinations + r"""List destination connectors + + Retrieve a list of available destination connectors. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -919,7 +935,9 @@ def update_destination( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateDestinationResponse: - r"""Update Destination + r"""Update destination connector + + Update the configuration of an existing destination connector. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -1037,7 +1055,9 @@ async def update_destination_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateDestinationResponse: - r"""Update Destination + r"""Update destination connector + + Update the configuration of an existing destination connector. :param request: The request object to send. :param retries: Override the default retry configuration for this method diff --git a/src/unstructured_client/jobs.py b/src/unstructured_client/jobs.py index feb5c168..820c4c93 100644 --- a/src/unstructured_client/jobs.py +++ b/src/unstructured_client/jobs.py @@ -22,6 +22,8 @@ def cancel_job( ) -> operations.CancelJobResponse: r"""Cancel Job + Cancel the specified job. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -130,6 +132,8 @@ async def cancel_job_async( ) -> operations.CancelJobResponse: r"""Cancel Job + Cancel the specified job. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -236,6 +240,8 @@ def get_job( ) -> operations.GetJobResponse: r"""Get Job + Retrieve detailed information for a specific job by its ID. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -344,6 +350,8 @@ async def get_job_async( ) -> operations.GetJobResponse: r"""Get Job + Retrieve detailed information for a specific job by its ID. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -452,6 +460,8 @@ def list_jobs( ) -> operations.ListJobsResponse: r"""List Jobs + Retrieve a list of jobs with optional filtering by workflow ID or job status. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -560,6 +570,8 @@ async def list_jobs_async( ) -> operations.ListJobsResponse: r"""List Jobs + Retrieve a list of jobs with optional filtering by workflow ID or job status. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/src/unstructured_client/models/shared/__init__.py b/src/unstructured_client/models/shared/__init__.py index aa70dc3a..cc3adfef 100644 --- a/src/unstructured_client/models/shared/__init__.py +++ b/src/unstructured_client/models/shared/__init__.py @@ -5,11 +5,7 @@ CreateDestinationConnectorTypedDict, ) from .createsourceconnector import CreateSourceConnector, CreateSourceConnectorTypedDict -from .createworkflow import ( - CreateWorkflow, - CreateWorkflowSchedule, - CreateWorkflowTypedDict, -) +from .createworkflow import CreateWorkflow, CreateWorkflowTypedDict, Schedule from .crontabentry import CronTabEntry, CronTabEntryTypedDict from .destinationconnectorinformation import ( DestinationConnectorInformation, @@ -36,7 +32,11 @@ UpdateDestinationConnectorTypedDict, ) from .updatesourceconnector import UpdateSourceConnector, UpdateSourceConnectorTypedDict -from .updateworkflow import Schedule, UpdateWorkflow, UpdateWorkflowTypedDict +from .updateworkflow import ( + UpdateWorkflow, + UpdateWorkflowSchedule, + UpdateWorkflowTypedDict, +) from .validationerror import ( Loc, LocTypedDict, @@ -62,7 +62,6 @@ "CreateSourceConnector", "CreateSourceConnectorTypedDict", "CreateWorkflow", - "CreateWorkflowSchedule", "CreateWorkflowTypedDict", "CronTabEntry", "CronTabEntryTypedDict", @@ -92,6 +91,7 @@ "UpdateSourceConnector", "UpdateSourceConnectorTypedDict", "UpdateWorkflow", + "UpdateWorkflowSchedule", "UpdateWorkflowTypedDict", "ValidationError", "ValidationErrorTypedDict", diff --git a/src/unstructured_client/models/shared/createworkflow.py b/src/unstructured_client/models/shared/createworkflow.py index db4f5744..2efb57cb 100644 --- a/src/unstructured_client/models/shared/createworkflow.py +++ b/src/unstructured_client/models/shared/createworkflow.py @@ -16,7 +16,7 @@ ) -class CreateWorkflowSchedule(str, Enum): +class Schedule(str, Enum): EVERY_15_MINUTES = "every 15 minutes" EVERY_HOUR = "every hour" EVERY_2_HOURS = "every 2 hours" @@ -33,9 +33,9 @@ class CreateWorkflowSchedule(str, Enum): class CreateWorkflowTypedDict(TypedDict): destination_id: str name: str - schedule: CreateWorkflowSchedule source_id: str workflow_type: WorkflowType + schedule: NotRequired[Nullable[Schedule]] workflow_nodes: NotRequired[Nullable[List[WorkflowNodeTypedDict]]] @@ -44,18 +44,18 @@ class CreateWorkflow(BaseModel): name: str - schedule: CreateWorkflowSchedule - source_id: str workflow_type: WorkflowType + schedule: OptionalNullable[Schedule] = UNSET + workflow_nodes: OptionalNullable[List[WorkflowNode]] = UNSET @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = ["workflow_nodes"] - nullable_fields = ["workflow_nodes"] + optional_fields = ["schedule", "workflow_nodes"] + nullable_fields = ["schedule", "workflow_nodes"] null_default_fields = [] serialized = handler(self) diff --git a/src/unstructured_client/models/shared/updateworkflow.py b/src/unstructured_client/models/shared/updateworkflow.py index e2022af0..07ebad4a 100644 --- a/src/unstructured_client/models/shared/updateworkflow.py +++ b/src/unstructured_client/models/shared/updateworkflow.py @@ -14,7 +14,7 @@ ) -class Schedule(str, Enum): +class UpdateWorkflowSchedule(str, Enum): EVERY_15_MINUTES = "every 15 minutes" EVERY_HOUR = "every hour" EVERY_2_HOURS = "every 2 hours" @@ -31,7 +31,7 @@ class Schedule(str, Enum): class UpdateWorkflowTypedDict(TypedDict): destination_id: NotRequired[Nullable[str]] name: NotRequired[Nullable[str]] - schedule: NotRequired[Nullable[Schedule]] + schedule: NotRequired[Nullable[UpdateWorkflowSchedule]] source_id: NotRequired[Nullable[str]] workflow_type: NotRequired[Nullable[WorkflowType]] @@ -41,7 +41,7 @@ class UpdateWorkflow(BaseModel): name: OptionalNullable[str] = UNSET - schedule: OptionalNullable[Schedule] = UNSET + schedule: OptionalNullable[UpdateWorkflowSchedule] = UNSET source_id: OptionalNullable[str] = UNSET diff --git a/src/unstructured_client/sources.py b/src/unstructured_client/sources.py index fc9a17cb..79f78f3a 100644 --- a/src/unstructured_client/sources.py +++ b/src/unstructured_client/sources.py @@ -20,7 +20,9 @@ def create_source( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateSourceResponse: - r"""Create Source + r"""Create source connector + + Create a new source connector using the provided configuration and name. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -137,7 +139,9 @@ async def create_source_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateSourceResponse: - r"""Create Source + r"""Create source connector + + Create a new source connector using the provided configuration and name. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -254,7 +258,9 @@ def delete_source( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteSourceResponse: - r"""Delete Source + r"""Delete source connector + + Delete a specific source connector identified by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -362,7 +368,9 @@ async def delete_source_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteSourceResponse: - r"""Delete Source + r"""Delete source connector + + Delete a specific source connector identified by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -470,7 +478,9 @@ def get_source( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSourceResponse: - r"""Get Source + r"""Get source connector + + Retrieve detailed information for a specific source connector by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -580,7 +590,9 @@ async def get_source_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSourceResponse: - r"""Get Source + r"""Get source connector + + Retrieve detailed information for a specific source connector by its ID. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -690,7 +702,9 @@ def list_sources( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.ListSourcesResponse: - r"""List Sources + r"""List available source connectors + + Retrieve a list of available source connectors. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -800,7 +814,9 @@ async def list_sources_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.ListSourcesResponse: - r"""List Sources + r"""List available source connectors + + Retrieve a list of available source connectors. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -910,7 +926,9 @@ def update_source( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateSourceResponse: - r"""Update Source + r"""Update source connector + + Update the configuration of an existing source connector. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -1027,7 +1045,9 @@ async def update_source_async( timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateSourceResponse: - r"""Update Source + r"""Update source connector + + Update the configuration of an existing source connector. :param request: The request object to send. :param retries: Override the default retry configuration for this method 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] diff --git a/src/unstructured_client/workflows.py b/src/unstructured_client/workflows.py index f7293cd7..0b59f9c9 100644 --- a/src/unstructured_client/workflows.py +++ b/src/unstructured_client/workflows.py @@ -22,6 +22,8 @@ def create_workflow( ) -> operations.CreateWorkflowResponse: r"""Create Workflow + Create a new workflow, either custom or auto, and configure its settings. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -135,6 +137,8 @@ async def create_workflow_async( ) -> operations.CreateWorkflowResponse: r"""Create Workflow + Create a new workflow, either custom or auto, and configure its settings. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -248,6 +252,8 @@ def delete_workflow( ) -> operations.DeleteWorkflowResponse: r"""Delete Workflow + Delete a workflow by its ID. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -356,6 +362,8 @@ async def delete_workflow_async( ) -> operations.DeleteWorkflowResponse: r"""Delete Workflow + Delete a workflow by its ID. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -464,6 +472,8 @@ def get_workflow( ) -> operations.GetWorkflowResponse: r"""Get Workflow + Retrieve detailed information for a specific workflow by its ID. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -574,6 +584,8 @@ async def get_workflow_async( ) -> operations.GetWorkflowResponse: r"""Get Workflow + Retrieve detailed information for a specific workflow by its ID. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -684,6 +696,8 @@ def list_workflows( ) -> operations.ListWorkflowsResponse: r"""List Workflows + Retrieve a list of workflows, optionally filtered by source, destination, or state. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -794,6 +808,8 @@ async def list_workflows_async( ) -> operations.ListWorkflowsResponse: r"""List Workflows + Retrieve a list of workflows, optionally filtered by source, destination, or state. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -904,6 +920,8 @@ def run_workflow( ) -> operations.RunWorkflowResponse: r"""Run Workflow + Run a workflow by triggering a new job if none is currently active. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1014,6 +1032,8 @@ async def run_workflow_async( ) -> operations.RunWorkflowResponse: r"""Run Workflow + Run a workflow by triggering a new job if none is currently active. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1124,6 +1144,8 @@ def update_workflow( ) -> operations.UpdateWorkflowResponse: r"""Update Workflow + Update an existing workflow's name, connectors, schedule, or workflow type. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -1237,6 +1259,8 @@ async def update_workflow_async( ) -> operations.UpdateWorkflowResponse: r"""Update Workflow + Update an existing workflow's name, connectors, schedule, or workflow type. + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method