diff --git a/.genignore b/.genignore index 81745f9c..164078a0 100644 --- a/.genignore +++ b/.genignore @@ -8,13 +8,10 @@ _test_unstructured_client # ignore Makefile Makefile -# Ignore the base resource classes while we're patching in our own server url logic -# If we add a new endpoint, we need to: -# - Comment out the ignore for the right file +# Ignore general.py so we can patch in our partitioning url +# If we ever have a new endpoint under /general, we need to: +# - Comment out this ignore line # - Generate locally, watch the new endpoint appear +# - Adjust the custom url snippets in the file # - Bring back the ignore line and commit -src/unstructured_client/destinations.py src/unstructured_client/general.py -src/unstructured_client/jobs.py -src/unstructured_client/sources.py -src/unstructured_client/workflows.py diff --git a/_test_unstructured_client/unit/test_server_urls.py b/_test_unstructured_client/unit/test_server_urls.py index 661dbc40..710891b6 100644 --- a/_test_unstructured_client/unit/test_server_urls.py +++ b/_test_unstructured_client/unit/test_server_urls.py @@ -67,61 +67,33 @@ class URLTestCase: "case", [ URLTestCase( - description="non UNST domain client-level URL, no path", + description="custom client-level URL, no path", sdk_endpoint_name="general.partition_async", client_url="http://localhost:8000/", endpoint_url=None, expected_url="http://localhost:8000" ), URLTestCase( - description="non UNST domain client-level URL, with path", + description="custom client-level URL, with path", sdk_endpoint_name="general.partition_async", client_url="http://localhost:8000/my/endpoint/", endpoint_url=None, expected_url="http://localhost:8000/my/endpoint" ), URLTestCase( - description="non UNST domain endpoint-level URL, no path", + description="custom endpoint-level URL, no path", sdk_endpoint_name="general.partition_async", client_url=None, endpoint_url="http://localhost:8000/", expected_url="http://localhost:8000" ), URLTestCase( - description="non UNST domain endpoint-level URL, with path", + description="custom endpoint-level URL, with path", sdk_endpoint_name="general.partition_async", client_url=None, endpoint_url="http://localhost:8000/my/endpoint/", expected_url="http://localhost:8000/my/endpoint" ), - URLTestCase( - description="UNST domain client-level URL, no path", - sdk_endpoint_name="general.partition_async", - client_url="https://unstructured-000mock.api.unstructuredapp.io", - endpoint_url=None, - expected_url="https://unstructured-000mock.api.unstructuredapp.io" - ), - URLTestCase( - description="UNST domain client-level URL, with path", - sdk_endpoint_name="general.partition_async", - client_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/", - endpoint_url=None, - expected_url="https://unstructured-000mock.api.unstructuredapp.io" - ), - URLTestCase( - description="UNST domain endpoint-level URL, no path", - sdk_endpoint_name="general.partition_async", - client_url=None, - endpoint_url="https://unstructured-000mock.api.unstructuredapp.io", - expected_url="https://unstructured-000mock.api.unstructuredapp.io" - ), - URLTestCase( - description="UNST domain endpoint-level URL, with path", - sdk_endpoint_name="general.partition_async", - client_url=None, - endpoint_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/", - expected_url="https://unstructured-000mock.api.unstructuredapp.io" - ), URLTestCase( description="default URL fallback", sdk_endpoint_name="general.partition_async", @@ -161,63 +133,49 @@ async def test_async_endpoint_uses_correct_url(monkeypatch, case: URLTestCase): "case", [ URLTestCase( - description="non UNST domain client-level URL, no path", + description="custom client-level URL, no path", sdk_endpoint_name="destinations.create_destination", client_url="http://localhost:8000/", endpoint_url=None, expected_url="http://localhost:8000" ), URLTestCase( - description="non UNST domain client-level URL, with path", + description="custom client-level URL, with path", sdk_endpoint_name="sources.create_source", client_url="http://localhost:8000/my/endpoint/", endpoint_url=None, expected_url="http://localhost:8000/my/endpoint" ), URLTestCase( - description="non UNST domain endpoint-level URL, no path", + description="custom endpoint-level URL, no path", sdk_endpoint_name="jobs.get_job", client_url=None, endpoint_url="http://localhost:8000", expected_url="http://localhost:8000" ), URLTestCase( - description="non UNST domain endpoint-level URL, with path", + description="custom endpoint-level URL, with path", sdk_endpoint_name="workflows.create_workflow", client_url=None, endpoint_url="http://localhost:8000/my/endpoint", expected_url="http://localhost:8000/my/endpoint" ), URLTestCase( - description="UNST domain client-level URL, no path", + description="partition client level with path", sdk_endpoint_name="general.partition", - client_url="https://unstructured-000mock.api.unstructuredapp.io", + client_url="https://api.unstructuredapp.io/general/v0/general", endpoint_url=None, - expected_url="https://unstructured-000mock.api.unstructuredapp.io" - ), - URLTestCase( - description="UNST domain client-level URL, with path", - sdk_endpoint_name="general.partition", - client_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/", - endpoint_url=None, - expected_url="https://unstructured-000mock.api.unstructuredapp.io" - ), - URLTestCase( - description="UNST domain endpoint-level URL, no path", - sdk_endpoint_name="general.partition", - client_url=None, - endpoint_url="https://unstructured-000mock.api.unstructuredapp.io", - expected_url="https://unstructured-000mock.api.unstructuredapp.io" + expected_url="https://api.unstructuredapp.io" ), URLTestCase( - description="UNST domain endpoint-level URL, with path", + description="partition endpoint level with path", sdk_endpoint_name="general.partition", client_url=None, - endpoint_url="https://unstructured-000mock.api.unstructuredapp.io/my/endpoint/", - expected_url="https://unstructured-000mock.api.unstructuredapp.io" + endpoint_url="https://api.unstructuredapp.io/general/v0/general", + expected_url="https://api.unstructuredapp.io" ), URLTestCase( - description="default URL fallback", + description="partition default url", sdk_endpoint_name="general.partition", client_url=None, endpoint_url=None, diff --git a/docs/sdks/destinations/README.md b/docs/sdks/destinations/README.md index 1ebbcb78..1c8ec7b9 100644 --- a/docs/sdks/destinations/README.md +++ b/docs/sdks/destinations/README.md @@ -42,7 +42,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | `request` | [operations.CreateConnectionCheckDestinationsRequest](../../models/operations/createconnectioncheckdestinationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -93,7 +92,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `request` | [operations.CreateDestinationRequest](../../models/operations/createdestinationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -135,7 +133,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `request` | [operations.DeleteDestinationRequest](../../models/operations/deletedestinationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -177,7 +174,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `request` | [operations.GetConnectionCheckDestinationsRequest](../../models/operations/getconnectioncheckdestinationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -219,7 +215,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `request` | [operations.GetDestinationRequest](../../models/operations/getdestinationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -259,7 +254,6 @@ with UnstructuredClient() as uc_client: | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `request` | [operations.ListDestinationsRequest](../../models/operations/listdestinationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -311,7 +305,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `request` | [operations.UpdateDestinationRequest](../../models/operations/updatedestinationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/general/README.md b/docs/sdks/general/README.md index 306ba79a..8c6311f9 100644 --- a/docs/sdks/general/README.md +++ b/docs/sdks/general/README.md @@ -51,7 +51,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `request` | [operations.PartitionRequest](../../models/operations/partitionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index 6e70bec4..c0805217 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -41,7 +41,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `request` | [operations.CancelJobRequest](../../models/operations/canceljobrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -85,7 +84,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `request` | [operations.DownloadJobOutputRequest](../../models/operations/downloadjoboutputrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -127,7 +125,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `request` | [operations.GetJobRequest](../../models/operations/getjobrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -169,7 +166,6 @@ with UnstructuredClient() as uc_client: | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `request` | [operations.GetJobDetailsRequest](../../models/operations/getjobdetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -211,7 +207,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `request` | [operations.GetJobFailedFilesRequest](../../models/operations/getjobfailedfilesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -251,7 +246,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `request` | [operations.ListJobsRequest](../../models/operations/listjobsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/sources/README.md b/docs/sdks/sources/README.md index 39cc870e..53d0815e 100644 --- a/docs/sdks/sources/README.md +++ b/docs/sdks/sources/README.md @@ -42,7 +42,6 @@ with UnstructuredClient() as uc_client: | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `request` | [operations.CreateConnectionCheckSourcesRequest](../../models/operations/createconnectionchecksourcesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -96,7 +95,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `request` | [operations.CreateSourceRequest](../../models/operations/createsourcerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -138,7 +136,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `request` | [operations.DeleteSourceRequest](../../models/operations/deletesourcerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -180,7 +177,6 @@ with UnstructuredClient() as uc_client: | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `request` | [operations.GetConnectionCheckSourcesRequest](../../models/operations/getconnectionchecksourcesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -222,7 +218,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `request` | [operations.GetSourceRequest](../../models/operations/getsourcerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -262,7 +257,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `request` | [operations.ListSourcesRequest](../../models/operations/listsourcesrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -314,7 +308,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `request` | [operations.UpdateSourceRequest](../../models/operations/updatesourcerequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index fec33c24..1a45dc4b 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -35,7 +35,6 @@ with UnstructuredClient() as uc_client: | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `request` | [operations.GetEncryptionCertificateRequest](../../models/operations/getencryptioncertificaterequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -79,7 +78,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `request` | [operations.StoreSecretRequest](../../models/operations/storesecretrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index 9ed3f98d..9ecb0808 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -45,7 +45,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `request` | [operations.CreateWorkflowRequest](../../models/operations/createworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -87,7 +86,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `request` | [operations.DeleteWorkflowRequest](../../models/operations/deleteworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -129,7 +127,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `request` | [operations.GetWorkflowRequest](../../models/operations/getworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -169,7 +166,6 @@ with UnstructuredClient() as uc_client: | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `request` | [operations.ListWorkflowsRequest](../../models/operations/listworkflowsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -211,7 +207,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `request` | [operations.RunWorkflowRequest](../../models/operations/runworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response @@ -254,7 +249,6 @@ with UnstructuredClient() as uc_client: | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `request` | [operations.UpdateWorkflowRequest](../../models/operations/updateworkflowrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | -| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | ### Response diff --git a/overlay_client.yaml b/overlay_client.yaml index b8519207..eb5f997b 100644 --- a/overlay_client.yaml +++ b/overlay_client.yaml @@ -4,11 +4,15 @@ info: version: 0.0.0 actions: - target: $ + description: Add a global servers list update: servers: - url: "https://platform.unstructuredapp.io/" description: "Unstructured Platform API" x-speakeasy-server-id: "platform-api" + - target: $.paths.*.*.servers + description: Remove the operation level servers list + remove: true - target: $["components"]["schemas"]["partition_parameters"]["properties"] update: "split_pdf_page": diff --git a/src/unstructured_client/_hooks/custom/clean_server_url_hook.py b/src/unstructured_client/_hooks/custom/clean_server_url_hook.py index d8c04590..e582df14 100644 --- a/src/unstructured_client/_hooks/custom/clean_server_url_hook.py +++ b/src/unstructured_client/_hooks/custom/clean_server_url_hook.py @@ -7,7 +7,7 @@ from unstructured_client.httpclient import HttpClient -def clean_server_url(base_url: str) -> str: +def clean_server_url(base_url: str | None) -> str: """Fix url scheme and remove subpath for URLs under Unstructured domains.""" if not base_url: diff --git a/src/unstructured_client/destinations.py b/src/unstructured_client/destinations.py index 34c137b4..7eb410b6 100644 --- a/src/unstructured_client/destinations.py +++ b/src/unstructured_client/destinations.py @@ -1,5 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from unstructured_client._hooks.custom.clean_server_url_hook import clean_server_url + from .basesdk import BaseSDK from typing import Any, List, Mapping, Optional, Union, cast from unstructured_client import utils @@ -7,11 +7,8 @@ from unstructured_client.models import errors, operations, shared from unstructured_client.types import BaseModel, OptionalNullable, UNSET -class Destinations(BaseSDK): - def get_default_server_url(self) -> str: - client_url, *_ = self.sdk_configuration.get_server_details() - return clean_server_url(client_url) +class Destinations(BaseSDK): def create_connection_check_destinations( self, *, @@ -34,11 +31,16 @@ def create_connection_check_destinations( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal( request, operations.CreateConnectionCheckDestinationsRequest @@ -143,11 +145,15 @@ async def create_connection_check_destinations_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -253,12 +259,16 @@ def create_destination( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() - + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateDestinationRequest) request = cast(operations.CreateDestinationRequest, request) @@ -368,11 +378,15 @@ async def create_destination_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateDestinationRequest) @@ -483,12 +497,15 @@ def delete_destination( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms - + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteDestinationRequest) @@ -590,11 +607,15 @@ async def delete_destination_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteDestinationRequest) @@ -696,12 +717,15 @@ def get_connection_check_destinations( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms - + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -807,11 +831,15 @@ async def get_connection_check_destinations_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -916,11 +944,15 @@ def get_destination( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetDestinationRequest) @@ -1023,11 +1055,15 @@ async def get_destination_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetDestinationRequest) @@ -1131,11 +1167,16 @@ def list_destinations( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListDestinationsRequest) request = cast(operations.ListDestinationsRequest, request) @@ -1239,11 +1280,16 @@ async def list_destinations_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListDestinationsRequest) request = cast(operations.ListDestinationsRequest, request) @@ -1347,11 +1393,15 @@ def update_destination( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateDestinationRequest) @@ -1462,11 +1512,16 @@ async def update_destination_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateDestinationRequest) request = cast(operations.UpdateDestinationRequest, request) diff --git a/src/unstructured_client/general.py b/src/unstructured_client/general.py index 9972ac6e..fb6f76bb 100644 --- a/src/unstructured_client/general.py +++ b/src/unstructured_client/general.py @@ -1,6 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from unstructured_client._hooks.custom.clean_server_url_hook import clean_server_url from .basesdk import BaseSDK from enum import Enum from typing import Any, Dict, List, Mapping, Optional, Union, cast @@ -8,7 +7,8 @@ from unstructured_client._hooks import HookContext from unstructured_client.models import errors, operations, shared from unstructured_client.types import BaseModel, OptionalNullable, UNSET -from unstructured_client.sdkconfiguration import SERVER_PLATFORM_API, SERVERS +from unstructured_client._hooks.custom.clean_server_url_hook import clean_server_url + class PartitionAcceptEnum(str, Enum): APPLICATION_JSON = "application/json" @@ -16,15 +16,6 @@ class PartitionAcceptEnum(str, Enum): class General(BaseSDK): - def get_default_server_url(self) -> str: - client_url, *_ = self.sdk_configuration.get_server_details() - if client_url == SERVERS[SERVER_PLATFORM_API].rstrip("/"): - #Note(yuming):get_server_details will set the default server to platform-api - return operations.PARTITION_SERVERS[ - operations.PARTITION_SERVER_SAAS_API - ].rstrip("/") - return clean_server_url(client_url) - def partition( self, *, @@ -48,12 +39,23 @@ def partition( :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() - + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + # Note(austin): Add a custom check to handle the default server URL + # The SDK globally defaults to the platform URL. + # If that hasn't changed, we need to switch to the partition url here. + base_url = clean_server_url(base_url) + if base_url == "https://platform.unstructuredapp.io": + base_url = "https://api.unstructuredapp.io" + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.PartitionRequest) request = cast(operations.PartitionRequest, request) @@ -171,12 +173,23 @@ async def partition_async( :param accept_header_override: Override the default accept header for this method :param http_headers: Additional headers to set or replace on requests. """ - - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + # Note(austin): Add a custom check to handle the default server URL + # The SDK globally defaults to the platform URL. + # If that hasn't changed, we need to switch to the partition url here. + base_url = clean_server_url(base_url) + if base_url == "https://platform.unstructuredapp.io": + base_url = "https://api.unstructuredapp.io" + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.PartitionRequest) request = cast(operations.PartitionRequest, request) diff --git a/src/unstructured_client/jobs.py b/src/unstructured_client/jobs.py index 31d30305..fe7a5480 100644 --- a/src/unstructured_client/jobs.py +++ b/src/unstructured_client/jobs.py @@ -1,5 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from unstructured_client._hooks.custom.clean_server_url_hook import clean_server_url + from .basesdk import BaseSDK from typing import Any, List, Mapping, Optional, Union, cast from unstructured_client import utils @@ -7,11 +7,8 @@ from unstructured_client.models import errors, operations, shared from unstructured_client.types import BaseModel, OptionalNullable, UNSET + class Jobs(BaseSDK): - def get_default_server_url(self) -> str: - client_url, *_ = self.sdk_configuration.get_server_details() - return clean_server_url(client_url) - def cancel_job( self, *, @@ -33,11 +30,15 @@ def cancel_job( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CancelJobRequest) @@ -138,11 +139,15 @@ async def cancel_job_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CancelJobRequest) @@ -244,12 +249,15 @@ def download_job_output( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms - + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DownloadJobOutputRequest) @@ -351,11 +359,15 @@ async def download_job_output_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DownloadJobOutputRequest) @@ -454,11 +466,15 @@ def get_job( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetJobRequest) @@ -559,11 +575,15 @@ async def get_job_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetJobRequest) @@ -666,11 +686,16 @@ def get_job_details( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetJobDetailsRequest) request = cast(operations.GetJobDetailsRequest, request) @@ -772,11 +797,16 @@ async def get_job_details_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetJobDetailsRequest) request = cast(operations.GetJobDetailsRequest, request) @@ -879,11 +909,16 @@ def get_job_failed_files( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetJobFailedFilesRequest) request = cast(operations.GetJobFailedFilesRequest, request) @@ -986,11 +1021,16 @@ async def get_job_failed_files_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetJobFailedFilesRequest) request = cast(operations.GetJobFailedFilesRequest, request) @@ -1090,11 +1130,16 @@ def list_jobs( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListJobsRequest) request = cast(operations.ListJobsRequest, request) @@ -1194,11 +1239,15 @@ async def list_jobs_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListJobsRequest) diff --git a/src/unstructured_client/models/operations/__init__.py b/src/unstructured_client/models/operations/__init__.py index b3709755..40899f82 100644 --- a/src/unstructured_client/models/operations/__init__.py +++ b/src/unstructured_client/models/operations/__init__.py @@ -5,233 +5,174 @@ if TYPE_CHECKING: from .cancel_job import ( - CANCEL_JOB_SERVERS, - CANCEL_JOB_SERVER_PLATFORM_API, CancelJobRequest, CancelJobRequestTypedDict, CancelJobResponse, CancelJobResponseTypedDict, ) from .create_connection_check_destinations import ( - CREATE_CONNECTION_CHECK_DESTINATIONS_SERVERS, - CREATE_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API, CreateConnectionCheckDestinationsRequest, CreateConnectionCheckDestinationsRequestTypedDict, CreateConnectionCheckDestinationsResponse, CreateConnectionCheckDestinationsResponseTypedDict, ) from .create_connection_check_sources import ( - CREATE_CONNECTION_CHECK_SOURCES_SERVERS, - CREATE_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API, CreateConnectionCheckSourcesRequest, CreateConnectionCheckSourcesRequestTypedDict, CreateConnectionCheckSourcesResponse, CreateConnectionCheckSourcesResponseTypedDict, ) from .create_destination import ( - CREATE_DESTINATION_SERVERS, - CREATE_DESTINATION_SERVER_PLATFORM_API, CreateDestinationRequest, CreateDestinationRequestTypedDict, CreateDestinationResponse, CreateDestinationResponseTypedDict, ) from .create_source import ( - CREATE_SOURCE_SERVERS, - CREATE_SOURCE_SERVER_PLATFORM_API, CreateSourceRequest, CreateSourceRequestTypedDict, CreateSourceResponse, CreateSourceResponseTypedDict, ) from .create_workflow import ( - CREATE_WORKFLOW_SERVERS, - CREATE_WORKFLOW_SERVER_PLATFORM_API, CreateWorkflowRequest, CreateWorkflowRequestTypedDict, CreateWorkflowResponse, CreateWorkflowResponseTypedDict, ) from .delete_destination import ( - DELETE_DESTINATION_SERVERS, - DELETE_DESTINATION_SERVER_PLATFORM_API, DeleteDestinationRequest, DeleteDestinationRequestTypedDict, DeleteDestinationResponse, DeleteDestinationResponseTypedDict, ) from .delete_source import ( - DELETE_SOURCE_SERVERS, - DELETE_SOURCE_SERVER_PLATFORM_API, DeleteSourceRequest, DeleteSourceRequestTypedDict, DeleteSourceResponse, DeleteSourceResponseTypedDict, ) from .delete_workflow import ( - DELETE_WORKFLOW_SERVERS, - DELETE_WORKFLOW_SERVER_PLATFORM_API, DeleteWorkflowRequest, DeleteWorkflowRequestTypedDict, DeleteWorkflowResponse, DeleteWorkflowResponseTypedDict, ) from .download_job_output import ( - DOWNLOAD_JOB_OUTPUT_SERVERS, - DOWNLOAD_JOB_OUTPUT_SERVER_PLATFORM_API, DownloadJobOutputRequest, DownloadJobOutputRequestTypedDict, DownloadJobOutputResponse, DownloadJobOutputResponseTypedDict, ) from .get_connection_check_destinations import ( - GET_CONNECTION_CHECK_DESTINATIONS_SERVERS, - GET_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API, GetConnectionCheckDestinationsRequest, GetConnectionCheckDestinationsRequestTypedDict, GetConnectionCheckDestinationsResponse, GetConnectionCheckDestinationsResponseTypedDict, ) from .get_connection_check_sources import ( - GET_CONNECTION_CHECK_SOURCES_SERVERS, - GET_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API, GetConnectionCheckSourcesRequest, GetConnectionCheckSourcesRequestTypedDict, GetConnectionCheckSourcesResponse, GetConnectionCheckSourcesResponseTypedDict, ) from .get_destination import ( - GET_DESTINATION_SERVERS, - GET_DESTINATION_SERVER_PLATFORM_API, GetDestinationRequest, GetDestinationRequestTypedDict, GetDestinationResponse, GetDestinationResponseTypedDict, ) from .get_encryption_certificate import ( - GET_ENCRYPTION_CERTIFICATE_SERVERS, - GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API, GetEncryptionCertificateRequest, GetEncryptionCertificateRequestTypedDict, GetEncryptionCertificateResponse, GetEncryptionCertificateResponseTypedDict, ) from .get_job import ( - GET_JOB_SERVERS, - GET_JOB_SERVER_PLATFORM_API, GetJobRequest, GetJobRequestTypedDict, GetJobResponse, GetJobResponseTypedDict, ) from .get_job_details import ( - GET_JOB_DETAILS_SERVERS, - GET_JOB_DETAILS_SERVER_PLATFORM_API, GetJobDetailsRequest, GetJobDetailsRequestTypedDict, GetJobDetailsResponse, GetJobDetailsResponseTypedDict, ) from .get_job_failed_files import ( - GET_JOB_FAILED_FILES_SERVERS, - GET_JOB_FAILED_FILES_SERVER_PLATFORM_API, GetJobFailedFilesRequest, GetJobFailedFilesRequestTypedDict, GetJobFailedFilesResponse, GetJobFailedFilesResponseTypedDict, ) from .get_source import ( - GET_SOURCE_SERVERS, - GET_SOURCE_SERVER_PLATFORM_API, GetSourceRequest, GetSourceRequestTypedDict, GetSourceResponse, GetSourceResponseTypedDict, ) from .get_workflow import ( - GET_WORKFLOW_SERVERS, - GET_WORKFLOW_SERVER_PLATFORM_API, GetWorkflowRequest, GetWorkflowRequestTypedDict, GetWorkflowResponse, GetWorkflowResponseTypedDict, ) from .list_destinations import ( - LIST_DESTINATIONS_SERVERS, - LIST_DESTINATIONS_SERVER_PLATFORM_API, ListDestinationsRequest, ListDestinationsRequestTypedDict, ListDestinationsResponse, ListDestinationsResponseTypedDict, ) from .list_jobs import ( - LIST_JOBS_SERVERS, - LIST_JOBS_SERVER_PLATFORM_API, ListJobsRequest, ListJobsRequestTypedDict, ListJobsResponse, ListJobsResponseTypedDict, ) from .list_sources import ( - LIST_SOURCES_SERVERS, - LIST_SOURCES_SERVER_PLATFORM_API, ListSourcesRequest, ListSourcesRequestTypedDict, ListSourcesResponse, ListSourcesResponseTypedDict, ) from .list_workflows import ( - LIST_WORKFLOWS_SERVERS, - LIST_WORKFLOWS_SERVER_PLATFORM_API, ListWorkflowsRequest, ListWorkflowsRequestTypedDict, ListWorkflowsResponse, ListWorkflowsResponseTypedDict, ) from .partition import ( - PARTITION_SERVERS, - PARTITION_SERVER_DEVELOPMENT, - PARTITION_SERVER_SAAS_API, PartitionRequest, PartitionRequestTypedDict, PartitionResponse, PartitionResponseTypedDict, ) from .run_workflow import ( - RUN_WORKFLOW_SERVERS, - RUN_WORKFLOW_SERVER_PLATFORM_API, RunWorkflowRequest, RunWorkflowRequestTypedDict, RunWorkflowResponse, RunWorkflowResponseTypedDict, ) from .store_secret import ( - STORE_SECRET_SERVERS, - STORE_SECRET_SERVER_PLATFORM_API, StoreSecretRequest, StoreSecretRequestTypedDict, StoreSecretResponse, StoreSecretResponseTypedDict, ) from .update_destination import ( - UPDATE_DESTINATION_SERVERS, - UPDATE_DESTINATION_SERVER_PLATFORM_API, UpdateDestinationRequest, UpdateDestinationRequestTypedDict, UpdateDestinationResponse, UpdateDestinationResponseTypedDict, ) from .update_source import ( - UPDATE_SOURCE_SERVERS, - UPDATE_SOURCE_SERVER_PLATFORM_API, UpdateSourceRequest, UpdateSourceRequestTypedDict, UpdateSourceResponse, UpdateSourceResponseTypedDict, ) from .update_workflow import ( - UPDATE_WORKFLOW_SERVERS, - UPDATE_WORKFLOW_SERVER_PLATFORM_API, UpdateWorkflowRequest, UpdateWorkflowRequestTypedDict, UpdateWorkflowResponse, @@ -239,18 +180,6 @@ ) __all__ = [ - "CANCEL_JOB_SERVERS", - "CANCEL_JOB_SERVER_PLATFORM_API", - "CREATE_CONNECTION_CHECK_DESTINATIONS_SERVERS", - "CREATE_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API", - "CREATE_CONNECTION_CHECK_SOURCES_SERVERS", - "CREATE_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API", - "CREATE_DESTINATION_SERVERS", - "CREATE_DESTINATION_SERVER_PLATFORM_API", - "CREATE_SOURCE_SERVERS", - "CREATE_SOURCE_SERVER_PLATFORM_API", - "CREATE_WORKFLOW_SERVERS", - "CREATE_WORKFLOW_SERVER_PLATFORM_API", "CancelJobRequest", "CancelJobRequestTypedDict", "CancelJobResponse", @@ -275,14 +204,6 @@ "CreateWorkflowRequestTypedDict", "CreateWorkflowResponse", "CreateWorkflowResponseTypedDict", - "DELETE_DESTINATION_SERVERS", - "DELETE_DESTINATION_SERVER_PLATFORM_API", - "DELETE_SOURCE_SERVERS", - "DELETE_SOURCE_SERVER_PLATFORM_API", - "DELETE_WORKFLOW_SERVERS", - "DELETE_WORKFLOW_SERVER_PLATFORM_API", - "DOWNLOAD_JOB_OUTPUT_SERVERS", - "DOWNLOAD_JOB_OUTPUT_SERVER_PLATFORM_API", "DeleteDestinationRequest", "DeleteDestinationRequestTypedDict", "DeleteDestinationResponse", @@ -299,24 +220,6 @@ "DownloadJobOutputRequestTypedDict", "DownloadJobOutputResponse", "DownloadJobOutputResponseTypedDict", - "GET_CONNECTION_CHECK_DESTINATIONS_SERVERS", - "GET_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API", - "GET_CONNECTION_CHECK_SOURCES_SERVERS", - "GET_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API", - "GET_DESTINATION_SERVERS", - "GET_DESTINATION_SERVER_PLATFORM_API", - "GET_ENCRYPTION_CERTIFICATE_SERVERS", - "GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API", - "GET_JOB_DETAILS_SERVERS", - "GET_JOB_DETAILS_SERVER_PLATFORM_API", - "GET_JOB_FAILED_FILES_SERVERS", - "GET_JOB_FAILED_FILES_SERVER_PLATFORM_API", - "GET_JOB_SERVERS", - "GET_JOB_SERVER_PLATFORM_API", - "GET_SOURCE_SERVERS", - "GET_SOURCE_SERVER_PLATFORM_API", - "GET_WORKFLOW_SERVERS", - "GET_WORKFLOW_SERVER_PLATFORM_API", "GetConnectionCheckDestinationsRequest", "GetConnectionCheckDestinationsRequestTypedDict", "GetConnectionCheckDestinationsResponse", @@ -353,14 +256,6 @@ "GetWorkflowRequestTypedDict", "GetWorkflowResponse", "GetWorkflowResponseTypedDict", - "LIST_DESTINATIONS_SERVERS", - "LIST_DESTINATIONS_SERVER_PLATFORM_API", - "LIST_JOBS_SERVERS", - "LIST_JOBS_SERVER_PLATFORM_API", - "LIST_SOURCES_SERVERS", - "LIST_SOURCES_SERVER_PLATFORM_API", - "LIST_WORKFLOWS_SERVERS", - "LIST_WORKFLOWS_SERVER_PLATFORM_API", "ListDestinationsRequest", "ListDestinationsRequestTypedDict", "ListDestinationsResponse", @@ -377,31 +272,18 @@ "ListWorkflowsRequestTypedDict", "ListWorkflowsResponse", "ListWorkflowsResponseTypedDict", - "PARTITION_SERVERS", - "PARTITION_SERVER_DEVELOPMENT", - "PARTITION_SERVER_SAAS_API", "PartitionRequest", "PartitionRequestTypedDict", "PartitionResponse", "PartitionResponseTypedDict", - "RUN_WORKFLOW_SERVERS", - "RUN_WORKFLOW_SERVER_PLATFORM_API", "RunWorkflowRequest", "RunWorkflowRequestTypedDict", "RunWorkflowResponse", "RunWorkflowResponseTypedDict", - "STORE_SECRET_SERVERS", - "STORE_SECRET_SERVER_PLATFORM_API", "StoreSecretRequest", "StoreSecretRequestTypedDict", "StoreSecretResponse", "StoreSecretResponseTypedDict", - "UPDATE_DESTINATION_SERVERS", - "UPDATE_DESTINATION_SERVER_PLATFORM_API", - "UPDATE_SOURCE_SERVERS", - "UPDATE_SOURCE_SERVER_PLATFORM_API", - "UPDATE_WORKFLOW_SERVERS", - "UPDATE_WORKFLOW_SERVER_PLATFORM_API", "UpdateDestinationRequest", "UpdateDestinationRequestTypedDict", "UpdateDestinationResponse", @@ -417,177 +299,118 @@ ] _dynamic_imports: dict[str, str] = { - "CANCEL_JOB_SERVERS": ".cancel_job", - "CANCEL_JOB_SERVER_PLATFORM_API": ".cancel_job", "CancelJobRequest": ".cancel_job", "CancelJobRequestTypedDict": ".cancel_job", "CancelJobResponse": ".cancel_job", "CancelJobResponseTypedDict": ".cancel_job", - "CREATE_CONNECTION_CHECK_DESTINATIONS_SERVERS": ".create_connection_check_destinations", - "CREATE_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API": ".create_connection_check_destinations", "CreateConnectionCheckDestinationsRequest": ".create_connection_check_destinations", "CreateConnectionCheckDestinationsRequestTypedDict": ".create_connection_check_destinations", "CreateConnectionCheckDestinationsResponse": ".create_connection_check_destinations", "CreateConnectionCheckDestinationsResponseTypedDict": ".create_connection_check_destinations", - "CREATE_CONNECTION_CHECK_SOURCES_SERVERS": ".create_connection_check_sources", - "CREATE_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API": ".create_connection_check_sources", "CreateConnectionCheckSourcesRequest": ".create_connection_check_sources", "CreateConnectionCheckSourcesRequestTypedDict": ".create_connection_check_sources", "CreateConnectionCheckSourcesResponse": ".create_connection_check_sources", "CreateConnectionCheckSourcesResponseTypedDict": ".create_connection_check_sources", - "CREATE_DESTINATION_SERVERS": ".create_destination", - "CREATE_DESTINATION_SERVER_PLATFORM_API": ".create_destination", "CreateDestinationRequest": ".create_destination", "CreateDestinationRequestTypedDict": ".create_destination", "CreateDestinationResponse": ".create_destination", "CreateDestinationResponseTypedDict": ".create_destination", - "CREATE_SOURCE_SERVERS": ".create_source", - "CREATE_SOURCE_SERVER_PLATFORM_API": ".create_source", "CreateSourceRequest": ".create_source", "CreateSourceRequestTypedDict": ".create_source", "CreateSourceResponse": ".create_source", "CreateSourceResponseTypedDict": ".create_source", - "CREATE_WORKFLOW_SERVERS": ".create_workflow", - "CREATE_WORKFLOW_SERVER_PLATFORM_API": ".create_workflow", "CreateWorkflowRequest": ".create_workflow", "CreateWorkflowRequestTypedDict": ".create_workflow", "CreateWorkflowResponse": ".create_workflow", "CreateWorkflowResponseTypedDict": ".create_workflow", - "DELETE_DESTINATION_SERVERS": ".delete_destination", - "DELETE_DESTINATION_SERVER_PLATFORM_API": ".delete_destination", "DeleteDestinationRequest": ".delete_destination", "DeleteDestinationRequestTypedDict": ".delete_destination", "DeleteDestinationResponse": ".delete_destination", "DeleteDestinationResponseTypedDict": ".delete_destination", - "DELETE_SOURCE_SERVERS": ".delete_source", - "DELETE_SOURCE_SERVER_PLATFORM_API": ".delete_source", "DeleteSourceRequest": ".delete_source", "DeleteSourceRequestTypedDict": ".delete_source", "DeleteSourceResponse": ".delete_source", "DeleteSourceResponseTypedDict": ".delete_source", - "DELETE_WORKFLOW_SERVERS": ".delete_workflow", - "DELETE_WORKFLOW_SERVER_PLATFORM_API": ".delete_workflow", "DeleteWorkflowRequest": ".delete_workflow", "DeleteWorkflowRequestTypedDict": ".delete_workflow", "DeleteWorkflowResponse": ".delete_workflow", "DeleteWorkflowResponseTypedDict": ".delete_workflow", - "DOWNLOAD_JOB_OUTPUT_SERVERS": ".download_job_output", - "DOWNLOAD_JOB_OUTPUT_SERVER_PLATFORM_API": ".download_job_output", "DownloadJobOutputRequest": ".download_job_output", "DownloadJobOutputRequestTypedDict": ".download_job_output", "DownloadJobOutputResponse": ".download_job_output", "DownloadJobOutputResponseTypedDict": ".download_job_output", - "GET_CONNECTION_CHECK_DESTINATIONS_SERVERS": ".get_connection_check_destinations", - "GET_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API": ".get_connection_check_destinations", "GetConnectionCheckDestinationsRequest": ".get_connection_check_destinations", "GetConnectionCheckDestinationsRequestTypedDict": ".get_connection_check_destinations", "GetConnectionCheckDestinationsResponse": ".get_connection_check_destinations", "GetConnectionCheckDestinationsResponseTypedDict": ".get_connection_check_destinations", - "GET_CONNECTION_CHECK_SOURCES_SERVERS": ".get_connection_check_sources", - "GET_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API": ".get_connection_check_sources", "GetConnectionCheckSourcesRequest": ".get_connection_check_sources", "GetConnectionCheckSourcesRequestTypedDict": ".get_connection_check_sources", "GetConnectionCheckSourcesResponse": ".get_connection_check_sources", "GetConnectionCheckSourcesResponseTypedDict": ".get_connection_check_sources", - "GET_DESTINATION_SERVERS": ".get_destination", - "GET_DESTINATION_SERVER_PLATFORM_API": ".get_destination", "GetDestinationRequest": ".get_destination", "GetDestinationRequestTypedDict": ".get_destination", "GetDestinationResponse": ".get_destination", "GetDestinationResponseTypedDict": ".get_destination", - "GET_ENCRYPTION_CERTIFICATE_SERVERS": ".get_encryption_certificate", - "GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API": ".get_encryption_certificate", "GetEncryptionCertificateRequest": ".get_encryption_certificate", "GetEncryptionCertificateRequestTypedDict": ".get_encryption_certificate", "GetEncryptionCertificateResponse": ".get_encryption_certificate", "GetEncryptionCertificateResponseTypedDict": ".get_encryption_certificate", - "GET_JOB_SERVERS": ".get_job", - "GET_JOB_SERVER_PLATFORM_API": ".get_job", "GetJobRequest": ".get_job", "GetJobRequestTypedDict": ".get_job", "GetJobResponse": ".get_job", "GetJobResponseTypedDict": ".get_job", - "GET_JOB_DETAILS_SERVERS": ".get_job_details", - "GET_JOB_DETAILS_SERVER_PLATFORM_API": ".get_job_details", "GetJobDetailsRequest": ".get_job_details", "GetJobDetailsRequestTypedDict": ".get_job_details", "GetJobDetailsResponse": ".get_job_details", "GetJobDetailsResponseTypedDict": ".get_job_details", - "GET_JOB_FAILED_FILES_SERVERS": ".get_job_failed_files", - "GET_JOB_FAILED_FILES_SERVER_PLATFORM_API": ".get_job_failed_files", "GetJobFailedFilesRequest": ".get_job_failed_files", "GetJobFailedFilesRequestTypedDict": ".get_job_failed_files", "GetJobFailedFilesResponse": ".get_job_failed_files", "GetJobFailedFilesResponseTypedDict": ".get_job_failed_files", - "GET_SOURCE_SERVERS": ".get_source", - "GET_SOURCE_SERVER_PLATFORM_API": ".get_source", "GetSourceRequest": ".get_source", "GetSourceRequestTypedDict": ".get_source", "GetSourceResponse": ".get_source", "GetSourceResponseTypedDict": ".get_source", - "GET_WORKFLOW_SERVERS": ".get_workflow", - "GET_WORKFLOW_SERVER_PLATFORM_API": ".get_workflow", "GetWorkflowRequest": ".get_workflow", "GetWorkflowRequestTypedDict": ".get_workflow", "GetWorkflowResponse": ".get_workflow", "GetWorkflowResponseTypedDict": ".get_workflow", - "LIST_DESTINATIONS_SERVERS": ".list_destinations", - "LIST_DESTINATIONS_SERVER_PLATFORM_API": ".list_destinations", "ListDestinationsRequest": ".list_destinations", "ListDestinationsRequestTypedDict": ".list_destinations", "ListDestinationsResponse": ".list_destinations", "ListDestinationsResponseTypedDict": ".list_destinations", - "LIST_JOBS_SERVERS": ".list_jobs", - "LIST_JOBS_SERVER_PLATFORM_API": ".list_jobs", "ListJobsRequest": ".list_jobs", "ListJobsRequestTypedDict": ".list_jobs", "ListJobsResponse": ".list_jobs", "ListJobsResponseTypedDict": ".list_jobs", - "LIST_SOURCES_SERVERS": ".list_sources", - "LIST_SOURCES_SERVER_PLATFORM_API": ".list_sources", "ListSourcesRequest": ".list_sources", "ListSourcesRequestTypedDict": ".list_sources", "ListSourcesResponse": ".list_sources", "ListSourcesResponseTypedDict": ".list_sources", - "LIST_WORKFLOWS_SERVERS": ".list_workflows", - "LIST_WORKFLOWS_SERVER_PLATFORM_API": ".list_workflows", "ListWorkflowsRequest": ".list_workflows", "ListWorkflowsRequestTypedDict": ".list_workflows", "ListWorkflowsResponse": ".list_workflows", "ListWorkflowsResponseTypedDict": ".list_workflows", - "PARTITION_SERVERS": ".partition", - "PARTITION_SERVER_DEVELOPMENT": ".partition", - "PARTITION_SERVER_SAAS_API": ".partition", "PartitionRequest": ".partition", "PartitionRequestTypedDict": ".partition", "PartitionResponse": ".partition", "PartitionResponseTypedDict": ".partition", - "RUN_WORKFLOW_SERVERS": ".run_workflow", - "RUN_WORKFLOW_SERVER_PLATFORM_API": ".run_workflow", "RunWorkflowRequest": ".run_workflow", "RunWorkflowRequestTypedDict": ".run_workflow", "RunWorkflowResponse": ".run_workflow", "RunWorkflowResponseTypedDict": ".run_workflow", - "STORE_SECRET_SERVERS": ".store_secret", - "STORE_SECRET_SERVER_PLATFORM_API": ".store_secret", "StoreSecretRequest": ".store_secret", "StoreSecretRequestTypedDict": ".store_secret", "StoreSecretResponse": ".store_secret", "StoreSecretResponseTypedDict": ".store_secret", - "UPDATE_DESTINATION_SERVERS": ".update_destination", - "UPDATE_DESTINATION_SERVER_PLATFORM_API": ".update_destination", "UpdateDestinationRequest": ".update_destination", "UpdateDestinationRequestTypedDict": ".update_destination", "UpdateDestinationResponse": ".update_destination", "UpdateDestinationResponseTypedDict": ".update_destination", - "UPDATE_SOURCE_SERVERS": ".update_source", - "UPDATE_SOURCE_SERVER_PLATFORM_API": ".update_source", "UpdateSourceRequest": ".update_source", "UpdateSourceRequestTypedDict": ".update_source", "UpdateSourceResponse": ".update_source", "UpdateSourceResponseTypedDict": ".update_source", - "UPDATE_WORKFLOW_SERVERS": ".update_workflow", - "UPDATE_WORKFLOW_SERVER_PLATFORM_API": ".update_workflow", "UpdateWorkflowRequest": ".update_workflow", "UpdateWorkflowRequestTypedDict": ".update_workflow", "UpdateWorkflowResponse": ".update_workflow", diff --git a/src/unstructured_client/models/operations/cancel_job.py b/src/unstructured_client/models/operations/cancel_job.py index 9ebe33b4..d019a11b 100644 --- a/src/unstructured_client/models/operations/cancel_job.py +++ b/src/unstructured_client/models/operations/cancel_job.py @@ -15,13 +15,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -CANCEL_JOB_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CANCEL_JOB_SERVERS = { - CANCEL_JOB_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class CancelJobRequestTypedDict(TypedDict): job_id: str diff --git a/src/unstructured_client/models/operations/create_connection_check_destinations.py b/src/unstructured_client/models/operations/create_connection_check_destinations.py index e2366bb6..7d29fb0b 100644 --- a/src/unstructured_client/models/operations/create_connection_check_destinations.py +++ b/src/unstructured_client/models/operations/create_connection_check_destinations.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -CREATE_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CREATE_CONNECTION_CHECK_DESTINATIONS_SERVERS = { - CREATE_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class CreateConnectionCheckDestinationsRequestTypedDict(TypedDict): destination_id: str diff --git a/src/unstructured_client/models/operations/create_connection_check_sources.py b/src/unstructured_client/models/operations/create_connection_check_sources.py index a7ab4713..16a2a6a5 100644 --- a/src/unstructured_client/models/operations/create_connection_check_sources.py +++ b/src/unstructured_client/models/operations/create_connection_check_sources.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -CREATE_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CREATE_CONNECTION_CHECK_SOURCES_SERVERS = { - CREATE_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class CreateConnectionCheckSourcesRequestTypedDict(TypedDict): source_id: str diff --git a/src/unstructured_client/models/operations/create_destination.py b/src/unstructured_client/models/operations/create_destination.py index 7f2b8589..b2bc7e0b 100644 --- a/src/unstructured_client/models/operations/create_destination.py +++ b/src/unstructured_client/models/operations/create_destination.py @@ -19,13 +19,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, RequestMetadata -CREATE_DESTINATION_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CREATE_DESTINATION_SERVERS = { - CREATE_DESTINATION_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class CreateDestinationRequestTypedDict(TypedDict): create_destination_connector: ( diff --git a/src/unstructured_client/models/operations/create_source.py b/src/unstructured_client/models/operations/create_source.py index bceca31f..9856e6e7 100644 --- a/src/unstructured_client/models/operations/create_source.py +++ b/src/unstructured_client/models/operations/create_source.py @@ -19,13 +19,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, RequestMetadata -CREATE_SOURCE_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CREATE_SOURCE_SERVERS = { - CREATE_SOURCE_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class CreateSourceRequestTypedDict(TypedDict): create_source_connector: shared_createsourceconnector.CreateSourceConnectorTypedDict diff --git a/src/unstructured_client/models/operations/create_workflow.py b/src/unstructured_client/models/operations/create_workflow.py index d3fc1f49..7a0523a6 100644 --- a/src/unstructured_client/models/operations/create_workflow.py +++ b/src/unstructured_client/models/operations/create_workflow.py @@ -19,13 +19,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, RequestMetadata -CREATE_WORKFLOW_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CREATE_WORKFLOW_SERVERS = { - CREATE_WORKFLOW_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class CreateWorkflowRequestTypedDict(TypedDict): create_workflow: shared_createworkflow.CreateWorkflowTypedDict diff --git a/src/unstructured_client/models/operations/delete_destination.py b/src/unstructured_client/models/operations/delete_destination.py index 0dca87ea..6e11a602 100644 --- a/src/unstructured_client/models/operations/delete_destination.py +++ b/src/unstructured_client/models/operations/delete_destination.py @@ -15,13 +15,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -DELETE_DESTINATION_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -DELETE_DESTINATION_SERVERS = { - DELETE_DESTINATION_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class DeleteDestinationRequestTypedDict(TypedDict): destination_id: str diff --git a/src/unstructured_client/models/operations/delete_source.py b/src/unstructured_client/models/operations/delete_source.py index 7a66281d..490ea566 100644 --- a/src/unstructured_client/models/operations/delete_source.py +++ b/src/unstructured_client/models/operations/delete_source.py @@ -15,13 +15,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -DELETE_SOURCE_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -DELETE_SOURCE_SERVERS = { - DELETE_SOURCE_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class DeleteSourceRequestTypedDict(TypedDict): source_id: str diff --git a/src/unstructured_client/models/operations/delete_workflow.py b/src/unstructured_client/models/operations/delete_workflow.py index 1894134f..6813dcb6 100644 --- a/src/unstructured_client/models/operations/delete_workflow.py +++ b/src/unstructured_client/models/operations/delete_workflow.py @@ -15,13 +15,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -DELETE_WORKFLOW_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -DELETE_WORKFLOW_SERVERS = { - DELETE_WORKFLOW_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class DeleteWorkflowRequestTypedDict(TypedDict): workflow_id: str diff --git a/src/unstructured_client/models/operations/download_job_output.py b/src/unstructured_client/models/operations/download_job_output.py index 7d7c941b..c11e2837 100644 --- a/src/unstructured_client/models/operations/download_job_output.py +++ b/src/unstructured_client/models/operations/download_job_output.py @@ -20,13 +20,6 @@ QueryParamMetadata, ) -DOWNLOAD_JOB_OUTPUT_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -DOWNLOAD_JOB_OUTPUT_SERVERS = { - DOWNLOAD_JOB_OUTPUT_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class DownloadJobOutputRequestTypedDict(TypedDict): file_id: str diff --git a/src/unstructured_client/models/operations/get_connection_check_destinations.py b/src/unstructured_client/models/operations/get_connection_check_destinations.py index e80a2841..23802f38 100644 --- a/src/unstructured_client/models/operations/get_connection_check_destinations.py +++ b/src/unstructured_client/models/operations/get_connection_check_destinations.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_CONNECTION_CHECK_DESTINATIONS_SERVERS = { - GET_CONNECTION_CHECK_DESTINATIONS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetConnectionCheckDestinationsRequestTypedDict(TypedDict): destination_id: str diff --git a/src/unstructured_client/models/operations/get_connection_check_sources.py b/src/unstructured_client/models/operations/get_connection_check_sources.py index 55b9eb6a..4c3d0a4c 100644 --- a/src/unstructured_client/models/operations/get_connection_check_sources.py +++ b/src/unstructured_client/models/operations/get_connection_check_sources.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_CONNECTION_CHECK_SOURCES_SERVERS = { - GET_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetConnectionCheckSourcesRequestTypedDict(TypedDict): source_id: str diff --git a/src/unstructured_client/models/operations/get_destination.py b/src/unstructured_client/models/operations/get_destination.py index fb7c1f65..0be0e568 100644 --- a/src/unstructured_client/models/operations/get_destination.py +++ b/src/unstructured_client/models/operations/get_destination.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_DESTINATION_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_DESTINATION_SERVERS = { - GET_DESTINATION_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetDestinationRequestTypedDict(TypedDict): destination_id: str diff --git a/src/unstructured_client/models/operations/get_encryption_certificate.py b/src/unstructured_client/models/operations/get_encryption_certificate.py index 5b25e300..00cc0250 100644 --- a/src/unstructured_client/models/operations/get_encryption_certificate.py +++ b/src/unstructured_client/models/operations/get_encryption_certificate.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata -GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_ENCRYPTION_CERTIFICATE_SERVERS = { - GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetEncryptionCertificateRequestTypedDict(TypedDict): unstructured_api_key: NotRequired[Nullable[str]] diff --git a/src/unstructured_client/models/operations/get_job.py b/src/unstructured_client/models/operations/get_job.py index 96c4dcb1..18224e47 100644 --- a/src/unstructured_client/models/operations/get_job.py +++ b/src/unstructured_client/models/operations/get_job.py @@ -16,13 +16,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_JOB_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_JOB_SERVERS = { - GET_JOB_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetJobRequestTypedDict(TypedDict): job_id: str diff --git a/src/unstructured_client/models/operations/get_job_details.py b/src/unstructured_client/models/operations/get_job_details.py index d19f1dd5..325a64b8 100644 --- a/src/unstructured_client/models/operations/get_job_details.py +++ b/src/unstructured_client/models/operations/get_job_details.py @@ -16,13 +16,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_JOB_DETAILS_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_JOB_DETAILS_SERVERS = { - GET_JOB_DETAILS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetJobDetailsRequestTypedDict(TypedDict): job_id: str diff --git a/src/unstructured_client/models/operations/get_job_failed_files.py b/src/unstructured_client/models/operations/get_job_failed_files.py index 798148d6..4ecd2cb0 100644 --- a/src/unstructured_client/models/operations/get_job_failed_files.py +++ b/src/unstructured_client/models/operations/get_job_failed_files.py @@ -16,13 +16,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_JOB_FAILED_FILES_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_JOB_FAILED_FILES_SERVERS = { - GET_JOB_FAILED_FILES_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetJobFailedFilesRequestTypedDict(TypedDict): job_id: str diff --git a/src/unstructured_client/models/operations/get_source.py b/src/unstructured_client/models/operations/get_source.py index 746758fa..2f003ad0 100644 --- a/src/unstructured_client/models/operations/get_source.py +++ b/src/unstructured_client/models/operations/get_source.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_SOURCE_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_SOURCE_SERVERS = { - GET_SOURCE_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetSourceRequestTypedDict(TypedDict): source_id: str diff --git a/src/unstructured_client/models/operations/get_workflow.py b/src/unstructured_client/models/operations/get_workflow.py index 6df4abb8..fac7080e 100644 --- a/src/unstructured_client/models/operations/get_workflow.py +++ b/src/unstructured_client/models/operations/get_workflow.py @@ -18,13 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata -GET_WORKFLOW_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_WORKFLOW_SERVERS = { - GET_WORKFLOW_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class GetWorkflowRequestTypedDict(TypedDict): workflow_id: str diff --git a/src/unstructured_client/models/operations/list_destinations.py b/src/unstructured_client/models/operations/list_destinations.py index 7244e1c7..b7cd2310 100644 --- a/src/unstructured_client/models/operations/list_destinations.py +++ b/src/unstructured_client/models/operations/list_destinations.py @@ -19,13 +19,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata -LIST_DESTINATIONS_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -LIST_DESTINATIONS_SERVERS = { - LIST_DESTINATIONS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class ListDestinationsRequestTypedDict(TypedDict): destination_type: NotRequired[ diff --git a/src/unstructured_client/models/operations/list_jobs.py b/src/unstructured_client/models/operations/list_jobs.py index 042d4f98..0e0b27ce 100644 --- a/src/unstructured_client/models/operations/list_jobs.py +++ b/src/unstructured_client/models/operations/list_jobs.py @@ -16,13 +16,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata -LIST_JOBS_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -LIST_JOBS_SERVERS = { - LIST_JOBS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class ListJobsRequestTypedDict(TypedDict): status: NotRequired[Nullable[str]] diff --git a/src/unstructured_client/models/operations/list_sources.py b/src/unstructured_client/models/operations/list_sources.py index d3173496..3695fc3b 100644 --- a/src/unstructured_client/models/operations/list_sources.py +++ b/src/unstructured_client/models/operations/list_sources.py @@ -19,13 +19,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata -LIST_SOURCES_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -LIST_SOURCES_SERVERS = { - LIST_SOURCES_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class ListSourcesRequestTypedDict(TypedDict): source_type: NotRequired[Nullable[shared_sourceconnectortype.SourceConnectorType]] diff --git a/src/unstructured_client/models/operations/list_workflows.py b/src/unstructured_client/models/operations/list_workflows.py index 8f08c85f..40ecc050 100644 --- a/src/unstructured_client/models/operations/list_workflows.py +++ b/src/unstructured_client/models/operations/list_workflows.py @@ -21,13 +21,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata -LIST_WORKFLOWS_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -LIST_WORKFLOWS_SERVERS = { - LIST_WORKFLOWS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class ListWorkflowsRequestTypedDict(TypedDict): created_before: NotRequired[Nullable[datetime]] diff --git a/src/unstructured_client/models/operations/partition.py b/src/unstructured_client/models/operations/partition.py index 11ddfd70..de4664fb 100644 --- a/src/unstructured_client/models/operations/partition.py +++ b/src/unstructured_client/models/operations/partition.py @@ -18,17 +18,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, RequestMetadata -PARTITION_SERVER_SAAS_API = "saas-api" -r"""Serverless SaaS API""" - -PARTITION_SERVER_DEVELOPMENT = "development" -r"""Development server""" - -PARTITION_SERVERS = { - PARTITION_SERVER_SAAS_API: "https://api.unstructuredapp.io", - PARTITION_SERVER_DEVELOPMENT: "http://localhost:8000", -} - class PartitionRequestTypedDict(TypedDict): partition_parameters: shared_partition_parameters.PartitionParametersTypedDict diff --git a/src/unstructured_client/models/operations/run_workflow.py b/src/unstructured_client/models/operations/run_workflow.py index ad6969ff..7828d0e3 100644 --- a/src/unstructured_client/models/operations/run_workflow.py +++ b/src/unstructured_client/models/operations/run_workflow.py @@ -24,13 +24,6 @@ RequestMetadata, ) -RUN_WORKFLOW_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -RUN_WORKFLOW_SERVERS = { - RUN_WORKFLOW_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class RunWorkflowRequestTypedDict(TypedDict): workflow_id: str diff --git a/src/unstructured_client/models/operations/store_secret.py b/src/unstructured_client/models/operations/store_secret.py index c147a67e..fe5eb8ad 100644 --- a/src/unstructured_client/models/operations/store_secret.py +++ b/src/unstructured_client/models/operations/store_secret.py @@ -19,13 +19,6 @@ ) from unstructured_client.utils import FieldMetadata, HeaderMetadata, RequestMetadata -STORE_SECRET_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -STORE_SECRET_SERVERS = { - STORE_SECRET_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class StoreSecretRequestTypedDict(TypedDict): encrypted_secret: shared_encryptedsecret.EncryptedSecretTypedDict diff --git a/src/unstructured_client/models/operations/update_destination.py b/src/unstructured_client/models/operations/update_destination.py index 08acbfb0..0aefa79f 100644 --- a/src/unstructured_client/models/operations/update_destination.py +++ b/src/unstructured_client/models/operations/update_destination.py @@ -24,13 +24,6 @@ RequestMetadata, ) -UPDATE_DESTINATION_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -UPDATE_DESTINATION_SERVERS = { - UPDATE_DESTINATION_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class UpdateDestinationRequestTypedDict(TypedDict): update_destination_connector: ( diff --git a/src/unstructured_client/models/operations/update_source.py b/src/unstructured_client/models/operations/update_source.py index 1ce7d5e2..9f5e9e31 100644 --- a/src/unstructured_client/models/operations/update_source.py +++ b/src/unstructured_client/models/operations/update_source.py @@ -24,13 +24,6 @@ RequestMetadata, ) -UPDATE_SOURCE_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -UPDATE_SOURCE_SERVERS = { - UPDATE_SOURCE_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class UpdateSourceRequestTypedDict(TypedDict): update_source_connector: shared_updatesourceconnector.UpdateSourceConnectorTypedDict diff --git a/src/unstructured_client/models/operations/update_workflow.py b/src/unstructured_client/models/operations/update_workflow.py index 88003b5b..8f127dbf 100644 --- a/src/unstructured_client/models/operations/update_workflow.py +++ b/src/unstructured_client/models/operations/update_workflow.py @@ -24,13 +24,6 @@ RequestMetadata, ) -UPDATE_WORKFLOW_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -UPDATE_WORKFLOW_SERVERS = { - UPDATE_WORKFLOW_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - class UpdateWorkflowRequestTypedDict(TypedDict): update_workflow: shared_updateworkflow.UpdateWorkflowTypedDict diff --git a/src/unstructured_client/sources.py b/src/unstructured_client/sources.py index 4e6e428b..86d398b0 100644 --- a/src/unstructured_client/sources.py +++ b/src/unstructured_client/sources.py @@ -1,5 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from unstructured_client._hooks.custom.clean_server_url_hook import clean_server_url + from .basesdk import BaseSDK from typing import Any, List, Mapping, Optional, Union, cast from unstructured_client import utils @@ -7,11 +7,8 @@ from unstructured_client.models import errors, operations, shared from unstructured_client.types import BaseModel, OptionalNullable, UNSET + class Sources(BaseSDK): - def get_default_server_url(self) -> str: - client_url, *_ = self.sdk_configuration.get_server_details() - return clean_server_url(client_url) - def create_connection_check_sources( self, *, @@ -34,11 +31,15 @@ def create_connection_check_sources( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -144,11 +145,15 @@ async def create_connection_check_sources_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -253,11 +258,15 @@ def create_source( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateSourceRequest) @@ -367,11 +376,15 @@ async def create_source_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateSourceRequest) @@ -481,11 +494,16 @@ def delete_source( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteSourceRequest) request = cast(operations.DeleteSourceRequest, request) @@ -585,11 +603,15 @@ async def delete_source_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteSourceRequest) @@ -691,12 +713,15 @@ def get_connection_check_sources( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms - + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -802,11 +827,15 @@ async def get_connection_check_sources_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -911,11 +940,15 @@ def get_source( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetSourceRequest) @@ -1018,11 +1051,15 @@ async def get_source_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetSourceRequest) @@ -1125,11 +1162,15 @@ def list_sources( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListSourcesRequest) @@ -1232,11 +1273,16 @@ async def list_sources_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListSourcesRequest) request = cast(operations.ListSourcesRequest, request) @@ -1338,11 +1384,15 @@ def update_source( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateSourceRequest) @@ -1452,11 +1502,15 @@ async def update_source_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateSourceRequest) diff --git a/src/unstructured_client/users.py b/src/unstructured_client/users.py index 32a8558d..f3217703 100644 --- a/src/unstructured_client/users.py +++ b/src/unstructured_client/users.py @@ -203,9 +203,7 @@ def get_encryption_certificate( if server_url is not None: base_url = server_url else: - base_url = operations.GET_ENCRYPTION_CERTIFICATE_SERVERS[ - operations.GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API - ] + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -319,9 +317,7 @@ async def get_encryption_certificate_async( if server_url is not None: base_url = server_url else: - base_url = operations.GET_ENCRYPTION_CERTIFICATE_SERVERS[ - operations.GET_ENCRYPTION_CERTIFICATE_SERVER_PLATFORM_API - ] + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -434,9 +430,7 @@ def store_secret( if server_url is not None: base_url = server_url else: - base_url = operations.STORE_SECRET_SERVERS[ - operations.STORE_SECRET_SERVER_PLATFORM_API - ] + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.StoreSecretRequest) @@ -550,9 +544,7 @@ async def store_secret_async( if server_url is not None: base_url = server_url else: - base_url = operations.STORE_SECRET_SERVERS[ - operations.STORE_SECRET_SERVER_PLATFORM_API - ] + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.StoreSecretRequest) diff --git a/src/unstructured_client/workflows.py b/src/unstructured_client/workflows.py index 3752c8b2..532e8ea5 100644 --- a/src/unstructured_client/workflows.py +++ b/src/unstructured_client/workflows.py @@ -1,5 +1,5 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from unstructured_client._hooks.custom.clean_server_url_hook import clean_server_url + from .basesdk import BaseSDK from typing import Any, List, Mapping, Optional, Union, cast from unstructured_client import utils @@ -9,10 +9,6 @@ class Workflows(BaseSDK): - def get_default_server_url(self) -> str: - client_url, *_ = self.sdk_configuration.get_server_details() - return clean_server_url(client_url) - def create_workflow( self, *, @@ -34,11 +30,15 @@ def create_workflow( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateWorkflowRequest) @@ -144,11 +144,15 @@ async def create_workflow_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.CreateWorkflowRequest) @@ -254,12 +258,15 @@ def delete_workflow( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms - + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteWorkflowRequest) @@ -360,11 +367,15 @@ async def delete_workflow_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.DeleteWorkflowRequest) @@ -465,11 +476,15 @@ def get_workflow( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkflowRequest) @@ -572,11 +587,15 @@ async def get_workflow_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetWorkflowRequest) @@ -679,11 +698,15 @@ def list_workflows( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListWorkflowsRequest) @@ -786,11 +809,15 @@ async def list_workflows_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.ListWorkflowsRequest) @@ -893,11 +920,15 @@ def run_workflow( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.RunWorkflowRequest) @@ -1007,11 +1038,15 @@ async def run_workflow_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.RunWorkflowRequest) @@ -1121,11 +1156,15 @@ def update_workflow( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateWorkflowRequest) @@ -1231,11 +1270,15 @@ async def update_workflow_async( :param timeout_ms: Override the default request timeout configuration for this method in milliseconds :param http_headers: Additional headers to set or replace on requests. """ - base_url = clean_server_url(server_url) if server_url is not None else self.get_default_server_url() + base_url = None url_variables = None if timeout_ms is None: timeout_ms = self.sdk_configuration.timeout_ms + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.UpdateWorkflowRequest)