From 3dd899c61c3bbf6a9fc691b0a70fff53ea346ccc Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 17 Apr 2025 19:50:00 +0000 Subject: [PATCH 1/3] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.535.0 --- .speakeasy/gen.lock | 26 +- .speakeasy/workflow.lock | 10 +- README.md | 98 +--- RELEASES.md | 11 + USAGE.md | 38 +- codeSamples.yaml | 26 +- ...urcessourceidconnectioncheckpostrequest.md | 9 + ...rcessourceidconnectioncheckpostresponse.md | 11 + ...destinationidconnectioncheckpostrequest.md | 9 + ...estinationidconnectioncheckpostresponse.md | 11 + ...ourcessourceidconnectioncheckgetrequest.md | 9 + ...urcessourceidconnectioncheckgetresponse.md | 11 + ...sdestinationidconnectioncheckgetrequest.md | 9 + ...destinationidconnectioncheckgetresponse.md | 11 + docs/models/shared/config.md | 6 - docs/models/shared/connectioncheckstatus.md | 10 + docs/models/shared/dagnodeconnectioncheck.md | 12 + .../destinationconnectorinformationconfig.md | 6 - .../models/shared/destinationconnectortype.md | 1 - .../updatedestinationconnectorconfig.md | 6 - docs/models/shared/workflownode.md | 14 +- docs/sdks/destinations/README.md | 108 +++- docs/sdks/sources/README.md | 106 ++++ gen.yaml | 2 +- pyproject.toml | 2 +- src/unstructured_client/_version.py | 6 +- src/unstructured_client/destinations.py | 516 ++++++++++++++++++ .../models/operations/__init__.py | 56 ++ ...sources_source_id_connection_check_post.py | 106 ++++ ...ns_destination_id_connection_check_post.py | 110 ++++ ..._sources_source_id_connection_check_get.py | 106 ++++ ...ons_destination_id_connection_check_get.py | 110 ++++ .../models/shared/__init__.py | 22 +- .../models/shared/connectioncheckstatus.py | 10 + .../shared/createdestinationconnector.py | 18 +- .../models/shared/dagnodeconnectioncheck.py | 64 +++ .../shared/destinationconnectorinformation.py | 18 +- .../models/shared/destinationconnectortype.py | 1 - .../shared/updatedestinationconnector.py | 18 +- .../models/shared/workflownode.py | 5 +- src/unstructured_client/sources.py | 516 ++++++++++++++++++ 41 files changed, 2041 insertions(+), 203 deletions(-) create mode 100644 docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md create mode 100644 docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md create mode 100644 docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md create mode 100644 docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md create mode 100644 docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md create mode 100644 docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md create mode 100644 docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md create mode 100644 docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md create mode 100644 docs/models/shared/connectioncheckstatus.md create mode 100644 docs/models/shared/dagnodeconnectioncheck.md create mode 100644 src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py create mode 100644 src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py create mode 100644 src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py create mode 100644 src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py create mode 100644 src/unstructured_client/models/shared/connectioncheckstatus.py create mode 100644 src/unstructured_client/models/shared/dagnodeconnectioncheck.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index db48ee55..b83292ba 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b5fa338-9106-4734-abf0-e30d67044a90 management: - docChecksum: a22c1e202b7ac1f3305521fb7827a79d + docChecksum: e3c8da4d880f93f1bf483a45d1fe2016 docVersion: 1.1.7 - speakeasyVersion: 1.534.0 - generationVersion: 2.585.0 - releaseVersion: 0.32.4 - configChecksum: cb28766c7ee08012d26a252eff80b540 + speakeasyVersion: 1.535.0 + generationVersion: 2.585.1 + releaseVersion: 0.32.5 + configChecksum: 5d74cee3ebe277ae6317c1ab5ec5aba1 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -46,6 +46,10 @@ generatedFiles: - docs/models/errors/servererror.md - docs/models/operations/canceljobrequest.md - docs/models/operations/canceljobresponse.md + - docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md + - docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md + - docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md + - docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md - docs/models/operations/createdestinationrequest.md - docs/models/operations/createdestinationresponse.md - docs/models/operations/createsourcerequest.md @@ -60,6 +64,10 @@ generatedFiles: - docs/models/operations/deleteworkflowresponse.md - docs/models/operations/downloadjoboutputrequest.md - docs/models/operations/downloadjoboutputresponse.md + - docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md + - docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md + - docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md + - docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md - docs/models/operations/getdestinationrequest.md - docs/models/operations/getdestinationresponse.md - docs/models/operations/getjobrequest.md @@ -98,6 +106,7 @@ generatedFiles: - docs/models/shared/config.md - docs/models/shared/confluencesourceconnectorconfig.md - docs/models/shared/confluencesourceconnectorconfiginput.md + - docs/models/shared/connectioncheckstatus.md - docs/models/shared/couchbasedestinationconnectorconfig.md - docs/models/shared/couchbasedestinationconnectorconfiginput.md - docs/models/shared/couchbasesourceconnectorconfig.md @@ -107,6 +116,7 @@ generatedFiles: - docs/models/shared/createsourceconnectorconfig.md - docs/models/shared/createworkflow.md - docs/models/shared/crontabentry.md + - docs/models/shared/dagnodeconnectioncheck.md - docs/models/shared/databricksvdtdestinationconnectorconfig.md - docs/models/shared/databricksvdtdestinationconnectorconfiginput.md - docs/models/shared/databricksvolumesconnectorconfig.md @@ -227,6 +237,8 @@ generatedFiles: - src/unstructured_client/models/errors/servererror.py - src/unstructured_client/models/operations/__init__.py - src/unstructured_client/models/operations/cancel_job.py + - src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py + - src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py - src/unstructured_client/models/operations/create_destination.py - src/unstructured_client/models/operations/create_source.py - src/unstructured_client/models/operations/create_workflow.py @@ -234,7 +246,9 @@ generatedFiles: - src/unstructured_client/models/operations/delete_source.py - src/unstructured_client/models/operations/delete_workflow.py - src/unstructured_client/models/operations/download_job_output.py + - src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py - src/unstructured_client/models/operations/get_destination.py + - src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py - src/unstructured_client/models/operations/get_job.py - src/unstructured_client/models/operations/get_source.py - src/unstructured_client/models/operations/get_workflow.py @@ -259,6 +273,7 @@ generatedFiles: - src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py - src/unstructured_client/models/shared/confluencesourceconnectorconfig.py - src/unstructured_client/models/shared/confluencesourceconnectorconfiginput.py + - src/unstructured_client/models/shared/connectioncheckstatus.py - src/unstructured_client/models/shared/couchbasedestinationconnectorconfig.py - src/unstructured_client/models/shared/couchbasedestinationconnectorconfiginput.py - src/unstructured_client/models/shared/couchbasesourceconnectorconfig.py @@ -267,6 +282,7 @@ generatedFiles: - src/unstructured_client/models/shared/createsourceconnector.py - src/unstructured_client/models/shared/createworkflow.py - src/unstructured_client/models/shared/crontabentry.py + - src/unstructured_client/models/shared/dagnodeconnectioncheck.py - src/unstructured_client/models/shared/databricksvdtdestinationconnectorconfig.py - src/unstructured_client/models/shared/databricksvdtdestinationconnectorconfiginput.py - src/unstructured_client/models/shared/databricksvolumesconnectorconfig.py diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index bd8f6556..dbb4a0a9 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.533.0 +speakeasyVersion: 1.535.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:a8e522e14e6e4dcd554243ec05cd244661f123d20a034f554450fde6ac22df5d + sourceRevisionDigest: sha256:8682267837b89a2ee79370a4ad952198440742fd4e6da24fd6c8061be3e52c03 sourceBlobDigest: sha256:1549523a97b9ebd09012362367f313beb08069f42290a5186a65854ceff2ecd1 tags: - latest - - speakeasy-sdk-regen-1744330218 + - speakeasy-sdk-regen-1744919342 - 1.1.7 targets: unstructured-python: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:a8e522e14e6e4dcd554243ec05cd244661f123d20a034f554450fde6ac22df5d + sourceRevisionDigest: sha256:8682267837b89a2ee79370a4ad952198440742fd4e6da24fd6c8061be3e52c03 sourceBlobDigest: sha256:1549523a97b9ebd09012362367f313beb08069f42290a5186a65854ceff2ecd1 codeSamplesNamespace: my-source-code-samples - codeSamplesRevisionDigest: sha256:c2682243f39e191854da0810e5ebd887bb5fd4efc65079432c521644f0ee2945 + codeSamplesRevisionDigest: sha256:42c3a9e6802072bcdb162dd89daa5b4a59b92c4dffd0b852e212812845f6b556 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index bf0b554c..b01df1f7 100755 --- a/README.md +++ b/README.md @@ -110,38 +110,26 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python from unstructured_client import UnstructuredClient -from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig with UnstructuredClient() as uc_client: - res = uc_client.destinations.create_destination(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python from unstructured_client import UnstructuredClient -from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig @@ -149,24 +137,14 @@ with UnstructuredClient( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), ) as uc_client: - res = uc_client.destinations.create_destination(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) ``` @@ -186,7 +164,7 @@ By default, an API error will raise a errors.SDKError exception, which has the f | `.raw_response` | *httpx.Response* | The raw HTTP response | | `.body` | *str* | The response content | -When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_destination_async` method may raise the following exceptions: +When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async` method may raise the following exceptions: | Error Type | Status Code | Content Type | | -------------------------- | ----------- | ---------------- | @@ -197,31 +175,21 @@ When custom error responses are specified for an operation, the SDK may also rai ```python from unstructured_client import UnstructuredClient -from unstructured_client.models import errors, shared +from unstructured_client.models import errors with UnstructuredClient() as uc_client: res = None try: - res = uc_client.destinations.create_destination(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) except errors.HTTPValidationError as e: # handle e.data: errors.HTTPValidationErrorData @@ -332,29 +300,18 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u ```python # Synchronous Example from unstructured_client import UnstructuredClient -from unstructured_client.models import shared with UnstructuredClient() as uc_client: - res = uc_client.destinations.create_destination(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) ```
@@ -364,30 +321,19 @@ The same SDK client can also be used to make asychronous requests by importing a # Asynchronous Example import asyncio from unstructured_client import UnstructuredClient -from unstructured_client.models import shared async def main(): async with UnstructuredClient() as uc_client: - res = await uc_client.destinations.create_destination_async(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = await uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) asyncio.run(main()) ``` diff --git a/RELEASES.md b/RELEASES.md index 56081551..d1d1b654 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -956,3 +956,14 @@ Based on: - [python v0.32.4] . ### Releases - [PyPI v0.32.4] https://pypi.org/project/unstructured-client/0.32.4 - . + + +## 2025-04-17 19:48:46 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.535.0 (2.585.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.32.5] . +### Releases +- [PyPI v0.32.5] https://pypi.org/project/unstructured-client/0.32.5 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index e08d5e01..984a513c 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,29 +2,18 @@ ```python # Synchronous Example from unstructured_client import UnstructuredClient -from unstructured_client.models import shared with UnstructuredClient() as uc_client: - res = uc_client.destinations.create_destination(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) ```
@@ -34,30 +23,19 @@ The same SDK client can also be used to make asychronous requests by importing a # Asynchronous Example import asyncio from unstructured_client import UnstructuredClient -from unstructured_client.models import shared async def main(): async with UnstructuredClient() as uc_client: - res = await uc_client.destinations.create_destination_async(request={ - "create_destination_connector": { - "config": { - "api_endpoint": "", - "batch_size": 20, - "collection_name": "", - "flatten_metadata": False, - "token": "", - }, - "name": "", - "type": shared.DestinationConnectorType.AZURE, - }, + res = await uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", }) - assert res.destination_connector_information is not None + assert res.dag_node_connection_check is not None # Handle response - print(res.destination_connector_information) + print(res.dag_node_connection_check) asyncio.run(main()) ``` diff --git a/codeSamples.yaml b/codeSamples.yaml index cb83c5a6..59130d07 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -14,7 +14,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "create_destination" - "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.create_destination(request={\n \"create_destination_connector\": {\n \"name\": \"\",\n \"type\": shared.DestinationConnectorType.ASTRADB,\n \"config\": {\n \"remote_url\": \"https://fortunate-appliance.info\",\n \"anonymous\": False,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" + "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.create_destination(request={\n \"create_destination_connector\": {\n \"name\": \"\",\n \"type\": shared.DestinationConnectorType.AZURE_AI_SEARCH,\n \"config\": {\n \"collection_name\": \"\",\n \"batch_size\": 20,\n \"api_endpoint\": \"\",\n \"token\": \"\",\n \"flatten_metadata\": False,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" - target: $["paths"]["/api/v1/destinations/{destination_id}"]["delete"] update: "x-codeSamples": @@ -33,6 +33,18 @@ actions: - "lang": "python" "label": "update_destination" "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.update_destination(request={\n \"destination_id\": \"9ea9d27c-4e2e-4cb5-9a69-71bd7ec9d226\",\n \"update_destination_connector\": {\n \"config\": {\n \"host\": \"acidic-patroller.com\",\n \"database\": \"\",\n \"port\": 832931,\n \"username\": \"Salvador.Walsh-Thiel\",\n \"password\": \"vIMqbllzrdJBExE\",\n \"table_name\": \"\",\n \"batch_size\": 977983,\n },\n },\n })\n\n assert res.destination_connector_information is not None\n\n # Handle response\n print(res.destination_connector_information)" + - target: $["paths"]["/api/v1/destinations/{destination_id}/connection-check"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "get_destination_connection_check_api_v1_destinations__destination_id__connection_check_get" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get(request={\n \"destination_id\": \"3c48df35-2b2c-46f2-9aa2-d7eae993797c\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)" + - target: $["paths"]["/api/v1/destinations/{destination_id}/connection-check"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "check_destination_connection_api_v1_destinations__destination_id__connection_check_post" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={\n \"destination_id\": \"b65169f5-79ba-4464-918f-b0be2c07b962\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)" - target: $["paths"]["/api/v1/jobs/"]["get"] update: "x-codeSamples": @@ -87,6 +99,18 @@ actions: - "lang": "python" "label": "update_source" "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.update_source(request={\n \"source_id\": \"396edec4-39e8-4ef6-ac69-c9e3ba7a8418\",\n \"update_source_connector\": {\n \"config\": {\n \"host\": \"black-and-white-obesity.info\",\n \"database\": \"\",\n \"port\": 848106,\n \"username\": \"Bruce.Stracke19\",\n \"password\": \"L8K8WEZq1xvBpSw\",\n \"table_name\": \"\",\n \"batch_size\": 177849,\n \"id_column\": \"id\",\n },\n },\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_connector_information)" + - target: $["paths"]["/api/v1/sources/{source_id}/connection-check"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "get_connection_check_api_v1_sources__source_id__connection_check_get" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.get_connection_check_api_v1_sources_source_id_connection_check_get(request={\n \"source_id\": \"d9c3daec-ddf9-4cef-ae8d-3a989813cc7b\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)" + - target: $["paths"]["/api/v1/sources/{source_id}/connection-check"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "check_connection_api_v1_sources__source_id__connection_check_post" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.check_connection_api_v1_sources_source_id_connection_check_post(request={\n \"source_id\": \"8cb54f13-5652-423e-889c-1df1f8147126\",\n })\n\n assert res.dag_node_connection_check is not None\n\n # Handle response\n print(res.dag_node_connection_check)" - target: $["paths"]["/api/v1/workflows/"]["get"] update: "x-codeSamples": diff --git a/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md b/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md new file mode 100644 index 00000000..a0e6af23 --- /dev/null +++ b/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md @@ -0,0 +1,9 @@ +# CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `source_id` | *str* | :heavy_check_mark: | N/A | +| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md b/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md new file mode 100644 index 00000000..7c8db3ae --- /dev/null +++ b/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md @@ -0,0 +1,11 @@ +# CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md b/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md new file mode 100644 index 00000000..7115b82d --- /dev/null +++ b/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md @@ -0,0 +1,9 @@ +# CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `destination_id` | *str* | :heavy_check_mark: | N/A | +| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md b/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md new file mode 100644 index 00000000..94f1c669 --- /dev/null +++ b/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md @@ -0,0 +1,11 @@ +# CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md b/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md new file mode 100644 index 00000000..6479759d --- /dev/null +++ b/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md @@ -0,0 +1,9 @@ +# GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `source_id` | *str* | :heavy_check_mark: | N/A | +| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md b/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md new file mode 100644 index 00000000..0baf5669 --- /dev/null +++ b/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md @@ -0,0 +1,11 @@ +# GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md b/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md new file mode 100644 index 00000000..f7c37eeb --- /dev/null +++ b/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md @@ -0,0 +1,9 @@ +# GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `destination_id` | *str* | :heavy_check_mark: | N/A | +| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md b/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md new file mode 100644 index 00000000..a4a9413f --- /dev/null +++ b/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md @@ -0,0 +1,11 @@ +# GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | +| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/shared/config.md b/docs/models/shared/config.md index cd0363d3..457e0fd7 100644 --- a/docs/models/shared/config.md +++ b/docs/models/shared/config.md @@ -3,12 +3,6 @@ ## Supported Types -### `shared.AzureDestinationConnectorConfigInput` - -```python -value: shared.AzureDestinationConnectorConfigInput = /* values here */ -``` - ### `shared.AstraDBConnectorConfigInput` ```python diff --git a/docs/models/shared/connectioncheckstatus.md b/docs/models/shared/connectioncheckstatus.md new file mode 100644 index 00000000..08715d17 --- /dev/null +++ b/docs/models/shared/connectioncheckstatus.md @@ -0,0 +1,10 @@ +# ConnectionCheckStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SCHEDULED` | SCHEDULED | +| `SUCCESS` | SUCCESS | +| `FAILURE` | FAILURE | \ No newline at end of file diff --git a/docs/models/shared/dagnodeconnectioncheck.md b/docs/models/shared/dagnodeconnectioncheck.md new file mode 100644 index 00000000..23a8fe06 --- /dev/null +++ b/docs/models/shared/dagnodeconnectioncheck.md @@ -0,0 +1,12 @@ +# DagNodeConnectionCheck + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | N/A | +| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `reported_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `status` | [shared.ConnectionCheckStatus](../../models/shared/connectioncheckstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/destinationconnectorinformationconfig.md b/docs/models/shared/destinationconnectorinformationconfig.md index f18f6d71..3a711755 100644 --- a/docs/models/shared/destinationconnectorinformationconfig.md +++ b/docs/models/shared/destinationconnectorinformationconfig.md @@ -3,12 +3,6 @@ ## Supported Types -### `shared.AzureDestinationConnectorConfig` - -```python -value: shared.AzureDestinationConnectorConfig = /* values here */ -``` - ### `shared.AstraDBConnectorConfig` ```python diff --git a/docs/models/shared/destinationconnectortype.md b/docs/models/shared/destinationconnectortype.md index 7137af3e..57c24960 100644 --- a/docs/models/shared/destinationconnectortype.md +++ b/docs/models/shared/destinationconnectortype.md @@ -5,7 +5,6 @@ | Name | Value | | -------------------------------- | -------------------------------- | -| `AZURE` | azure | | `ASTRADB` | astradb | | `AZURE_AI_SEARCH` | azure_ai_search | | `COUCHBASE` | couchbase | diff --git a/docs/models/shared/updatedestinationconnectorconfig.md b/docs/models/shared/updatedestinationconnectorconfig.md index a7f36d4c..78d91893 100644 --- a/docs/models/shared/updatedestinationconnectorconfig.md +++ b/docs/models/shared/updatedestinationconnectorconfig.md @@ -3,12 +3,6 @@ ## Supported Types -### `shared.AzureDestinationConnectorConfigInput` - -```python -value: shared.AzureDestinationConnectorConfigInput = /* values here */ -``` - ### `shared.AstraDBConnectorConfigInput` ```python diff --git a/docs/models/shared/workflownode.md b/docs/models/shared/workflownode.md index 8a4809c3..0fa04000 100644 --- a/docs/models/shared/workflownode.md +++ b/docs/models/shared/workflownode.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `name` | *str* | :heavy_check_mark: | N/A | -| `settings` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | -| `subtype` | *str* | :heavy_check_mark: | N/A | -| `type` | [shared.WorkflowNodeType](../../models/shared/workflownodetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | +| `settings` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | +| `subtype` | *str* | :heavy_check_mark: | N/A | +| `type` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/destinations/README.md b/docs/sdks/destinations/README.md index 4ae26ac7..5c9bcf7d 100644 --- a/docs/sdks/destinations/README.md +++ b/docs/sdks/destinations/README.md @@ -5,12 +5,66 @@ ### Available Operations +* [check_destination_connection_api_v1_destinations_destination_id_connection_check_post](#check_destination_connection_api_v1_destinations_destination_id_connection_check_post) - Check Destination Connection * [create_destination](#create_destination) - Create destination connector * [delete_destination](#delete_destination) - Delete destination connector * [get_destination](#get_destination) - Get destination connector +* [get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get](#get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get) - Get Destination Connection Check * [list_destinations](#list_destinations) - List destination connectors * [update_destination](#update_destination) - Update destination connector +## check_destination_connection_api_v1_destinations_destination_id_connection_check_post + +Check Destination Connection + +Initiates a connection check for the specified destination connector. + +**Parameters:** +- **destination_id**: The UUID of the destination connector. +- **db_session**: Database session dependency. +- **user_data**: Information about the authenticated user. + +**Returns:** +- The result of the connection check. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ + "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + }) + + assert res.dag_node_connection_check is not None + + # Handle response + print(res.dag_node_connection_check) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest](../../models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.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 + +**[operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse](../../models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## create_destination Create a new destination connector using the provided configuration and name. @@ -34,7 +88,7 @@ with UnstructuredClient() as uc_client: "token": "", }, "name": "", - "type": shared.DestinationConnectorType.AZURE, + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, }, }) @@ -148,6 +202,58 @@ with UnstructuredClient() as uc_client: | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get + +Get Destination Connection Check + +Retrieves the most recent connection check for the specified destination connector. + +**Parameters:** +- **destination_id**: The UUID of the destination connector. +- **db_session**: Database session dependency. +- **user_data**: Information about the authenticated user. + +**Returns:** +- Connection check results. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.destinations.get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get(request={ + "destination_id": "3c48df35-2b2c-46f2-9aa2-d7eae993797c", + }) + + assert res.dag_node_connection_check is not None + + # Handle response + print(res.dag_node_connection_check) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest](../../models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.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 + +**[operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse](../../models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## list_destinations Retrieve a list of available destination connectors. diff --git a/docs/sdks/sources/README.md b/docs/sdks/sources/README.md index 54452ead..c3dec73f 100644 --- a/docs/sdks/sources/README.md +++ b/docs/sdks/sources/README.md @@ -5,12 +5,66 @@ ### Available Operations +* [check_connection_api_v1_sources_source_id_connection_check_post](#check_connection_api_v1_sources_source_id_connection_check_post) - Check Connection * [create_source](#create_source) - Create source connector * [delete_source](#delete_source) - Delete source connector +* [get_connection_check_api_v1_sources_source_id_connection_check_get](#get_connection_check_api_v1_sources_source_id_connection_check_get) - Get Connection Check * [get_source](#get_source) - Get source connector * [list_sources](#list_sources) - List available source connectors * [update_source](#update_source) - Update source connector +## check_connection_api_v1_sources_source_id_connection_check_post + +Check Connection + +Initiates a connection check for the specified source connector. + +**Parameters:** +- **source_id**: The UUID of the source connector. +- **db_session**: Database session dependency. +- **user_data**: Information about the authenticated user. + +**Returns:** +- The result of the connection check. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.sources.check_connection_api_v1_sources_source_id_connection_check_post(request={ + "source_id": "8cb54f13-5652-423e-889c-1df1f8147126", + }) + + assert res.dag_node_connection_check is not None + + # Handle response + print(res.dag_node_connection_check) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | [operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest](../../models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.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 + +**[operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse](../../models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## create_source Create a new source connector using the provided configuration and name. @@ -108,6 +162,58 @@ with UnstructuredClient() as uc_client: | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_connection_check_api_v1_sources_source_id_connection_check_get + +Get Connection Checks + +Retrieves the most recent connection check for the specified source connector. + +**Parameters:** +- **source_id**: The UUID of the source connector. +- **db_session**: Database session dependency. +- **user_data**: Information about the authenticated user. + +**Returns:** +- Connection check results. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.sources.get_connection_check_api_v1_sources_source_id_connection_check_get(request={ + "source_id": "d9c3daec-ddf9-4cef-ae8d-3a989813cc7b", + }) + + assert res.dag_node_connection_check is not None + + # Handle response + print(res.dag_node_connection_check) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest](../../models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.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 + +**[operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse](../../models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## get_source Retrieve detailed information for a specific source connector by its ID. diff --git a/gen.yaml b/gen.yaml index f4ce8dcf..9e5b2eee 100644 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.32.4 + version: 0.32.5 additionalDependencies: dev: deepdiff: '>=6.0' diff --git a/pyproject.toml b/pyproject.toml index 33347cda..d5eca154 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.32.4" +version = "0.32.5" description = "Python Client SDK for Unstructured API" authors = [{ name = "Unstructured" },] readme = "README-PYPI.md" diff --git a/src/unstructured_client/_version.py b/src/unstructured_client/_version.py index d73a07b8..24db1b38 100644 --- a/src/unstructured_client/_version.py +++ b/src/unstructured_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "unstructured-client" -__version__: str = "0.32.4" +__version__: str = "0.32.5" __openapi_doc_version__: str = "1.1.7" -__gen_version__: str = "2.585.0" -__user_agent__: str = "speakeasy-sdk/python 0.32.4 2.585.0 1.1.7 unstructured-client" +__gen_version__: str = "2.585.1" +__user_agent__: str = "speakeasy-sdk/python 0.32.5 2.585.1 1.1.7 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/destinations.py b/src/unstructured_client/destinations.py index 6eba26da..0d4e7bef 100644 --- a/src/unstructured_client/destinations.py +++ b/src/unstructured_client/destinations.py @@ -9,6 +9,264 @@ class Destinations(BaseSDK): + def check_destination_connection_api_v1_destinations_destination_id_connection_check_post( + self, + *, + request: Union[ + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse: + r"""Check Destination Connection + + Check Destination Connection + + Initiates a connection check for the specified destination connector. + + **Parameters:** + - **destination_id**: The UUID of the destination connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - The result of the connection check. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS[ + operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + ) + request = cast( + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + request, + ) + + req = self._build_request( + method="POST", + path="/api/v1/destinations/{destination_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="check_destination_connection_api_v1_destinations__destination_id__connection_check_post", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async( + self, + *, + request: Union[ + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse: + r"""Check Destination Connection + + Check Destination Connection + + Initiates a connection check for the specified destination connector. + + **Parameters:** + - **destination_id**: The UUID of the destination connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - The result of the connection check. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS[ + operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + ) + request = cast( + operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + request, + ) + + req = self._build_request_async( + method="POST", + path="/api/v1/destinations/{destination_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="check_destination_connection_api_v1_destinations__destination_id__connection_check_post", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def create_destination( self, *, @@ -695,6 +953,264 @@ async def get_destination_async( http_res, ) + def get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get( + self, + *, + request: Union[ + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse: + r"""Get Destination Connection Check + + Get Destination Connection Check + + Retrieves the most recent connection check for the specified destination connector. + + **Parameters:** + - **destination_id**: The UUID of the destination connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - Connection check results. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS[ + operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + ) + request = cast( + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + request, + ) + + req = self._build_request( + method="GET", + path="/api/v1/destinations/{destination_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="get_destination_connection_check_api_v1_destinations__destination_id__connection_check_get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get_async( + self, + *, + request: Union[ + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse: + r"""Get Destination Connection Check + + Get Destination Connection Check + + Retrieves the most recent connection check for the specified destination connector. + + **Parameters:** + - **destination_id**: The UUID of the destination connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - Connection check results. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS[ + operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + ) + request = cast( + operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + request, + ) + + req = self._build_request_async( + method="GET", + path="/api/v1/destinations/{destination_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="get_destination_connection_check_api_v1_destinations__destination_id__connection_check_get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def list_destinations( self, *, diff --git a/src/unstructured_client/models/operations/__init__.py b/src/unstructured_client/models/operations/__init__.py index 7a02a0ac..7391c8d1 100644 --- a/src/unstructured_client/models/operations/__init__.py +++ b/src/unstructured_client/models/operations/__init__.py @@ -8,6 +8,22 @@ CancelJobResponse, CancelJobResponseTypedDict, ) +from .check_connection_api_v1_sources_source_id_connection_check_post import ( + CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS, + CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API, + CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict, + CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse, + CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponseTypedDict, +) +from .check_destination_connection_api_v1_destinations_destination_id_connection_check_post import ( + CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS, + CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API, + CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, + CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict, + CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse, + CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponseTypedDict, +) from .create_destination import ( CREATE_DESTINATION_SERVERS, CREATE_DESTINATION_SERVER_PLATFORM_API, @@ -64,6 +80,14 @@ DownloadJobOutputResponse, DownloadJobOutputResponseTypedDict, ) +from .get_connection_check_api_v1_sources_source_id_connection_check_get import ( + GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS, + GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API, + GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict, + GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse, + GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponseTypedDict, +) from .get_destination import ( GET_DESTINATION_SERVERS, GET_DESTINATION_SERVER_PLATFORM_API, @@ -72,6 +96,14 @@ GetDestinationResponse, GetDestinationResponseTypedDict, ) +from .get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get import ( + GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS, + GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API, + GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, + GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict, + GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse, + GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponseTypedDict, +) from .get_job import ( GET_JOB_SERVERS, GET_JOB_SERVER_PLATFORM_API, @@ -174,6 +206,10 @@ __all__ = [ "CANCEL_JOB_SERVERS", "CANCEL_JOB_SERVER_PLATFORM_API", + "CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS", + "CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API", + "CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS", + "CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API", "CREATE_DESTINATION_SERVERS", "CREATE_DESTINATION_SERVER_PLATFORM_API", "CREATE_SOURCE_SERVERS", @@ -184,6 +220,14 @@ "CancelJobRequestTypedDict", "CancelJobResponse", "CancelJobResponseTypedDict", + "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest", + "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict", + "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse", + "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponseTypedDict", + "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest", + "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict", + "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse", + "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponseTypedDict", "CreateDestinationRequest", "CreateDestinationRequestTypedDict", "CreateDestinationResponse", @@ -220,6 +264,10 @@ "DownloadJobOutputRequestTypedDict", "DownloadJobOutputResponse", "DownloadJobOutputResponseTypedDict", + "GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS", + "GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API", + "GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS", + "GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API", "GET_DESTINATION_SERVERS", "GET_DESTINATION_SERVER_PLATFORM_API", "GET_JOB_SERVERS", @@ -228,6 +276,14 @@ "GET_SOURCE_SERVER_PLATFORM_API", "GET_WORKFLOW_SERVERS", "GET_WORKFLOW_SERVER_PLATFORM_API", + "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest", + "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict", + "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse", + "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponseTypedDict", + "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest", + "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict", + "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse", + "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponseTypedDict", "GetDestinationRequest", "GetDestinationRequestTypedDict", "GetDestinationResponse", diff --git a/src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py b/src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py new file mode 100644 index 00000000..6902c8db --- /dev/null +++ b/src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py @@ -0,0 +1,106 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict +from unstructured_client.models.shared import ( + dagnodeconnectioncheck as shared_dagnodeconnectioncheck, +) +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata + +CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API = ( + "platform-api" +) +r"""Unstructured Platform API""" + +CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS = { + CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict(TypedDict): + source_id: str + unstructured_api_key: NotRequired[Nullable[str]] + + +class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest(BaseModel): + source_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + unstructured_api_key: Annotated[ + OptionalNullable[str], + pydantic.Field(alias="unstructured-api-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["unstructured-api-key"] + nullable_fields = ["unstructured-api-key"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponseTypedDict( + TypedDict +): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + dag_node_connection_check: NotRequired[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict + ] + r"""Successful Response""" + + +class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + dag_node_connection_check: Optional[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheck + ] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py b/src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py new file mode 100644 index 00000000..b1c76d82 --- /dev/null +++ b/src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict +from unstructured_client.models.shared import ( + dagnodeconnectioncheck as shared_dagnodeconnectioncheck, +) +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata + +CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS = { + CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict( + TypedDict +): + destination_id: str + unstructured_api_key: NotRequired[Nullable[str]] + + +class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest( + BaseModel +): + destination_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + unstructured_api_key: Annotated[ + OptionalNullable[str], + pydantic.Field(alias="unstructured-api-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["unstructured-api-key"] + nullable_fields = ["unstructured-api-key"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponseTypedDict( + TypedDict +): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + dag_node_connection_check: NotRequired[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict + ] + r"""Successful Response""" + + +class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse( + BaseModel +): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + dag_node_connection_check: Optional[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheck + ] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py b/src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py new file mode 100644 index 00000000..46f44e76 --- /dev/null +++ b/src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py @@ -0,0 +1,106 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict +from unstructured_client.models.shared import ( + dagnodeconnectioncheck as shared_dagnodeconnectioncheck, +) +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata + +GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS = { + GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict( + TypedDict +): + source_id: str + unstructured_api_key: NotRequired[Nullable[str]] + + +class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest(BaseModel): + source_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + unstructured_api_key: Annotated[ + OptionalNullable[str], + pydantic.Field(alias="unstructured-api-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["unstructured-api-key"] + nullable_fields = ["unstructured-api-key"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponseTypedDict( + TypedDict +): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + dag_node_connection_check: NotRequired[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict + ] + r"""Successful Response""" + + +class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse(BaseModel): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + dag_node_connection_check: Optional[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheck + ] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py b/src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py new file mode 100644 index 00000000..be37612c --- /dev/null +++ b/src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py @@ -0,0 +1,110 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import httpx +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict +from unstructured_client.models.shared import ( + dagnodeconnectioncheck as shared_dagnodeconnectioncheck, +) +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata + +GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS = { + GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict( + TypedDict +): + destination_id: str + unstructured_api_key: NotRequired[Nullable[str]] + + +class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest( + BaseModel +): + destination_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + + unstructured_api_key: Annotated[ + OptionalNullable[str], + pydantic.Field(alias="unstructured-api-key"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["unstructured-api-key"] + nullable_fields = ["unstructured-api-key"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponseTypedDict( + TypedDict +): + content_type: str + r"""HTTP response content type for this operation""" + status_code: int + r"""HTTP response status code for this operation""" + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + dag_node_connection_check: NotRequired[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict + ] + r"""Successful Response""" + + +class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse( + BaseModel +): + content_type: str + r"""HTTP response content type for this operation""" + + status_code: int + r"""HTTP response status code for this operation""" + + raw_response: httpx.Response + r"""Raw HTTP response; suitable for custom response parsing""" + + dag_node_connection_check: Optional[ + shared_dagnodeconnectioncheck.DagNodeConnectionCheck + ] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/shared/__init__.py b/src/unstructured_client/models/shared/__init__.py index a69961fa..26e65b5c 100644 --- a/src/unstructured_client/models/shared/__init__.py +++ b/src/unstructured_client/models/shared/__init__.py @@ -16,14 +16,6 @@ AzureAISearchConnectorConfigInput, AzureAISearchConnectorConfigInputTypedDict, ) -from .azuredestinationconnectorconfig import ( - AzureDestinationConnectorConfig, - AzureDestinationConnectorConfigTypedDict, -) -from .azuredestinationconnectorconfiginput import ( - AzureDestinationConnectorConfigInput, - AzureDestinationConnectorConfigInputTypedDict, -) from .azuresourceconnectorconfig import ( AzureSourceConnectorConfig, AzureSourceConnectorConfigTypedDict, @@ -54,6 +46,7 @@ ConfluenceSourceConnectorConfigInput, ConfluenceSourceConnectorConfigInputTypedDict, ) +from .connectioncheckstatus import ConnectionCheckStatus from .couchbasedestinationconnectorconfig import ( CouchbaseDestinationConnectorConfig, CouchbaseDestinationConnectorConfigTypedDict, @@ -84,6 +77,10 @@ ) from .createworkflow import CreateWorkflow, CreateWorkflowTypedDict, Schedule from .crontabentry import CronTabEntry, CronTabEntryTypedDict +from .dagnodeconnectioncheck import ( + DagNodeConnectionCheck, + DagNodeConnectionCheckTypedDict, +) from .databricksvdtdestinationconnectorconfig import ( DatabricksVDTDestinationConnectorConfig, DatabricksVDTDestinationConnectorConfigTypedDict, @@ -369,7 +366,6 @@ ) from .workflowinformation import WorkflowInformation, WorkflowInformationTypedDict from .workflownode import WorkflowNode, WorkflowNodeTypedDict -from .workflownodetype import WorkflowNodeType from .workflowschedule import WorkflowSchedule, WorkflowScheduleTypedDict from .workflowstate import WorkflowState from .workflowtype import WorkflowType @@ -392,10 +388,6 @@ "AzureAISearchConnectorConfigInput", "AzureAISearchConnectorConfigInputTypedDict", "AzureAISearchConnectorConfigTypedDict", - "AzureDestinationConnectorConfig", - "AzureDestinationConnectorConfigInput", - "AzureDestinationConnectorConfigInputTypedDict", - "AzureDestinationConnectorConfigTypedDict", "AzureSourceConnectorConfig", "AzureSourceConnectorConfigInput", "AzureSourceConnectorConfigInputTypedDict", @@ -412,6 +404,7 @@ "ConfluenceSourceConnectorConfigInput", "ConfluenceSourceConnectorConfigInputTypedDict", "ConfluenceSourceConnectorConfigTypedDict", + "ConnectionCheckStatus", "CouchbaseDestinationConnectorConfig", "CouchbaseDestinationConnectorConfigInput", "CouchbaseDestinationConnectorConfigInputTypedDict", @@ -430,6 +423,8 @@ "CreateWorkflowTypedDict", "CronTabEntry", "CronTabEntryTypedDict", + "DagNodeConnectionCheck", + "DagNodeConnectionCheckTypedDict", "DatabricksVDTDestinationConnectorConfig", "DatabricksVDTDestinationConnectorConfigInput", "DatabricksVDTDestinationConnectorConfigInputTypedDict", @@ -592,7 +587,6 @@ "WorkflowInformation", "WorkflowInformationTypedDict", "WorkflowNode", - "WorkflowNodeType", "WorkflowNodeTypedDict", "WorkflowSchedule", "WorkflowScheduleTypedDict", diff --git a/src/unstructured_client/models/shared/connectioncheckstatus.py b/src/unstructured_client/models/shared/connectioncheckstatus.py new file mode 100644 index 00000000..a2f6477f --- /dev/null +++ b/src/unstructured_client/models/shared/connectioncheckstatus.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class ConnectionCheckStatus(str, Enum): + SCHEDULED = "SCHEDULED" + SUCCESS = "SUCCESS" + FAILURE = "FAILURE" diff --git a/src/unstructured_client/models/shared/createdestinationconnector.py b/src/unstructured_client/models/shared/createdestinationconnector.py index 2a3cbbe2..a6699c29 100644 --- a/src/unstructured_client/models/shared/createdestinationconnector.py +++ b/src/unstructured_client/models/shared/createdestinationconnector.py @@ -9,10 +9,6 @@ AzureAISearchConnectorConfigInput, AzureAISearchConnectorConfigInputTypedDict, ) -from .azuredestinationconnectorconfiginput import ( - AzureDestinationConnectorConfigInput, - AzureDestinationConnectorConfigInputTypedDict, -) from .couchbasedestinationconnectorconfiginput import ( CouchbaseDestinationConnectorConfigInput, CouchbaseDestinationConnectorConfigInputTypedDict, @@ -96,21 +92,20 @@ Union[ GCSDestinationConnectorConfigInputTypedDict, ElasticsearchConnectorConfigInputTypedDict, - MongoDBConnectorConfigInputTypedDict, AzureAISearchConnectorConfigInputTypedDict, WeaviateDestinationConnectorConfigInputTypedDict, + MongoDBConnectorConfigInputTypedDict, DeltaTableConnectorConfigInputTypedDict, QdrantCloudDestinationConnectorConfigInputTypedDict, PineconeDestinationConnectorConfigInputTypedDict, - AzureDestinationConnectorConfigInputTypedDict, Neo4jDestinationConnectorConfigInputTypedDict, OneDriveDestinationConnectorConfigInputTypedDict, S3DestinationConnectorConfigInputTypedDict, AstraDBConnectorConfigInputTypedDict, - PostgresDestinationConnectorConfigInputTypedDict, MilvusDestinationConnectorConfigInputTypedDict, - KafkaCloudDestinationConnectorConfigInputTypedDict, DatabricksVolumesConnectorConfigInputTypedDict, + PostgresDestinationConnectorConfigInputTypedDict, + KafkaCloudDestinationConnectorConfigInputTypedDict, CouchbaseDestinationConnectorConfigInputTypedDict, RedisDestinationConnectorConfigInputTypedDict, DatabricksVDTDestinationConnectorConfigInputTypedDict, @@ -124,21 +119,20 @@ Union[ GCSDestinationConnectorConfigInput, ElasticsearchConnectorConfigInput, - MongoDBConnectorConfigInput, AzureAISearchConnectorConfigInput, WeaviateDestinationConnectorConfigInput, + MongoDBConnectorConfigInput, DeltaTableConnectorConfigInput, QdrantCloudDestinationConnectorConfigInput, PineconeDestinationConnectorConfigInput, - AzureDestinationConnectorConfigInput, Neo4jDestinationConnectorConfigInput, OneDriveDestinationConnectorConfigInput, S3DestinationConnectorConfigInput, AstraDBConnectorConfigInput, - PostgresDestinationConnectorConfigInput, MilvusDestinationConnectorConfigInput, - KafkaCloudDestinationConnectorConfigInput, DatabricksVolumesConnectorConfigInput, + PostgresDestinationConnectorConfigInput, + KafkaCloudDestinationConnectorConfigInput, CouchbaseDestinationConnectorConfigInput, RedisDestinationConnectorConfigInput, DatabricksVDTDestinationConnectorConfigInput, diff --git a/src/unstructured_client/models/shared/dagnodeconnectioncheck.py b/src/unstructured_client/models/shared/dagnodeconnectioncheck.py new file mode 100644 index 00000000..fade6b96 --- /dev/null +++ b/src/unstructured_client/models/shared/dagnodeconnectioncheck.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connectioncheckstatus import ConnectionCheckStatus +from datetime import datetime +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) + + +class DagNodeConnectionCheckTypedDict(TypedDict): + created_at: datetime + id: str + status: ConnectionCheckStatus + reason: NotRequired[Nullable[str]] + reported_at: NotRequired[Nullable[datetime]] + + +class DagNodeConnectionCheck(BaseModel): + created_at: datetime + + id: str + + status: ConnectionCheckStatus + + reason: OptionalNullable[str] = UNSET + + reported_at: OptionalNullable[datetime] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["reason", "reported_at"] + nullable_fields = ["reason", "reported_at"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/src/unstructured_client/models/shared/destinationconnectorinformation.py b/src/unstructured_client/models/shared/destinationconnectorinformation.py index 5dbc0e58..e25b50af 100644 --- a/src/unstructured_client/models/shared/destinationconnectorinformation.py +++ b/src/unstructured_client/models/shared/destinationconnectorinformation.py @@ -9,10 +9,6 @@ AzureAISearchConnectorConfig, AzureAISearchConnectorConfigTypedDict, ) -from .azuredestinationconnectorconfig import ( - AzureDestinationConnectorConfig, - AzureDestinationConnectorConfigTypedDict, -) from .couchbasedestinationconnectorconfig import ( CouchbaseDestinationConnectorConfig, CouchbaseDestinationConnectorConfigTypedDict, @@ -104,21 +100,20 @@ Union[ GCSDestinationConnectorConfigTypedDict, ElasticsearchConnectorConfigTypedDict, - MongoDBConnectorConfigTypedDict, AzureAISearchConnectorConfigTypedDict, WeaviateDestinationConnectorConfigTypedDict, + MongoDBConnectorConfigTypedDict, DeltaTableConnectorConfigTypedDict, QdrantCloudDestinationConnectorConfigTypedDict, PineconeDestinationConnectorConfigTypedDict, - AzureDestinationConnectorConfigTypedDict, AstraDBConnectorConfigTypedDict, Neo4jDestinationConnectorConfigTypedDict, OneDriveDestinationConnectorConfigTypedDict, S3DestinationConnectorConfigTypedDict, - PostgresDestinationConnectorConfigTypedDict, MilvusDestinationConnectorConfigTypedDict, - KafkaCloudDestinationConnectorConfigTypedDict, DatabricksVolumesConnectorConfigTypedDict, + PostgresDestinationConnectorConfigTypedDict, + KafkaCloudDestinationConnectorConfigTypedDict, CouchbaseDestinationConnectorConfigTypedDict, RedisDestinationConnectorConfigTypedDict, DatabricksVDTDestinationConnectorConfigTypedDict, @@ -132,21 +127,20 @@ Union[ GCSDestinationConnectorConfig, ElasticsearchConnectorConfig, - MongoDBConnectorConfig, AzureAISearchConnectorConfig, WeaviateDestinationConnectorConfig, + MongoDBConnectorConfig, DeltaTableConnectorConfig, QdrantCloudDestinationConnectorConfig, PineconeDestinationConnectorConfig, - AzureDestinationConnectorConfig, AstraDBConnectorConfig, Neo4jDestinationConnectorConfig, OneDriveDestinationConnectorConfig, S3DestinationConnectorConfig, - PostgresDestinationConnectorConfig, MilvusDestinationConnectorConfig, - KafkaCloudDestinationConnectorConfig, DatabricksVolumesConnectorConfig, + PostgresDestinationConnectorConfig, + KafkaCloudDestinationConnectorConfig, CouchbaseDestinationConnectorConfig, RedisDestinationConnectorConfig, DatabricksVDTDestinationConnectorConfig, diff --git a/src/unstructured_client/models/shared/destinationconnectortype.py b/src/unstructured_client/models/shared/destinationconnectortype.py index f61c4a77..098a3b38 100644 --- a/src/unstructured_client/models/shared/destinationconnectortype.py +++ b/src/unstructured_client/models/shared/destinationconnectortype.py @@ -5,7 +5,6 @@ class DestinationConnectorType(str, Enum): - AZURE = "azure" ASTRADB = "astradb" AZURE_AI_SEARCH = "azure_ai_search" COUCHBASE = "couchbase" diff --git a/src/unstructured_client/models/shared/updatedestinationconnector.py b/src/unstructured_client/models/shared/updatedestinationconnector.py index fd446c49..c0499187 100644 --- a/src/unstructured_client/models/shared/updatedestinationconnector.py +++ b/src/unstructured_client/models/shared/updatedestinationconnector.py @@ -9,10 +9,6 @@ AzureAISearchConnectorConfigInput, AzureAISearchConnectorConfigInputTypedDict, ) -from .azuredestinationconnectorconfiginput import ( - AzureDestinationConnectorConfigInput, - AzureDestinationConnectorConfigInputTypedDict, -) from .couchbasedestinationconnectorconfiginput import ( CouchbaseDestinationConnectorConfigInput, CouchbaseDestinationConnectorConfigInputTypedDict, @@ -95,21 +91,20 @@ Union[ GCSDestinationConnectorConfigInputTypedDict, ElasticsearchConnectorConfigInputTypedDict, - MongoDBConnectorConfigInputTypedDict, AzureAISearchConnectorConfigInputTypedDict, WeaviateDestinationConnectorConfigInputTypedDict, + MongoDBConnectorConfigInputTypedDict, DeltaTableConnectorConfigInputTypedDict, QdrantCloudDestinationConnectorConfigInputTypedDict, PineconeDestinationConnectorConfigInputTypedDict, - AzureDestinationConnectorConfigInputTypedDict, Neo4jDestinationConnectorConfigInputTypedDict, OneDriveDestinationConnectorConfigInputTypedDict, S3DestinationConnectorConfigInputTypedDict, AstraDBConnectorConfigInputTypedDict, - PostgresDestinationConnectorConfigInputTypedDict, MilvusDestinationConnectorConfigInputTypedDict, - KafkaCloudDestinationConnectorConfigInputTypedDict, DatabricksVolumesConnectorConfigInputTypedDict, + PostgresDestinationConnectorConfigInputTypedDict, + KafkaCloudDestinationConnectorConfigInputTypedDict, CouchbaseDestinationConnectorConfigInputTypedDict, RedisDestinationConnectorConfigInputTypedDict, DatabricksVDTDestinationConnectorConfigInputTypedDict, @@ -123,21 +118,20 @@ Union[ GCSDestinationConnectorConfigInput, ElasticsearchConnectorConfigInput, - MongoDBConnectorConfigInput, AzureAISearchConnectorConfigInput, WeaviateDestinationConnectorConfigInput, + MongoDBConnectorConfigInput, DeltaTableConnectorConfigInput, QdrantCloudDestinationConnectorConfigInput, PineconeDestinationConnectorConfigInput, - AzureDestinationConnectorConfigInput, Neo4jDestinationConnectorConfigInput, OneDriveDestinationConnectorConfigInput, S3DestinationConnectorConfigInput, AstraDBConnectorConfigInput, - PostgresDestinationConnectorConfigInput, MilvusDestinationConnectorConfigInput, - KafkaCloudDestinationConnectorConfigInput, DatabricksVolumesConnectorConfigInput, + PostgresDestinationConnectorConfigInput, + KafkaCloudDestinationConnectorConfigInput, CouchbaseDestinationConnectorConfigInput, RedisDestinationConnectorConfigInput, DatabricksVDTDestinationConnectorConfigInput, diff --git a/src/unstructured_client/models/shared/workflownode.py b/src/unstructured_client/models/shared/workflownode.py index 87d22acc..86ca02a5 100644 --- a/src/unstructured_client/models/shared/workflownode.py +++ b/src/unstructured_client/models/shared/workflownode.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .workflownodetype import WorkflowNodeType from pydantic import model_serializer from typing import Any, Dict from typing_extensions import NotRequired, TypedDict @@ -17,7 +16,7 @@ class WorkflowNodeTypedDict(TypedDict): name: str subtype: str - type: WorkflowNodeType + type: str id: NotRequired[Nullable[str]] settings: NotRequired[Nullable[Dict[str, Any]]] @@ -27,7 +26,7 @@ class WorkflowNode(BaseModel): subtype: str - type: WorkflowNodeType + type: str id: OptionalNullable[str] = UNSET diff --git a/src/unstructured_client/sources.py b/src/unstructured_client/sources.py index 20d0d09d..4761ad85 100644 --- a/src/unstructured_client/sources.py +++ b/src/unstructured_client/sources.py @@ -9,6 +9,264 @@ class Sources(BaseSDK): + def check_connection_api_v1_sources_source_id_connection_check_post( + self, + *, + request: Union[ + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse: + r"""Check Connection + + Check Connection + + Initiates a connection check for the specified source connector. + + **Parameters:** + - **source_id**: The UUID of the source connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - The result of the connection check. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS[ + operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + ) + request = cast( + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + request, + ) + + req = self._build_request( + method="POST", + path="/api/v1/sources/{source_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="check_connection_api_v1_sources__source_id__connection_check_post", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def check_connection_api_v1_sources_source_id_connection_check_post_async( + self, + *, + request: Union[ + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse: + r"""Check Connection + + Check Connection + + Initiates a connection check for the specified source connector. + + **Parameters:** + - **source_id**: The UUID of the source connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - The result of the connection check. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS[ + operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + ) + request = cast( + operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, + request, + ) + + req = self._build_request_async( + method="POST", + path="/api/v1/sources/{source_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="check_connection_api_v1_sources__source_id__connection_check_post", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "202", "application/json"): + return operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def create_source( self, *, @@ -467,6 +725,264 @@ async def delete_source_async( http_res, ) + def get_connection_check_api_v1_sources_source_id_connection_check_get( + self, + *, + request: Union[ + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse: + r"""Get Connection Check + + Get Connection Checks + + Retrieves the most recent connection check for the specified source connector. + + **Parameters:** + - **source_id**: The UUID of the source connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - Connection check results. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS[ + operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + ) + request = cast( + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + request, + ) + + req = self._build_request( + method="GET", + path="/api/v1/sources/{source_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="get_connection_check_api_v1_sources__source_id__connection_check_get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_connection_check_api_v1_sources_source_id_connection_check_get_async( + self, + *, + request: Union[ + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse: + r"""Get Connection Check + + Get Connection Checks + + Retrieves the most recent connection check for the specified source connector. + + **Parameters:** + - **source_id**: The UUID of the source connector. + - **db_session**: Database session dependency. + - **user_data**: Information about the authenticated user. + + **Returns:** + - Connection check results. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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 = 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 = operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS[ + operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + ) + request = cast( + operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, + request, + ) + + req = self._build_request_async( + method="GET", + path="/api/v1/sources/{source_id}/connection-check", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["5xx"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="get_connection_check_api_v1_sources__source_id__connection_check_get", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse( + dag_node_connection_check=utils.unmarshal_json( + http_res.text, Optional[shared.DagNodeConnectionCheck] + ), + status_code=http_res.status_code, + content_type=http_res.headers.get("Content-Type") or "", + raw_response=http_res, + ) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.HTTPValidationErrorData + ) + raise errors.HTTPValidationError(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def get_source( self, *, From 30d843ab08e7d4f3cf9cd9ca660a2f2e2ff3b982 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Thu, 17 Apr 2025 16:53:42 -0400 Subject: [PATCH 2/3] Remove connection check endpoints --- .speakeasy/gen.lock | 26 +- README.md | 98 +++- USAGE.md | 38 +- ...urcessourceidconnectioncheckpostrequest.md | 9 - ...rcessourceidconnectioncheckpostresponse.md | 11 - ...destinationidconnectioncheckpostrequest.md | 9 - ...estinationidconnectioncheckpostresponse.md | 11 - ...ourcessourceidconnectioncheckgetrequest.md | 9 - ...urcessourceidconnectioncheckgetresponse.md | 11 - ...sdestinationidconnectioncheckgetrequest.md | 9 - ...destinationidconnectioncheckgetresponse.md | 11 - docs/models/shared/connectioncheckstatus.md | 10 - docs/models/shared/dagnodeconnectioncheck.md | 12 - docs/sdks/destinations/README.md | 106 ---- docs/sdks/sources/README.md | 106 ---- gen.yaml | 2 +- pyproject.toml | 2 +- src/unstructured_client/_version.py | 6 +- src/unstructured_client/destinations.py | 516 ------------------ .../models/operations/__init__.py | 56 -- ...sources_source_id_connection_check_post.py | 106 ---- ...ns_destination_id_connection_check_post.py | 110 ---- ..._sources_source_id_connection_check_get.py | 106 ---- ...ons_destination_id_connection_check_get.py | 110 ---- .../models/shared/__init__.py | 8 - .../models/shared/connectioncheckstatus.py | 10 - .../models/shared/dagnodeconnectioncheck.py | 64 --- src/unstructured_client/sources.py | 516 ------------------ 28 files changed, 116 insertions(+), 1972 deletions(-) delete mode 100644 docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md delete mode 100644 docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md delete mode 100644 docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md delete mode 100644 docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md delete mode 100644 docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md delete mode 100644 docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md delete mode 100644 docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md delete mode 100644 docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md delete mode 100644 docs/models/shared/connectioncheckstatus.md delete mode 100644 docs/models/shared/dagnodeconnectioncheck.md delete mode 100644 src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py delete mode 100644 src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py delete mode 100644 src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py delete mode 100644 src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py delete mode 100644 src/unstructured_client/models/shared/connectioncheckstatus.py delete mode 100644 src/unstructured_client/models/shared/dagnodeconnectioncheck.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b83292ba..52425407 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8b5fa338-9106-4734-abf0-e30d67044a90 management: - docChecksum: e3c8da4d880f93f1bf483a45d1fe2016 + docChecksum: a22c1e202b7ac1f3305521fb7827a79d docVersion: 1.1.7 - speakeasyVersion: 1.535.0 - generationVersion: 2.585.1 - releaseVersion: 0.32.5 - configChecksum: 5d74cee3ebe277ae6317c1ab5ec5aba1 + speakeasyVersion: 1.534.0 + generationVersion: 2.585.0 + releaseVersion: 0.33.0 + configChecksum: d3a6fe7f2ae7f430c8fff9c158af4f46 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -46,10 +46,6 @@ generatedFiles: - docs/models/errors/servererror.md - docs/models/operations/canceljobrequest.md - docs/models/operations/canceljobresponse.md - - docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md - - docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md - - docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md - - docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md - docs/models/operations/createdestinationrequest.md - docs/models/operations/createdestinationresponse.md - docs/models/operations/createsourcerequest.md @@ -64,10 +60,6 @@ generatedFiles: - docs/models/operations/deleteworkflowresponse.md - docs/models/operations/downloadjoboutputrequest.md - docs/models/operations/downloadjoboutputresponse.md - - docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md - - docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md - - docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md - - docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md - docs/models/operations/getdestinationrequest.md - docs/models/operations/getdestinationresponse.md - docs/models/operations/getjobrequest.md @@ -106,7 +98,6 @@ generatedFiles: - docs/models/shared/config.md - docs/models/shared/confluencesourceconnectorconfig.md - docs/models/shared/confluencesourceconnectorconfiginput.md - - docs/models/shared/connectioncheckstatus.md - docs/models/shared/couchbasedestinationconnectorconfig.md - docs/models/shared/couchbasedestinationconnectorconfiginput.md - docs/models/shared/couchbasesourceconnectorconfig.md @@ -116,7 +107,6 @@ generatedFiles: - docs/models/shared/createsourceconnectorconfig.md - docs/models/shared/createworkflow.md - docs/models/shared/crontabentry.md - - docs/models/shared/dagnodeconnectioncheck.md - docs/models/shared/databricksvdtdestinationconnectorconfig.md - docs/models/shared/databricksvdtdestinationconnectorconfiginput.md - docs/models/shared/databricksvolumesconnectorconfig.md @@ -237,8 +227,6 @@ generatedFiles: - src/unstructured_client/models/errors/servererror.py - src/unstructured_client/models/operations/__init__.py - src/unstructured_client/models/operations/cancel_job.py - - src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py - - src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py - src/unstructured_client/models/operations/create_destination.py - src/unstructured_client/models/operations/create_source.py - src/unstructured_client/models/operations/create_workflow.py @@ -246,9 +234,7 @@ generatedFiles: - src/unstructured_client/models/operations/delete_source.py - src/unstructured_client/models/operations/delete_workflow.py - src/unstructured_client/models/operations/download_job_output.py - - src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py - src/unstructured_client/models/operations/get_destination.py - - src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py - src/unstructured_client/models/operations/get_job.py - src/unstructured_client/models/operations/get_source.py - src/unstructured_client/models/operations/get_workflow.py @@ -273,7 +259,6 @@ generatedFiles: - src/unstructured_client/models/shared/boxsourceconnectorconfiginput.py - src/unstructured_client/models/shared/confluencesourceconnectorconfig.py - src/unstructured_client/models/shared/confluencesourceconnectorconfiginput.py - - src/unstructured_client/models/shared/connectioncheckstatus.py - src/unstructured_client/models/shared/couchbasedestinationconnectorconfig.py - src/unstructured_client/models/shared/couchbasedestinationconnectorconfiginput.py - src/unstructured_client/models/shared/couchbasesourceconnectorconfig.py @@ -282,7 +267,6 @@ generatedFiles: - src/unstructured_client/models/shared/createsourceconnector.py - src/unstructured_client/models/shared/createworkflow.py - src/unstructured_client/models/shared/crontabentry.py - - src/unstructured_client/models/shared/dagnodeconnectioncheck.py - src/unstructured_client/models/shared/databricksvdtdestinationconnectorconfig.py - src/unstructured_client/models/shared/databricksvdtdestinationconnectorconfiginput.py - src/unstructured_client/models/shared/databricksvolumesconnectorconfig.py diff --git a/README.md b/README.md index b01df1f7..c2b0b7f3 100755 --- a/README.md +++ b/README.md @@ -110,26 +110,38 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python from unstructured_client import UnstructuredClient +from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig with UnstructuredClient() as uc_client: - res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = uc_client.destinations.create_destination(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }, RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python from unstructured_client import UnstructuredClient +from unstructured_client.models import shared from unstructured_client.utils import BackoffStrategy, RetryConfig @@ -137,14 +149,24 @@ with UnstructuredClient( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), ) as uc_client: - res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = uc_client.destinations.create_destination(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) ``` @@ -164,7 +186,7 @@ By default, an API error will raise a errors.SDKError exception, which has the f | `.raw_response` | *httpx.Response* | The raw HTTP response | | `.body` | *str* | The response content | -When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async` method may raise the following exceptions: +When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_destination_async` method may raise the following exceptions: | Error Type | Status Code | Content Type | | -------------------------- | ----------- | ---------------- | @@ -175,21 +197,31 @@ When custom error responses are specified for an operation, the SDK may also rai ```python from unstructured_client import UnstructuredClient -from unstructured_client.models import errors +from unstructured_client.models import errors, shared with UnstructuredClient() as uc_client: res = None try: - res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = uc_client.destinations.create_destination(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) except errors.HTTPValidationError as e: # handle e.data: errors.HTTPValidationErrorData @@ -300,18 +332,29 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u ```python # Synchronous Example from unstructured_client import UnstructuredClient +from unstructured_client.models import shared with UnstructuredClient() as uc_client: - res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = uc_client.destinations.create_destination(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) ```
@@ -321,19 +364,30 @@ The same SDK client can also be used to make asychronous requests by importing a # Asynchronous Example import asyncio from unstructured_client import UnstructuredClient +from unstructured_client.models import shared async def main(): async with UnstructuredClient() as uc_client: - res = await uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = await uc_client.destinations.create_destination_async(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) asyncio.run(main()) ``` diff --git a/USAGE.md b/USAGE.md index 984a513c..27e85212 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,18 +2,29 @@ ```python # Synchronous Example from unstructured_client import UnstructuredClient +from unstructured_client.models import shared with UnstructuredClient() as uc_client: - res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = uc_client.destinations.create_destination(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) ```
@@ -23,19 +34,30 @@ The same SDK client can also be used to make asychronous requests by importing a # Asynchronous Example import asyncio from unstructured_client import UnstructuredClient +from unstructured_client.models import shared async def main(): async with UnstructuredClient() as uc_client: - res = await uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", + res = await uc_client.destinations.create_destination_async(request={ + "create_destination_connector": { + "config": { + "api_endpoint": "", + "batch_size": 20, + "collection_name": "", + "flatten_metadata": False, + "token": "", + }, + "name": "", + "type": shared.DestinationConnectorType.AZURE_AI_SEARCH, + }, }) - assert res.dag_node_connection_check is not None + assert res.destination_connector_information is not None # Handle response - print(res.dag_node_connection_check) + print(res.destination_connector_information) asyncio.run(main()) ``` diff --git a/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md b/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md deleted file mode 100644 index a0e6af23..00000000 --- a/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `source_id` | *str* | :heavy_check_mark: | N/A | -| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md b/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md deleted file mode 100644 index 7c8db3ae..00000000 --- a/docs/models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md b/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md deleted file mode 100644 index 7115b82d..00000000 --- a/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `destination_id` | *str* | :heavy_check_mark: | N/A | -| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md b/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md deleted file mode 100644 index 94f1c669..00000000 --- a/docs/models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md b/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md deleted file mode 100644 index 6479759d..00000000 --- a/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `source_id` | *str* | :heavy_check_mark: | N/A | -| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md b/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md deleted file mode 100644 index 0baf5669..00000000 --- a/docs/models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md b/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md deleted file mode 100644 index f7c37eeb..00000000 --- a/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `destination_id` | *str* | :heavy_check_mark: | N/A | -| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md b/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md deleted file mode 100644 index a4a9413f..00000000 --- a/docs/models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `dag_node_connection_check` | [Optional[shared.DagNodeConnectionCheck]](../../models/shared/dagnodeconnectioncheck.md) | :heavy_minus_sign: | Successful Response | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [httpx.Response](https://www.python-httpx.org/api/#response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/shared/connectioncheckstatus.md b/docs/models/shared/connectioncheckstatus.md deleted file mode 100644 index 08715d17..00000000 --- a/docs/models/shared/connectioncheckstatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# ConnectionCheckStatus - - -## Values - -| Name | Value | -| ----------- | ----------- | -| `SCHEDULED` | SCHEDULED | -| `SUCCESS` | SUCCESS | -| `FAILURE` | FAILURE | \ No newline at end of file diff --git a/docs/models/shared/dagnodeconnectioncheck.md b/docs/models/shared/dagnodeconnectioncheck.md deleted file mode 100644 index 23a8fe06..00000000 --- a/docs/models/shared/dagnodeconnectioncheck.md +++ /dev/null @@ -1,12 +0,0 @@ -# DagNodeConnectionCheck - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | N/A | -| `id` | *str* | :heavy_check_mark: | N/A | -| `reason` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `reported_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | -| `status` | [shared.ConnectionCheckStatus](../../models/shared/connectioncheckstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/destinations/README.md b/docs/sdks/destinations/README.md index 5c9bcf7d..8a847af8 100644 --- a/docs/sdks/destinations/README.md +++ b/docs/sdks/destinations/README.md @@ -5,66 +5,12 @@ ### Available Operations -* [check_destination_connection_api_v1_destinations_destination_id_connection_check_post](#check_destination_connection_api_v1_destinations_destination_id_connection_check_post) - Check Destination Connection * [create_destination](#create_destination) - Create destination connector * [delete_destination](#delete_destination) - Delete destination connector * [get_destination](#get_destination) - Get destination connector -* [get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get](#get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get) - Get Destination Connection Check * [list_destinations](#list_destinations) - List destination connectors * [update_destination](#update_destination) - Update destination connector -## check_destination_connection_api_v1_destinations_destination_id_connection_check_post - -Check Destination Connection - -Initiates a connection check for the specified destination connector. - -**Parameters:** -- **destination_id**: The UUID of the destination connector. -- **db_session**: Database session dependency. -- **user_data**: Information about the authenticated user. - -**Returns:** -- The result of the connection check. - -### Example Usage - -```python -from unstructured_client import UnstructuredClient - - -with UnstructuredClient() as uc_client: - - res = uc_client.destinations.check_destination_connection_api_v1_destinations_destination_id_connection_check_post(request={ - "destination_id": "b65169f5-79ba-4464-918f-b0be2c07b962", - }) - - assert res.dag_node_connection_check is not None - - # Handle response - print(res.dag_node_connection_check) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `request` | [operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest](../../models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostrequest.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 - -**[operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse](../../models/operations/checkdestinationconnectionapiv1destinationsdestinationidconnectioncheckpostresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - ## create_destination Create a new destination connector using the provided configuration and name. @@ -202,58 +148,6 @@ with UnstructuredClient() as uc_client: | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | -## get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get - -Get Destination Connection Check - -Retrieves the most recent connection check for the specified destination connector. - -**Parameters:** -- **destination_id**: The UUID of the destination connector. -- **db_session**: Database session dependency. -- **user_data**: Information about the authenticated user. - -**Returns:** -- Connection check results. - -### Example Usage - -```python -from unstructured_client import UnstructuredClient - - -with UnstructuredClient() as uc_client: - - res = uc_client.destinations.get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get(request={ - "destination_id": "3c48df35-2b2c-46f2-9aa2-d7eae993797c", - }) - - assert res.dag_node_connection_check is not None - - # Handle response - print(res.dag_node_connection_check) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest](../../models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetrequest.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 - -**[operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse](../../models/operations/getdestinationconnectioncheckapiv1destinationsdestinationidconnectioncheckgetresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - ## list_destinations Retrieve a list of available destination connectors. diff --git a/docs/sdks/sources/README.md b/docs/sdks/sources/README.md index c3dec73f..54452ead 100644 --- a/docs/sdks/sources/README.md +++ b/docs/sdks/sources/README.md @@ -5,66 +5,12 @@ ### Available Operations -* [check_connection_api_v1_sources_source_id_connection_check_post](#check_connection_api_v1_sources_source_id_connection_check_post) - Check Connection * [create_source](#create_source) - Create source connector * [delete_source](#delete_source) - Delete source connector -* [get_connection_check_api_v1_sources_source_id_connection_check_get](#get_connection_check_api_v1_sources_source_id_connection_check_get) - Get Connection Check * [get_source](#get_source) - Get source connector * [list_sources](#list_sources) - List available source connectors * [update_source](#update_source) - Update source connector -## check_connection_api_v1_sources_source_id_connection_check_post - -Check Connection - -Initiates a connection check for the specified source connector. - -**Parameters:** -- **source_id**: The UUID of the source connector. -- **db_session**: Database session dependency. -- **user_data**: Information about the authenticated user. - -**Returns:** -- The result of the connection check. - -### Example Usage - -```python -from unstructured_client import UnstructuredClient - - -with UnstructuredClient() as uc_client: - - res = uc_client.sources.check_connection_api_v1_sources_source_id_connection_check_post(request={ - "source_id": "8cb54f13-5652-423e-889c-1df1f8147126", - }) - - assert res.dag_node_connection_check is not None - - # Handle response - print(res.dag_node_connection_check) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `request` | [operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest](../../models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostrequest.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 - -**[operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse](../../models/operations/checkconnectionapiv1sourcessourceidconnectioncheckpostresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - ## create_source Create a new source connector using the provided configuration and name. @@ -162,58 +108,6 @@ with UnstructuredClient() as uc_client: | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | -## get_connection_check_api_v1_sources_source_id_connection_check_get - -Get Connection Checks - -Retrieves the most recent connection check for the specified source connector. - -**Parameters:** -- **source_id**: The UUID of the source connector. -- **db_session**: Database session dependency. -- **user_data**: Information about the authenticated user. - -**Returns:** -- Connection check results. - -### Example Usage - -```python -from unstructured_client import UnstructuredClient - - -with UnstructuredClient() as uc_client: - - res = uc_client.sources.get_connection_check_api_v1_sources_source_id_connection_check_get(request={ - "source_id": "d9c3daec-ddf9-4cef-ae8d-3a989813cc7b", - }) - - assert res.dag_node_connection_check is not None - - # Handle response - print(res.dag_node_connection_check) - -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest](../../models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetrequest.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 - -**[operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse](../../models/operations/getconnectioncheckapiv1sourcessourceidconnectioncheckgetresponse.md)** - -### Errors - -| Error Type | Status Code | Content Type | -| -------------------------- | -------------------------- | -------------------------- | -| errors.HTTPValidationError | 422 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - ## get_source Retrieve detailed information for a specific source connector by its ID. diff --git a/gen.yaml b/gen.yaml index 9e5b2eee..bd93d4c5 100644 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.32.5 + version: 0.33.0 additionalDependencies: dev: deepdiff: '>=6.0' diff --git a/pyproject.toml b/pyproject.toml index d5eca154..23a1a66a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.32.5" +version = "0.33.0" description = "Python Client SDK for Unstructured API" authors = [{ name = "Unstructured" },] readme = "README-PYPI.md" diff --git a/src/unstructured_client/_version.py b/src/unstructured_client/_version.py index 24db1b38..63db4e6b 100644 --- a/src/unstructured_client/_version.py +++ b/src/unstructured_client/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "unstructured-client" -__version__: str = "0.32.5" +__version__: str = "0.33.0" __openapi_doc_version__: str = "1.1.7" -__gen_version__: str = "2.585.1" -__user_agent__: str = "speakeasy-sdk/python 0.32.5 2.585.1 1.1.7 unstructured-client" +__gen_version__: str = "2.585.0" +__user_agent__: str = "speakeasy-sdk/python 0.33.0 2.585.0 1.1.7 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/destinations.py b/src/unstructured_client/destinations.py index 0d4e7bef..6eba26da 100644 --- a/src/unstructured_client/destinations.py +++ b/src/unstructured_client/destinations.py @@ -9,264 +9,6 @@ class Destinations(BaseSDK): - def check_destination_connection_api_v1_destinations_destination_id_connection_check_post( - self, - *, - request: Union[ - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse: - r"""Check Destination Connection - - Check Destination Connection - - Initiates a connection check for the specified destination connector. - - **Parameters:** - - **destination_id**: The UUID of the destination connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - The result of the connection check. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS[ - operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - ) - request = cast( - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - request, - ) - - req = self._build_request( - method="POST", - path="/api/v1/destinations/{destination_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="check_destination_connection_api_v1_destinations__destination_id__connection_check_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def check_destination_connection_api_v1_destinations_destination_id_connection_check_post_async( - self, - *, - request: Union[ - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse: - r"""Check Destination Connection - - Check Destination Connection - - Initiates a connection check for the specified destination connector. - - **Parameters:** - - **destination_id**: The UUID of the destination connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - The result of the connection check. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS[ - operations.CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - ) - request = cast( - operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - request, - ) - - req = self._build_request_async( - method="POST", - path="/api/v1/destinations/{destination_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="check_destination_connection_api_v1_destinations__destination_id__connection_check_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return operations.CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - def create_destination( self, *, @@ -953,264 +695,6 @@ async def get_destination_async( http_res, ) - def get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get( - self, - *, - request: Union[ - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse: - r"""Get Destination Connection Check - - Get Destination Connection Check - - Retrieves the most recent connection check for the specified destination connector. - - **Parameters:** - - **destination_id**: The UUID of the destination connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - Connection check results. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS[ - operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - ) - request = cast( - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - request, - ) - - req = self._build_request( - method="GET", - path="/api/v1/destinations/{destination_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="get_destination_connection_check_api_v1_destinations__destination_id__connection_check_get", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get_async( - self, - *, - request: Union[ - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse: - r"""Get Destination Connection Check - - Get Destination Connection Check - - Retrieves the most recent connection check for the specified destination connector. - - **Parameters:** - - **destination_id**: The UUID of the destination connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - Connection check results. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS[ - operations.GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - ) - request = cast( - operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - request, - ) - - req = self._build_request_async( - method="GET", - path="/api/v1/destinations/{destination_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="get_destination_connection_check_api_v1_destinations__destination_id__connection_check_get", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - def list_destinations( self, *, diff --git a/src/unstructured_client/models/operations/__init__.py b/src/unstructured_client/models/operations/__init__.py index 7391c8d1..7a02a0ac 100644 --- a/src/unstructured_client/models/operations/__init__.py +++ b/src/unstructured_client/models/operations/__init__.py @@ -8,22 +8,6 @@ CancelJobResponse, CancelJobResponseTypedDict, ) -from .check_connection_api_v1_sources_source_id_connection_check_post import ( - CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS, - CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API, - CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict, - CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse, - CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponseTypedDict, -) -from .check_destination_connection_api_v1_destinations_destination_id_connection_check_post import ( - CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS, - CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API, - CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest, - CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict, - CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse, - CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponseTypedDict, -) from .create_destination import ( CREATE_DESTINATION_SERVERS, CREATE_DESTINATION_SERVER_PLATFORM_API, @@ -80,14 +64,6 @@ DownloadJobOutputResponse, DownloadJobOutputResponseTypedDict, ) -from .get_connection_check_api_v1_sources_source_id_connection_check_get import ( - GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS, - GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API, - GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict, - GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse, - GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponseTypedDict, -) from .get_destination import ( GET_DESTINATION_SERVERS, GET_DESTINATION_SERVER_PLATFORM_API, @@ -96,14 +72,6 @@ GetDestinationResponse, GetDestinationResponseTypedDict, ) -from .get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get import ( - GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS, - GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API, - GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest, - GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict, - GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse, - GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponseTypedDict, -) from .get_job import ( GET_JOB_SERVERS, GET_JOB_SERVER_PLATFORM_API, @@ -206,10 +174,6 @@ __all__ = [ "CANCEL_JOB_SERVERS", "CANCEL_JOB_SERVER_PLATFORM_API", - "CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS", - "CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API", - "CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS", - "CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API", "CREATE_DESTINATION_SERVERS", "CREATE_DESTINATION_SERVER_PLATFORM_API", "CREATE_SOURCE_SERVERS", @@ -220,14 +184,6 @@ "CancelJobRequestTypedDict", "CancelJobResponse", "CancelJobResponseTypedDict", - "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest", - "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict", - "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse", - "CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponseTypedDict", - "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest", - "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict", - "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse", - "CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponseTypedDict", "CreateDestinationRequest", "CreateDestinationRequestTypedDict", "CreateDestinationResponse", @@ -264,10 +220,6 @@ "DownloadJobOutputRequestTypedDict", "DownloadJobOutputResponse", "DownloadJobOutputResponseTypedDict", - "GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS", - "GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API", - "GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS", - "GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API", "GET_DESTINATION_SERVERS", "GET_DESTINATION_SERVER_PLATFORM_API", "GET_JOB_SERVERS", @@ -276,14 +228,6 @@ "GET_SOURCE_SERVER_PLATFORM_API", "GET_WORKFLOW_SERVERS", "GET_WORKFLOW_SERVER_PLATFORM_API", - "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest", - "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict", - "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse", - "GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponseTypedDict", - "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest", - "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict", - "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse", - "GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponseTypedDict", "GetDestinationRequest", "GetDestinationRequestTypedDict", "GetDestinationResponse", diff --git a/src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py b/src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py deleted file mode 100644 index 6902c8db..00000000 --- a/src/unstructured_client/models/operations/check_connection_api_v1_sources_source_id_connection_check_post.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -import httpx -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict -from unstructured_client.models.shared import ( - dagnodeconnectioncheck as shared_dagnodeconnectioncheck, -) -from unstructured_client.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata - -CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API = ( - "platform-api" -) -r"""Unstructured Platform API""" - -CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS = { - CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - - -class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict(TypedDict): - source_id: str - unstructured_api_key: NotRequired[Nullable[str]] - - -class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest(BaseModel): - source_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - unstructured_api_key: Annotated[ - OptionalNullable[str], - pydantic.Field(alias="unstructured-api-key"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["unstructured-api-key"] - nullable_fields = ["unstructured-api-key"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m - - -class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponseTypedDict( - TypedDict -): - content_type: str - r"""HTTP response content type for this operation""" - status_code: int - r"""HTTP response status code for this operation""" - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - dag_node_connection_check: NotRequired[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict - ] - r"""Successful Response""" - - -class CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse(BaseModel): - content_type: str - r"""HTTP response content type for this operation""" - - status_code: int - r"""HTTP response status code for this operation""" - - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - - dag_node_connection_check: Optional[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheck - ] = None - r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py b/src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py deleted file mode 100644 index b1c76d82..00000000 --- a/src/unstructured_client/models/operations/check_destination_connection_api_v1_destinations_destination_id_connection_check_post.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -import httpx -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict -from unstructured_client.models.shared import ( - dagnodeconnectioncheck as shared_dagnodeconnectioncheck, -) -from unstructured_client.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata - -CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVERS = { - CHECK_DESTINATION_CONNECTION_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - - -class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequestTypedDict( - TypedDict -): - destination_id: str - unstructured_api_key: NotRequired[Nullable[str]] - - -class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostRequest( - BaseModel -): - destination_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - unstructured_api_key: Annotated[ - OptionalNullable[str], - pydantic.Field(alias="unstructured-api-key"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["unstructured-api-key"] - nullable_fields = ["unstructured-api-key"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m - - -class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponseTypedDict( - TypedDict -): - content_type: str - r"""HTTP response content type for this operation""" - status_code: int - r"""HTTP response status code for this operation""" - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - dag_node_connection_check: NotRequired[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict - ] - r"""Successful Response""" - - -class CheckDestinationConnectionAPIV1DestinationsDestinationIDConnectionCheckPostResponse( - BaseModel -): - content_type: str - r"""HTTP response content type for this operation""" - - status_code: int - r"""HTTP response status code for this operation""" - - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - - dag_node_connection_check: Optional[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheck - ] = None - r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py b/src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py deleted file mode 100644 index 46f44e76..00000000 --- a/src/unstructured_client/models/operations/get_connection_check_api_v1_sources_source_id_connection_check_get.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -import httpx -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict -from unstructured_client.models.shared import ( - dagnodeconnectioncheck as shared_dagnodeconnectioncheck, -) -from unstructured_client.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata - -GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS = { - GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - - -class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict( - TypedDict -): - source_id: str - unstructured_api_key: NotRequired[Nullable[str]] - - -class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest(BaseModel): - source_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - unstructured_api_key: Annotated[ - OptionalNullable[str], - pydantic.Field(alias="unstructured-api-key"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["unstructured-api-key"] - nullable_fields = ["unstructured-api-key"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m - - -class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponseTypedDict( - TypedDict -): - content_type: str - r"""HTTP response content type for this operation""" - status_code: int - r"""HTTP response status code for this operation""" - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - dag_node_connection_check: NotRequired[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict - ] - r"""Successful Response""" - - -class GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse(BaseModel): - content_type: str - r"""HTTP response content type for this operation""" - - status_code: int - r"""HTTP response status code for this operation""" - - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - - dag_node_connection_check: Optional[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheck - ] = None - r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py b/src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py deleted file mode 100644 index be37612c..00000000 --- a/src/unstructured_client/models/operations/get_destination_connection_check_api_v1_destinations_destination_id_connection_check_get.py +++ /dev/null @@ -1,110 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -import httpx -import pydantic -from pydantic import model_serializer -from typing import Optional -from typing_extensions import Annotated, NotRequired, TypedDict -from unstructured_client.models.shared import ( - dagnodeconnectioncheck as shared_dagnodeconnectioncheck, -) -from unstructured_client.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) -from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata - -GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API = "platform-api" -r"""Unstructured Platform API""" - -GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVERS = { - GET_DESTINATION_CONNECTION_CHECK_API_V1_DESTINATIONS_DESTINATION_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", -} - - -class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequestTypedDict( - TypedDict -): - destination_id: str - unstructured_api_key: NotRequired[Nullable[str]] - - -class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetRequest( - BaseModel -): - destination_id: Annotated[ - str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) - ] - - unstructured_api_key: Annotated[ - OptionalNullable[str], - pydantic.Field(alias="unstructured-api-key"), - FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), - ] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["unstructured-api-key"] - nullable_fields = ["unstructured-api-key"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m - - -class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponseTypedDict( - TypedDict -): - content_type: str - r"""HTTP response content type for this operation""" - status_code: int - r"""HTTP response status code for this operation""" - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - dag_node_connection_check: NotRequired[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheckTypedDict - ] - r"""Successful Response""" - - -class GetDestinationConnectionCheckAPIV1DestinationsDestinationIDConnectionCheckGetResponse( - BaseModel -): - content_type: str - r"""HTTP response content type for this operation""" - - status_code: int - r"""HTTP response status code for this operation""" - - raw_response: httpx.Response - r"""Raw HTTP response; suitable for custom response parsing""" - - dag_node_connection_check: Optional[ - shared_dagnodeconnectioncheck.DagNodeConnectionCheck - ] = None - r"""Successful Response""" diff --git a/src/unstructured_client/models/shared/__init__.py b/src/unstructured_client/models/shared/__init__.py index 26e65b5c..25e37417 100644 --- a/src/unstructured_client/models/shared/__init__.py +++ b/src/unstructured_client/models/shared/__init__.py @@ -46,7 +46,6 @@ ConfluenceSourceConnectorConfigInput, ConfluenceSourceConnectorConfigInputTypedDict, ) -from .connectioncheckstatus import ConnectionCheckStatus from .couchbasedestinationconnectorconfig import ( CouchbaseDestinationConnectorConfig, CouchbaseDestinationConnectorConfigTypedDict, @@ -77,10 +76,6 @@ ) from .createworkflow import CreateWorkflow, CreateWorkflowTypedDict, Schedule from .crontabentry import CronTabEntry, CronTabEntryTypedDict -from .dagnodeconnectioncheck import ( - DagNodeConnectionCheck, - DagNodeConnectionCheckTypedDict, -) from .databricksvdtdestinationconnectorconfig import ( DatabricksVDTDestinationConnectorConfig, DatabricksVDTDestinationConnectorConfigTypedDict, @@ -404,7 +399,6 @@ "ConfluenceSourceConnectorConfigInput", "ConfluenceSourceConnectorConfigInputTypedDict", "ConfluenceSourceConnectorConfigTypedDict", - "ConnectionCheckStatus", "CouchbaseDestinationConnectorConfig", "CouchbaseDestinationConnectorConfigInput", "CouchbaseDestinationConnectorConfigInputTypedDict", @@ -423,8 +417,6 @@ "CreateWorkflowTypedDict", "CronTabEntry", "CronTabEntryTypedDict", - "DagNodeConnectionCheck", - "DagNodeConnectionCheckTypedDict", "DatabricksVDTDestinationConnectorConfig", "DatabricksVDTDestinationConnectorConfigInput", "DatabricksVDTDestinationConnectorConfigInputTypedDict", diff --git a/src/unstructured_client/models/shared/connectioncheckstatus.py b/src/unstructured_client/models/shared/connectioncheckstatus.py deleted file mode 100644 index a2f6477f..00000000 --- a/src/unstructured_client/models/shared/connectioncheckstatus.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - - -class ConnectionCheckStatus(str, Enum): - SCHEDULED = "SCHEDULED" - SUCCESS = "SUCCESS" - FAILURE = "FAILURE" diff --git a/src/unstructured_client/models/shared/dagnodeconnectioncheck.py b/src/unstructured_client/models/shared/dagnodeconnectioncheck.py deleted file mode 100644 index fade6b96..00000000 --- a/src/unstructured_client/models/shared/dagnodeconnectioncheck.py +++ /dev/null @@ -1,64 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .connectioncheckstatus import ConnectionCheckStatus -from datetime import datetime -from pydantic import model_serializer -from typing_extensions import NotRequired, TypedDict -from unstructured_client.types import ( - BaseModel, - Nullable, - OptionalNullable, - UNSET, - UNSET_SENTINEL, -) - - -class DagNodeConnectionCheckTypedDict(TypedDict): - created_at: datetime - id: str - status: ConnectionCheckStatus - reason: NotRequired[Nullable[str]] - reported_at: NotRequired[Nullable[datetime]] - - -class DagNodeConnectionCheck(BaseModel): - created_at: datetime - - id: str - - status: ConnectionCheckStatus - - reason: OptionalNullable[str] = UNSET - - reported_at: OptionalNullable[datetime] = UNSET - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = ["reason", "reported_at"] - nullable_fields = ["reason", "reported_at"] - null_default_fields = [] - - serialized = handler(self) - - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k) - serialized.pop(k, None) - - optional_nullable = k in optional_fields and k in nullable_fields - is_set = ( - self.__pydantic_fields_set__.intersection({n}) - or k in null_default_fields - ) # pylint: disable=no-member - - if val is not None and val != UNSET_SENTINEL: - m[k] = val - elif val != UNSET_SENTINEL and ( - not k in optional_fields or (optional_nullable and is_set) - ): - m[k] = val - - return m diff --git a/src/unstructured_client/sources.py b/src/unstructured_client/sources.py index 4761ad85..20d0d09d 100644 --- a/src/unstructured_client/sources.py +++ b/src/unstructured_client/sources.py @@ -9,264 +9,6 @@ class Sources(BaseSDK): - def check_connection_api_v1_sources_source_id_connection_check_post( - self, - *, - request: Union[ - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse: - r"""Check Connection - - Check Connection - - Initiates a connection check for the specified source connector. - - **Parameters:** - - **source_id**: The UUID of the source connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - The result of the connection check. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS[ - operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - ) - request = cast( - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - request, - ) - - req = self._build_request( - method="POST", - path="/api/v1/sources/{source_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="check_connection_api_v1_sources__source_id__connection_check_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def check_connection_api_v1_sources_source_id_connection_check_post_async( - self, - *, - request: Union[ - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse: - r"""Check Connection - - Check Connection - - Initiates a connection check for the specified source connector. - - **Parameters:** - - **source_id**: The UUID of the source connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - The result of the connection check. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVERS[ - operations.CHECK_CONNECTION_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_POST_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - ) - request = cast( - operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostRequest, - request, - ) - - req = self._build_request_async( - method="POST", - path="/api/v1/sources/{source_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="check_connection_api_v1_sources__source_id__connection_check_post", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "202", "application/json"): - return operations.CheckConnectionAPIV1SourcesSourceIDConnectionCheckPostResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - def create_source( self, *, @@ -725,264 +467,6 @@ async def delete_source_async( http_res, ) - def get_connection_check_api_v1_sources_source_id_connection_check_get( - self, - *, - request: Union[ - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse: - r"""Get Connection Check - - Get Connection Checks - - Retrieves the most recent connection check for the specified source connector. - - **Parameters:** - - **source_id**: The UUID of the source connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - Connection check results. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS[ - operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - ) - request = cast( - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - request, - ) - - req = self._build_request( - method="GET", - path="/api/v1/sources/{source_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = self.do_request( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="get_connection_check_api_v1_sources__source_id__connection_check_get", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = utils.stream_to_text(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - - async def get_connection_check_api_v1_sources_source_id_connection_check_get_async( - self, - *, - request: Union[ - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequestTypedDict, - ], - retries: OptionalNullable[utils.RetryConfig] = UNSET, - server_url: Optional[str] = None, - timeout_ms: Optional[int] = None, - http_headers: Optional[Mapping[str, str]] = None, - ) -> operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse: - r"""Get Connection Check - - Get Connection Checks - - Retrieves the most recent connection check for the specified source connector. - - **Parameters:** - - **source_id**: The UUID of the source connector. - - **db_session**: Database session dependency. - - **user_data**: Information about the authenticated user. - - **Returns:** - - Connection check results. - - :param request: The request object to send. - :param retries: Override the default retry configuration for this method - :param server_url: Override the default server URL for this method - :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 = 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 = operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVERS[ - operations.GET_CONNECTION_CHECK_API_V1_SOURCES_SOURCE_ID_CONNECTION_CHECK_GET_SERVER_PLATFORM_API - ] - - if not isinstance(request, BaseModel): - request = utils.unmarshal( - request, - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - ) - request = cast( - operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetRequest, - request, - ) - - req = self._build_request_async( - method="GET", - path="/api/v1/sources/{source_id}/connection-check", - base_url=base_url, - url_variables=url_variables, - request=request, - request_body_required=False, - request_has_path_params=True, - request_has_query_params=True, - user_agent_header="user-agent", - accept_header_value="application/json", - http_headers=http_headers, - security=self.sdk_configuration.security, - timeout_ms=timeout_ms, - ) - - if retries == UNSET: - if self.sdk_configuration.retry_config is not UNSET: - retries = self.sdk_configuration.retry_config - else: - retries = utils.RetryConfig( - "backoff", utils.BackoffStrategy(3000, 720000, 1.88, 1800000), True - ) - - retry_config = None - if isinstance(retries, utils.RetryConfig): - retry_config = (retries, ["5xx"]) - - http_res = await self.do_request_async( - hook_ctx=HookContext( - base_url=base_url or "", - operation_id="get_connection_check_api_v1_sources__source_id__connection_check_get", - oauth2_scopes=[], - security_source=self.sdk_configuration.security, - ), - request=req, - error_status_codes=["422", "4XX", "5XX"], - retry_config=retry_config, - ) - - response_data: Any = None - if utils.match_response(http_res, "200", "application/json"): - return operations.GetConnectionCheckAPIV1SourcesSourceIDConnectionCheckGetResponse( - dag_node_connection_check=utils.unmarshal_json( - http_res.text, Optional[shared.DagNodeConnectionCheck] - ), - status_code=http_res.status_code, - content_type=http_res.headers.get("Content-Type") or "", - raw_response=http_res, - ) - if utils.match_response(http_res, "422", "application/json"): - response_data = utils.unmarshal_json( - http_res.text, errors.HTTPValidationErrorData - ) - raise errors.HTTPValidationError(data=response_data) - if utils.match_response(http_res, "4XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - if utils.match_response(http_res, "5XX", "*"): - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - "API error occurred", http_res.status_code, http_res_text, http_res - ) - - content_type = http_res.headers.get("Content-Type") - http_res_text = await utils.stream_to_text_async(http_res) - raise errors.SDKError( - f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", - http_res.status_code, - http_res_text, - http_res, - ) - def get_source( self, *, From 8ed9d5f1026f7c83890da380cc53ce241ae58e93 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Thu, 17 Apr 2025 16:54:25 -0400 Subject: [PATCH 3/3] Bump releases file --- RELEASES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index d1d1b654..eb3bdbbc 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -964,6 +964,6 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.535.0 (2.585.1) https://github.com/speakeasy-api/speakeasy ### Generated -- [python v0.32.5] . +- [python v0.33.0] . ### Releases -- [PyPI v0.32.5] https://pypi.org/project/unstructured-client/0.32.5 - . \ No newline at end of file +- [PyPI v0.33.0] https://pypi.org/project/unstructured-client/0.33.0 - .