diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a8480c36..7533edfe 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: 1305a6771cbde39530fd78e1b8acb938 - docVersion: 1.1.17 + docChecksum: bac3524113e4b9ed02bfae0e65ccb42b + docVersion: 1.1.25 speakeasyVersion: 1.552.0 generationVersion: 2.610.0 - releaseVersion: 0.36.0 - configChecksum: e1d52979607afacfb892d70fedc250fb + releaseVersion: 0.37.1 + configChecksum: 995e2ded80d15617a1661ac4be288219 repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git repoSubDirectory: . installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git @@ -70,6 +70,10 @@ generatedFiles: - docs/models/operations/getconnectionchecksourcesresponse.md - docs/models/operations/getdestinationrequest.md - docs/models/operations/getdestinationresponse.md + - docs/models/operations/getjobdetailsrequest.md + - docs/models/operations/getjobdetailsresponse.md + - docs/models/operations/getjobfailedfilesrequest.md + - docs/models/operations/getjobfailedfilesresponse.md - docs/models/operations/getjobrequest.md - docs/models/operations/getjobresponse.md - docs/models/operations/getsourcerequest.md @@ -86,8 +90,12 @@ generatedFiles: - docs/models/operations/listworkflowsresponse.md - docs/models/operations/partitionrequest.md - docs/models/operations/partitionresponse.md + - docs/models/operations/retrieverequest.md + - docs/models/operations/retrieveresponse.md - docs/models/operations/runworkflowrequest.md - docs/models/operations/runworkflowresponse.md + - docs/models/operations/storesecretrequest.md + - docs/models/operations/storesecretresponse.md - docs/models/operations/updatedestinationrequest.md - docs/models/operations/updatedestinationresponse.md - docs/models/operations/updatesourcerequest.md @@ -130,6 +138,9 @@ generatedFiles: - docs/models/shared/dropboxsourceconnectorconfiginput.md - docs/models/shared/elasticsearchconnectorconfig.md - docs/models/shared/elasticsearchconnectorconfiginput.md + - docs/models/shared/encryptedsecret.md + - docs/models/shared/encryptiontype.md + - docs/models/shared/failedfile.md - docs/models/shared/files.md - docs/models/shared/gcsdestinationconnectorconfig.md - docs/models/shared/gcsdestinationconnectorconfiginput.md @@ -137,12 +148,17 @@ generatedFiles: - docs/models/shared/gcssourceconnectorconfiginput.md - docs/models/shared/googledrivesourceconnectorconfig.md - docs/models/shared/googledrivesourceconnectorconfiginput.md + - docs/models/shared/googledrivesourceconnectorconfiginputserviceaccountkey.md - docs/models/shared/ibmwatsonxs3destinationconnectorconfig.md - docs/models/shared/ibmwatsonxs3destinationconnectorconfiginput.md - docs/models/shared/inputfiles.md - docs/models/shared/jirasourceconnectorconfig.md - docs/models/shared/jirasourceconnectorconfiginput.md + - docs/models/shared/jobdetails.md + - docs/models/shared/jobfailedfiles.md - docs/models/shared/jobinformation.md + - docs/models/shared/jobnodedetails.md + - docs/models/shared/jobprocessingstatus.md - docs/models/shared/jobstatus.md - docs/models/shared/kafkaclouddestinationconnectorconfig.md - docs/models/shared/kafkaclouddestinationconnectorconfiginput.md @@ -164,6 +180,7 @@ generatedFiles: - docs/models/shared/outlooksourceconnectorconfiginput.md - docs/models/shared/outputformat.md - docs/models/shared/partitionparameters.md + - docs/models/shared/pemauthresponse.md - docs/models/shared/pineconedestinationconnectorconfig.md - docs/models/shared/pineconedestinationconnectorconfiginput.md - docs/models/shared/postgresdestinationconnectorconfig.md @@ -181,13 +198,16 @@ generatedFiles: - docs/models/shared/salesforcesourceconnectorconfig.md - docs/models/shared/salesforcesourceconnectorconfiginput.md - docs/models/shared/schedule.md + - docs/models/shared/secretreference.md - docs/models/shared/security.md + - docs/models/shared/serviceaccountkey.md - docs/models/shared/sharepointsourceconnectorconfig.md - docs/models/shared/sharepointsourceconnectorconfiginput.md - docs/models/shared/snowflakedestinationconnectorconfig.md - docs/models/shared/snowflakedestinationconnectorconfiginput.md - docs/models/shared/snowflakesourceconnectorconfig.md - docs/models/shared/snowflakesourceconnectorconfiginput.md + - docs/models/shared/sortdirection.md - docs/models/shared/sourceconnectorinformation.md - docs/models/shared/sourceconnectorinformationconfig.md - docs/models/shared/sourceconnectortype.md @@ -217,6 +237,7 @@ generatedFiles: - docs/sdks/jobs/README.md - docs/sdks/sources/README.md - docs/sdks/unstructuredclient/README.md + - docs/sdks/users/README.md - docs/sdks/workflows/README.md - poetry.toml - py.typed @@ -251,6 +272,8 @@ generatedFiles: - src/unstructured_client/models/operations/get_connection_check_sources.py - src/unstructured_client/models/operations/get_destination.py - src/unstructured_client/models/operations/get_job.py + - src/unstructured_client/models/operations/get_job_details.py + - src/unstructured_client/models/operations/get_job_failed_files.py - src/unstructured_client/models/operations/get_source.py - src/unstructured_client/models/operations/get_workflow.py - src/unstructured_client/models/operations/list_destinations.py @@ -258,7 +281,9 @@ generatedFiles: - src/unstructured_client/models/operations/list_sources.py - src/unstructured_client/models/operations/list_workflows.py - src/unstructured_client/models/operations/partition.py + - src/unstructured_client/models/operations/retrieve.py - src/unstructured_client/models/operations/run_workflow.py + - src/unstructured_client/models/operations/store_secret.py - src/unstructured_client/models/operations/update_destination.py - src/unstructured_client/models/operations/update_source.py - src/unstructured_client/models/operations/update_workflow.py @@ -296,6 +321,9 @@ generatedFiles: - src/unstructured_client/models/shared/dropboxsourceconnectorconfiginput.py - src/unstructured_client/models/shared/elasticsearchconnectorconfig.py - src/unstructured_client/models/shared/elasticsearchconnectorconfiginput.py + - src/unstructured_client/models/shared/encryptedsecret.py + - src/unstructured_client/models/shared/encryptiontype.py + - src/unstructured_client/models/shared/failedfile.py - src/unstructured_client/models/shared/gcsdestinationconnectorconfig.py - src/unstructured_client/models/shared/gcsdestinationconnectorconfiginput.py - src/unstructured_client/models/shared/gcssourceconnectorconfig.py @@ -306,7 +334,11 @@ generatedFiles: - src/unstructured_client/models/shared/ibmwatsonxs3destinationconnectorconfiginput.py - src/unstructured_client/models/shared/jirasourceconnectorconfig.py - src/unstructured_client/models/shared/jirasourceconnectorconfiginput.py + - src/unstructured_client/models/shared/jobdetails.py + - src/unstructured_client/models/shared/jobfailedfiles.py - src/unstructured_client/models/shared/jobinformation.py + - src/unstructured_client/models/shared/jobnodedetails.py + - src/unstructured_client/models/shared/jobprocessingstatus.py - src/unstructured_client/models/shared/jobstatus.py - src/unstructured_client/models/shared/kafkaclouddestinationconnectorconfig.py - src/unstructured_client/models/shared/kafkaclouddestinationconnectorconfiginput.py @@ -326,6 +358,7 @@ generatedFiles: - src/unstructured_client/models/shared/outlooksourceconnectorconfig.py - src/unstructured_client/models/shared/outlooksourceconnectorconfiginput.py - src/unstructured_client/models/shared/partition_parameters.py + - src/unstructured_client/models/shared/pemauthresponse.py - src/unstructured_client/models/shared/pineconedestinationconnectorconfig.py - src/unstructured_client/models/shared/pineconedestinationconnectorconfiginput.py - src/unstructured_client/models/shared/postgresdestinationconnectorconfig.py @@ -342,6 +375,7 @@ generatedFiles: - src/unstructured_client/models/shared/s3sourceconnectorconfiginput.py - src/unstructured_client/models/shared/salesforcesourceconnectorconfig.py - src/unstructured_client/models/shared/salesforcesourceconnectorconfiginput.py + - src/unstructured_client/models/shared/secretreference.py - src/unstructured_client/models/shared/security.py - src/unstructured_client/models/shared/sharepointsourceconnectorconfig.py - src/unstructured_client/models/shared/sharepointsourceconnectorconfiginput.py @@ -349,6 +383,7 @@ generatedFiles: - src/unstructured_client/models/shared/snowflakedestinationconnectorconfiginput.py - src/unstructured_client/models/shared/snowflakesourceconnectorconfig.py - src/unstructured_client/models/shared/snowflakesourceconnectorconfiginput.py + - src/unstructured_client/models/shared/sortdirection.py - src/unstructured_client/models/shared/sourceconnectorinformation.py - src/unstructured_client/models/shared/sourceconnectortype.py - src/unstructured_client/models/shared/updatedestinationconnector.py @@ -370,6 +405,7 @@ generatedFiles: - src/unstructured_client/sdkconfiguration.py - src/unstructured_client/types/__init__.py - src/unstructured_client/types/basemodel.py + - src/unstructured_client/users.py - src/unstructured_client/utils/__init__.py - src/unstructured_client/utils/annotations.py - src/unstructured_client/utils/datetimes.py @@ -594,6 +630,9 @@ examples: application/json: {"detail": ""} list_workflows: speakeasy-default-list-workflows: + parameters: + query: + sort_by: "id" responses: "200": application/json: [{"created_at": "2023-09-02T04:21:23.162Z", "destinations": [], "id": "1e4c63cf-6a6b-407b-b993-b2bc8b3bcefc", "name": "", "schedule": {"crontab_entries": [{"cron_expression": "0 0 * * *"}]}, "sources": ["2e12d926-4caf-4cce-8b5c-3e16722c1c84"], "status": "inactive", "workflow_nodes": [{"name": "", "subtype": "", "type": ""}, {"name": "", "subtype": "", "type": ""}]}, {"created_at": "2023-09-02T04:21:23.162Z", "destinations": [], "id": "1e4c63cf-6a6b-407b-b993-b2bc8b3bcefc", "name": "", "schedule": {"crontab_entries": [{"cron_expression": "0 0 * * *"}]}, "sources": ["2e12d926-4caf-4cce-8b5c-3e16722c1c84"], "status": "inactive", "workflow_nodes": [{"name": "", "subtype": "", "type": ""}, {"name": "", "subtype": "", "type": ""}]}] @@ -633,5 +672,41 @@ examples: application/json: {"detail": ""} 5XX: application/json: {"detail": "An error occurred"} + get_job_details: + speakeasy-default-get-job-details: + parameters: + path: + job_id: "14cc95f9-4174-46b3-81f5-7089b87a4787" + responses: + "200": + application/json: {"id": "39a8d74e-66d2-40a4-a9b0-25ee4f08f855", "node_stats": [], "processing_status": "STOPPED"} + "422": + application/json: {"detail": ""} + get_job_failed_files: + speakeasy-default-get-job-failed-files: + parameters: + path: + job_id: "ad262041-3530-40a9-9f83-b004e947a203" + responses: + "200": + application/json: {"failed_files": []} + "422": + application/json: {"detail": ""} + retrieve: + speakeasy-default-retrieve: + responses: + "200": + application/json: {"pem_key": "", "tenant_id": ""} + "422": + application/json: {"detail": ""} + store_secret: + speakeasy-default-store-secret: + requestBody: + application/json: {"encrypted_value": ""} + responses: + "200": + application/json: {"id": ""} + "422": + application/json: {"detail": []} examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1ede046b..ab2a5441 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,20 +2,20 @@ speakeasyVersion: 1.552.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:7ceb514059ca48d6851ea7eacc84aa4177b0299d9fc01e71a891f6bc6244b089 - sourceBlobDigest: sha256:20af3cb02fd412795707dc692fcfdb11f412c27d8095ee4197ea318ea31c7bfe + sourceRevisionDigest: sha256:d14d57547ad78fb9de555d53df7316688897fcfde70597ebae236e093686ac64 + sourceBlobDigest: sha256:344e0d1a73221fe624794cb7c74290201da4093a73b6897fcbadea1d1cc99447 tags: - latest - - speakeasy-sdk-regen-1748459387 - - 1.1.17 + - speakeasy-sdk-regen-1749082267 + - 1.1.25 targets: unstructured-python: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:7ceb514059ca48d6851ea7eacc84aa4177b0299d9fc01e71a891f6bc6244b089 - sourceBlobDigest: sha256:20af3cb02fd412795707dc692fcfdb11f412c27d8095ee4197ea318ea31c7bfe + sourceRevisionDigest: sha256:d14d57547ad78fb9de555d53df7316688897fcfde70597ebae236e093686ac64 + sourceBlobDigest: sha256:344e0d1a73221fe624794cb7c74290201da4093a73b6897fcbadea1d1cc99447 codeSamplesNamespace: my-source-code-samples - codeSamplesRevisionDigest: sha256:8dd8b645e1112de59bfed16856623f891e44b10d8af11e4f48877b08541e246f + codeSamplesRevisionDigest: sha256:0d9d8872a992b8f4dc480ccfd3fe65d9966f22cfbc3e69668ab15922d75a6c4c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index d1f30248..0622c52a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1007,4 +1007,14 @@ Based on: ### Generated - [python v0.36.0] . ### Releases -- [PyPI v0.36.0] https://pypi.org/project/unstructured-client/0.36.0 - . \ No newline at end of file +- [PyPI v0.36.0] https://pypi.org/project/unstructured-client/0.36.0 - . + +## 2025-06-23 18:31:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.552.0 (2.610.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.37.1] . +### Releases +- [PyPI v0.37.1] https://pypi.org/project/unstructured-client/0.37.1 - . \ No newline at end of file diff --git a/_test_contract/platform_api/test_workflows.py b/_test_contract/platform_api/test_workflows.py index 5da3872b..86f93a7a 100644 --- a/_test_contract/platform_api/test_workflows.py +++ b/_test_contract/platform_api/test_workflows.py @@ -8,7 +8,7 @@ def test_list_workflows(httpx_mock, platform_client: UnstructuredClient, platform_api_url: str): - url = f"{platform_api_url}/api/v1/workflows/" + url = f"{platform_api_url}/api/v1/workflows/?sort_by=id" httpx_mock.add_response( method="GET", @@ -69,7 +69,7 @@ def test_list_workflows(httpx_mock, platform_client: UnstructuredClient, platfor def test_list_workflows_empty( httpx_mock, platform_client: UnstructuredClient, platform_api_url: str ): - url = f"{platform_api_url}/api/v1/workflows/" + url = f"{platform_api_url}/api/v1/workflows/?sort_by=id" httpx_mock.add_response( method="GET", @@ -100,7 +100,7 @@ def test_list_workflows_error( platform_api_url: str, error_status_code: int, ): - url = f"{platform_api_url}/api/v1/workflows/" + url = f"{platform_api_url}/api/v1/workflows/?sort_by=id" httpx_mock.add_response( method="GET", diff --git a/codeSamples.yaml b/codeSamples.yaml index f859f700..65769ea2 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -63,12 +63,24 @@ actions: - "lang": "python" "label": "cancel_job" "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.cancel_job(request={\n \"job_id\": \"2fafd129-04f3-4201-a0e7-fe33e937b367\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" + - target: $["paths"]["/api/v1/jobs/{job_id}/details"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "get_job_details" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.get_job_details(request={\n \"job_id\": \"14cc95f9-4174-46b3-81f5-7089b87a4787\",\n })\n\n assert res.job_details is not None\n\n # Handle response\n print(res.job_details)" - target: $["paths"]["/api/v1/jobs/{job_id}/download"]["get"] update: "x-codeSamples": - "lang": "python" "label": "download_job_output" "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.download_job_output(request={\n \"job_id\": \"06d1b7b8-8642-4793-b37e-e45d97d53bc3\",\n \"file_id\": \"\",\n \"node_id\": \"7c8f2aa4-da13-4a04-a98d-0204ea55681e\",\n })\n\n assert res.any is not None\n\n # Handle response\n print(res.any)" + - target: $["paths"]["/api/v1/jobs/{job_id}/failed-files"]["get"] + update: + "x-codeSamples": + - "lang": "python" + "label": "get_job_failed_files" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.jobs.get_job_failed_files(request={\n \"job_id\": \"ad262041-3530-40a9-9f83-b004e947a203\",\n })\n\n assert res.job_failed_files is not None\n\n # Handle response\n print(res.job_failed_files)" - target: $["paths"]["/api/v1/sources/"]["get"] update: "x-codeSamples": @@ -80,7 +92,7 @@ actions: "x-codeSamples": - "lang": "python" "label": "create_source" - "source": "from unstructured_client import UnstructuredClient\nfrom unstructured_client.models import shared\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.create_source(request={\n \"create_source_connector\": {\n \"name\": \"\",\n \"type\": shared.SourceConnectorType.DATABRICKS_VOLUMES,\n \"config\": {\n \"remote_url\": \"https://ugly-ribbon.info\",\n \"recursive\": True,\n },\n },\n })\n\n assert res.source_connector_information is not None\n\n # Handle response\n print(res.source_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.sources.create_source(request={\n \"create_source_connector\": {\n \"name\": \"\",\n \"type\": shared.SourceConnectorType.DROPBOX,\n \"config\": {\n \"remote_url\": \"https://ugly-ribbon.info\",\n \"recursive\": True,\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}"]["delete"] update: "x-codeSamples": @@ -111,6 +123,18 @@ actions: - "lang": "python" "label": "create_connection_check_sources" "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.sources.create_connection_check_sources(request={\n \"source_id\": \"8d49e3f2-3e6d-4973-bc61-292af66829d7\",\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/users/retrieve"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "retrieve" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.users.retrieve(request={})\n\n assert res.pem_auth_response is not None\n\n # Handle response\n print(res.pem_auth_response)" + - target: $["paths"]["/api/v1/users/secrets"]["post"] + update: + "x-codeSamples": + - "lang": "python" + "label": "store_secret" + "source": "from unstructured_client import UnstructuredClient\n\n\nwith UnstructuredClient() as uc_client:\n\n res = uc_client.users.store_secret(request={\n \"encrypted_secret\": {\n \"encrypted_value\": \"\",\n },\n })\n\n assert res.secret_reference is not None\n\n # Handle response\n print(res.secret_reference)" - target: $["paths"]["/api/v1/workflows/"]["get"] update: "x-codeSamples": diff --git a/docs/models/operations/getjobdetailsrequest.md b/docs/models/operations/getjobdetailsrequest.md new file mode 100644 index 00000000..af288566 --- /dev/null +++ b/docs/models/operations/getjobdetailsrequest.md @@ -0,0 +1,9 @@ +# GetJobDetailsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `job_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/getjobdetailsresponse.md b/docs/models/operations/getjobdetailsresponse.md new file mode 100644 index 00000000..b88c84ca --- /dev/null +++ b/docs/models/operations/getjobdetailsresponse.md @@ -0,0 +1,11 @@ +# GetJobDetailsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `job_details` | [Optional[shared.JobDetails]](../../models/shared/jobdetails.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/getjobfailedfilesrequest.md b/docs/models/operations/getjobfailedfilesrequest.md new file mode 100644 index 00000000..c88513c9 --- /dev/null +++ b/docs/models/operations/getjobfailedfilesrequest.md @@ -0,0 +1,9 @@ +# GetJobFailedFilesRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `job_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/getjobfailedfilesresponse.md b/docs/models/operations/getjobfailedfilesresponse.md new file mode 100644 index 00000000..7054afeb --- /dev/null +++ b/docs/models/operations/getjobfailedfilesresponse.md @@ -0,0 +1,11 @@ +# GetJobFailedFilesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `job_failed_files` | [Optional[shared.JobFailedFiles]](../../models/shared/jobfailedfiles.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/listworkflowsrequest.md b/docs/models/operations/listworkflowsrequest.md index 910c73e3..216b5b84 100644 --- a/docs/models/operations/listworkflowsrequest.md +++ b/docs/models/operations/listworkflowsrequest.md @@ -5,7 +5,17 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `created_before` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `created_since` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | N/A | +| `dag_node_configuration_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `destination_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `page` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `page_size` | *OptionalNullable[int]* | :heavy_minus_sign: | N/A | +| `show_only_soft_deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `show_recommender_workflows` | *OptionalNullable[bool]* | :heavy_minus_sign: | N/A | +| `sort_by` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `sort_direction` | [Optional[shared.SortDirection]](../../models/shared/sortdirection.md) | :heavy_minus_sign: | N/A | | `source_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | `status` | [OptionalNullable[shared.WorkflowState]](../../models/shared/workflowstate.md) | :heavy_minus_sign: | N/A | | `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/retrieverequest.md b/docs/models/operations/retrieverequest.md new file mode 100644 index 00000000..6f1a9c98 --- /dev/null +++ b/docs/models/operations/retrieverequest.md @@ -0,0 +1,8 @@ +# RetrieveRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `unstructured_api_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/retrieveresponse.md b/docs/models/operations/retrieveresponse.md new file mode 100644 index 00000000..df683b89 --- /dev/null +++ b/docs/models/operations/retrieveresponse.md @@ -0,0 +1,11 @@ +# RetrieveResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `pem_auth_response` | [Optional[shared.PemAuthResponse]](../../models/shared/pemauthresponse.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/storesecretrequest.md b/docs/models/operations/storesecretrequest.md new file mode 100644 index 00000000..51bfcdd1 --- /dev/null +++ b/docs/models/operations/storesecretrequest.md @@ -0,0 +1,9 @@ +# StoreSecretRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `encrypted_secret` | [shared.EncryptedSecret](../../models/shared/encryptedsecret.md) | :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/storesecretresponse.md b/docs/models/operations/storesecretresponse.md new file mode 100644 index 00000000..7c393ed4 --- /dev/null +++ b/docs/models/operations/storesecretresponse.md @@ -0,0 +1,11 @@ +# StoreSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | +| `secret_reference` | [Optional[shared.SecretReference]](../../models/shared/secretreference.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/encryptedsecret.md b/docs/models/shared/encryptedsecret.md new file mode 100644 index 00000000..9a2d74b8 --- /dev/null +++ b/docs/models/shared/encryptedsecret.md @@ -0,0 +1,11 @@ +# EncryptedSecret + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `aes_iv` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `encrypted_aes_key` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `encrypted_value` | *str* | :heavy_check_mark: | N/A | +| `type` | [Optional[shared.EncryptionType]](../../models/shared/encryptiontype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/encryptiontype.md b/docs/models/shared/encryptiontype.md new file mode 100644 index 00000000..a64fa308 --- /dev/null +++ b/docs/models/shared/encryptiontype.md @@ -0,0 +1,9 @@ +# EncryptionType + + +## Values + +| Name | Value | +| --------- | --------- | +| `RSA` | rsa | +| `RSA_AES` | rsa_aes | \ No newline at end of file diff --git a/docs/models/shared/failedfile.md b/docs/models/shared/failedfile.md new file mode 100644 index 00000000..29f35e3c --- /dev/null +++ b/docs/models/shared/failedfile.md @@ -0,0 +1,9 @@ +# FailedFile + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `document` | *str* | :heavy_check_mark: | N/A | +| `error` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/googledrivesourceconnectorconfig.md b/docs/models/shared/googledrivesourceconnectorconfig.md index ea2ca8f4..9902a5c7 100644 --- a/docs/models/shared/googledrivesourceconnectorconfig.md +++ b/docs/models/shared/googledrivesourceconnectorconfig.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| --------------------- | --------------------- | --------------------- | --------------------- | -| `drive_id` | *str* | :heavy_check_mark: | N/A | -| `extensions` | List[*str*] | :heavy_minus_sign: | N/A | -| `recursive` | *bool* | :heavy_check_mark: | N/A | -| `service_account_key` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `drive_id` | *str* | :heavy_check_mark: | N/A | +| `extensions` | List[*str*] | :heavy_minus_sign: | N/A | +| `recursive` | *bool* | :heavy_check_mark: | N/A | +| `service_account_key` | [shared.ServiceAccountKey](../../models/shared/serviceaccountkey.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/googledrivesourceconnectorconfiginput.md b/docs/models/shared/googledrivesourceconnectorconfiginput.md index 240ef437..ffa24d19 100644 --- a/docs/models/shared/googledrivesourceconnectorconfiginput.md +++ b/docs/models/shared/googledrivesourceconnectorconfiginput.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| --------------------- | --------------------- | --------------------- | --------------------- | -| `drive_id` | *str* | :heavy_check_mark: | N/A | -| `extensions` | List[*str*] | :heavy_minus_sign: | N/A | -| `recursive` | *Optional[bool]* | :heavy_minus_sign: | N/A | -| `service_account_key` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `drive_id` | *str* | :heavy_check_mark: | N/A | +| `extensions` | List[*str*] | :heavy_minus_sign: | N/A | +| `recursive` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `service_account_key` | [shared.GoogleDriveSourceConnectorConfigInputServiceAccountKey](../../models/shared/googledrivesourceconnectorconfiginputserviceaccountkey.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/googledrivesourceconnectorconfiginputserviceaccountkey.md b/docs/models/shared/googledrivesourceconnectorconfiginputserviceaccountkey.md new file mode 100644 index 00000000..5d199f9d --- /dev/null +++ b/docs/models/shared/googledrivesourceconnectorconfiginputserviceaccountkey.md @@ -0,0 +1,17 @@ +# GoogleDriveSourceConnectorConfigInputServiceAccountKey + + +## Supported Types + +### `shared.SecretReference` + +```python +value: shared.SecretReference = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/shared/jobdetails.md b/docs/models/shared/jobdetails.md new file mode 100644 index 00000000..232be238 --- /dev/null +++ b/docs/models/shared/jobdetails.md @@ -0,0 +1,11 @@ +# JobDetails + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | N/A | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `node_stats` | List[[shared.JobNodeDetails](../../models/shared/jobnodedetails.md)] | :heavy_check_mark: | N/A | +| `processing_status` | [shared.JobProcessingStatus](../../models/shared/jobprocessingstatus.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/jobfailedfiles.md b/docs/models/shared/jobfailedfiles.md new file mode 100644 index 00000000..41a91e2a --- /dev/null +++ b/docs/models/shared/jobfailedfiles.md @@ -0,0 +1,8 @@ +# JobFailedFiles + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `failed_files` | List[[shared.FailedFile](../../models/shared/failedfile.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/jobnodedetails.md b/docs/models/shared/jobnodedetails.md new file mode 100644 index 00000000..b20f0391 --- /dev/null +++ b/docs/models/shared/jobnodedetails.md @@ -0,0 +1,14 @@ +# JobNodeDetails + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `failure` | *int* | :heavy_check_mark: | N/A | +| `in_progress` | *int* | :heavy_check_mark: | N/A | +| `node_name` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `node_subtype` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `node_type` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `ready` | *int* | :heavy_check_mark: | N/A | +| `success` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/shared/jobprocessingstatus.md b/docs/models/shared/jobprocessingstatus.md new file mode 100644 index 00000000..0e666dff --- /dev/null +++ b/docs/models/shared/jobprocessingstatus.md @@ -0,0 +1,13 @@ +# JobProcessingStatus + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `SCHEDULED` | SCHEDULED | +| `IN_PROGRESS` | IN_PROGRESS | +| `SUCCESS` | SUCCESS | +| `COMPLETED_WITH_ERRORS` | COMPLETED_WITH_ERRORS | +| `STOPPED` | STOPPED | +| `FAILED` | FAILED | \ No newline at end of file diff --git a/docs/models/shared/pemauthresponse.md b/docs/models/shared/pemauthresponse.md new file mode 100644 index 00000000..1a3880ca --- /dev/null +++ b/docs/models/shared/pemauthresponse.md @@ -0,0 +1,12 @@ +# PemAuthResponse + +Response model for PEM key retrieval. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `pem_key` | *str* | :heavy_check_mark: | N/A | +| `tenant_id` | *str* | :heavy_check_mark: | N/A | +| `user_id` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/secretreference.md b/docs/models/shared/secretreference.md new file mode 100644 index 00000000..7578d872 --- /dev/null +++ b/docs/models/shared/secretreference.md @@ -0,0 +1,9 @@ +# SecretReference + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | N/A | +| `type` | [Optional[shared.EncryptionType]](../../models/shared/encryptiontype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/shared/serviceaccountkey.md b/docs/models/shared/serviceaccountkey.md new file mode 100644 index 00000000..4b9de139 --- /dev/null +++ b/docs/models/shared/serviceaccountkey.md @@ -0,0 +1,17 @@ +# ServiceAccountKey + + +## Supported Types + +### `shared.SecretReference` + +```python +value: shared.SecretReference = /* values here */ +``` + +### `str` + +```python +value: str = /* values here */ +``` + diff --git a/docs/models/shared/sortdirection.md b/docs/models/shared/sortdirection.md new file mode 100644 index 00000000..73bdef0b --- /dev/null +++ b/docs/models/shared/sortdirection.md @@ -0,0 +1,9 @@ +# SortDirection + + +## Values + +| Name | Value | +| ------ | ------ | +| `ASC` | asc | +| `DESC` | desc | \ No newline at end of file diff --git a/docs/models/shared/sourceconnectortype.md b/docs/models/shared/sourceconnectortype.md index 0dfaf5ce..059c0233 100644 --- a/docs/models/shared/sourceconnectortype.md +++ b/docs/models/shared/sourceconnectortype.md @@ -22,6 +22,7 @@ | `S3` | s3 | | `SALESFORCE` | salesforce | | `SHAREPOINT` | sharepoint | +| `SLACK` | slack | | `SNOWFLAKE` | snowflake | | `JIRA` | jira | | `ZENDESK` | zendesk | \ No newline at end of file diff --git a/docs/sdks/jobs/README.md b/docs/sdks/jobs/README.md index 273c6e06..6e70bec4 100644 --- a/docs/sdks/jobs/README.md +++ b/docs/sdks/jobs/README.md @@ -8,6 +8,8 @@ * [cancel_job](#cancel_job) - Cancel Job * [download_job_output](#download_job_output) - Download Job output * [get_job](#get_job) - Get Job +* [get_job_details](#get_job_details) - Get Job processing details +* [get_job_failed_files](#get_job_failed_files) - Get Job Failed Files * [list_jobs](#list_jobs) - List Jobs ## cancel_job @@ -138,6 +140,90 @@ with UnstructuredClient() as uc_client: | errors.HTTPValidationError | 422 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_job_details + +Retrieve processing details for a specific job by its ID. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.jobs.get_job_details(request={ + "job_id": "14cc95f9-4174-46b3-81f5-7089b87a4787", + }) + + assert res.job_details is not None + + # Handle response + print(res.job_details) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.GetJobDetailsRequest](../../models/operations/getjobdetailsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | + +### Response + +**[operations.GetJobDetailsResponse](../../models/operations/getjobdetailsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_job_failed_files + +Retrieve failed files for a specific job by its ID. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.jobs.get_job_failed_files(request={ + "job_id": "ad262041-3530-40a9-9f83-b004e947a203", + }) + + assert res.job_failed_files is not None + + # Handle response + print(res.job_failed_files) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.GetJobFailedFilesRequest](../../models/operations/getjobfailedfilesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | + +### Response + +**[operations.GetJobFailedFilesResponse](../../models/operations/getjobfailedfilesresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## list_jobs Retrieve a list of jobs with optional filtering by workflow ID or job status. diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md new file mode 100644 index 00000000..3c761ced --- /dev/null +++ b/docs/sdks/users/README.md @@ -0,0 +1,93 @@ +# Users +(*users*) + +## Overview + +### Available Operations + +* [retrieve](#retrieve) - Retrieve PEM Key +* [store_secret](#store_secret) - Store an encrypted secret + +## retrieve + +Given a UNSTRUCTURED_API_KEY in the post-payload, retrieve the associated PEM key + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.users.retrieve(request={}) + + assert res.pem_auth_response is not None + + # Handle response + print(res.pem_auth_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `request` | [operations.RetrieveRequest](../../models/operations/retrieverequest.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.RetrieveResponse](../../models/operations/retrieveresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## store_secret + +After encrypting a secret locally, store it and get back a reference id. + +### Example Usage + +```python +from unstructured_client import UnstructuredClient + + +with UnstructuredClient() as uc_client: + + res = uc_client.users.store_secret(request={ + "encrypted_secret": { + "encrypted_value": "", + }, + }) + + assert res.secret_reference is not None + + # Handle response + print(res.secret_reference) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `request` | [operations.StoreSecretRequest](../../models/operations/storesecretrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| `server_url` | *Optional[str]* | :heavy_minus_sign: | An optional server URL to use. | + +### Response + +**[operations.StoreSecretResponse](../../models/operations/storesecretresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPValidationError | 422 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index d52f0207..9ed3f98d 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -144,7 +144,7 @@ with UnstructuredClient() as uc_client: ## list_workflows -Retrieve a list of workflows, optionally filtered by source, destination, or state. +Retrieve a list of workflows, optionally filtered by source, destination, state, name, date range, and supports pagination and sorting. ### Example Usage diff --git a/gen.yaml b/gen.yaml index ac36d670..b8358b1e 100644 --- a/gen.yaml +++ b/gen.yaml @@ -3,6 +3,7 @@ generation: sdkClassName: unstructured_client usageSnippets: optionalPropertyRendering: withExample + sdkInitStyle: constructor fixes: nameResolutionFeb2025: false parameterOrderingFeb2024: false @@ -13,7 +14,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false python: - version: 0.36.0 + version: 0.37.1 additionalDependencies: dev: deepdiff: '>=6.0' @@ -34,6 +35,7 @@ python: requests-toolbelt: '>=1.0.0' authors: - Unstructured + baseErrorName: UnstructuredClientError clientServerStatusCodesAsErrors: true defaultErrorName: SDKError description: Python Client SDK for Unstructured API diff --git a/poetry.lock b/poetry.lock index 2769ae75..feb5b16d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -416,31 +416,31 @@ python-dateutil = ">=2.7" [[package]] name = "h11" -version = "0.14.0" +version = "0.16.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" groups = ["main", "dev"] files = [ - {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, - {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, + {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"}, + {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"}, ] [[package]] name = "httpcore" -version = "1.0.6" +version = "1.0.9" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" groups = ["main", "dev"] files = [ - {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, - {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, + {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"}, + {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"}, ] [package.dependencies] certifi = "*" -h11 = ">=0.13,<0.15" +h11 = ">=0.16" [package.extras] asyncio = ["anyio (>=4.0,<5.0)"] diff --git a/pyproject.toml b/pyproject.toml index 2a392b75..55d2172f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "unstructured-client" -version = "0.36.0" +version = "0.37.1" 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 79326603..caacf37c 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.36.0" -__openapi_doc_version__: str = "1.1.17" +__version__: str = "0.37.1" +__openapi_doc_version__: str = "1.1.25" __gen_version__: str = "2.610.0" -__user_agent__: str = "speakeasy-sdk/python 0.36.0 2.610.0 1.1.17 unstructured-client" +__user_agent__: str = "speakeasy-sdk/python 0.37.1 2.610.0 1.1.25 unstructured-client" try: if __package__ is not None: diff --git a/src/unstructured_client/models/operations/__init__.py b/src/unstructured_client/models/operations/__init__.py index b91a82ff..b00712ba 100644 --- a/src/unstructured_client/models/operations/__init__.py +++ b/src/unstructured_client/models/operations/__init__.py @@ -116,6 +116,22 @@ GetJobResponse, GetJobResponseTypedDict, ) + from .get_job_details import ( + GET_JOB_DETAILS_SERVERS, + GET_JOB_DETAILS_SERVER_PLATFORM_API, + GetJobDetailsRequest, + GetJobDetailsRequestTypedDict, + GetJobDetailsResponse, + GetJobDetailsResponseTypedDict, + ) + from .get_job_failed_files import ( + GET_JOB_FAILED_FILES_SERVERS, + GET_JOB_FAILED_FILES_SERVER_PLATFORM_API, + GetJobFailedFilesRequest, + GetJobFailedFilesRequestTypedDict, + GetJobFailedFilesResponse, + GetJobFailedFilesResponseTypedDict, + ) from .get_source import ( GET_SOURCE_SERVERS, GET_SOURCE_SERVER_PLATFORM_API, @@ -173,6 +189,14 @@ PartitionResponse, PartitionResponseTypedDict, ) + from .retrieve import ( + RETRIEVE_SERVERS, + RETRIEVE_SERVER_PLATFORM_API, + RetrieveRequest, + RetrieveRequestTypedDict, + RetrieveResponse, + RetrieveResponseTypedDict, + ) from .run_workflow import ( RUN_WORKFLOW_SERVERS, RUN_WORKFLOW_SERVER_PLATFORM_API, @@ -181,6 +205,14 @@ RunWorkflowResponse, RunWorkflowResponseTypedDict, ) + from .store_secret import ( + STORE_SECRET_SERVERS, + STORE_SECRET_SERVER_PLATFORM_API, + StoreSecretRequest, + StoreSecretRequestTypedDict, + StoreSecretResponse, + StoreSecretResponseTypedDict, + ) from .update_destination import ( UPDATE_DESTINATION_SERVERS, UPDATE_DESTINATION_SERVER_PLATFORM_API, @@ -273,6 +305,10 @@ "GET_CONNECTION_CHECK_SOURCES_SERVER_PLATFORM_API", "GET_DESTINATION_SERVERS", "GET_DESTINATION_SERVER_PLATFORM_API", + "GET_JOB_DETAILS_SERVERS", + "GET_JOB_DETAILS_SERVER_PLATFORM_API", + "GET_JOB_FAILED_FILES_SERVERS", + "GET_JOB_FAILED_FILES_SERVER_PLATFORM_API", "GET_JOB_SERVERS", "GET_JOB_SERVER_PLATFORM_API", "GET_SOURCE_SERVERS", @@ -291,6 +327,14 @@ "GetDestinationRequestTypedDict", "GetDestinationResponse", "GetDestinationResponseTypedDict", + "GetJobDetailsRequest", + "GetJobDetailsRequestTypedDict", + "GetJobDetailsResponse", + "GetJobDetailsResponseTypedDict", + "GetJobFailedFilesRequest", + "GetJobFailedFilesRequestTypedDict", + "GetJobFailedFilesResponse", + "GetJobFailedFilesResponseTypedDict", "GetJobRequest", "GetJobRequestTypedDict", "GetJobResponse", @@ -334,12 +378,24 @@ "PartitionRequestTypedDict", "PartitionResponse", "PartitionResponseTypedDict", + "RETRIEVE_SERVERS", + "RETRIEVE_SERVER_PLATFORM_API", "RUN_WORKFLOW_SERVERS", "RUN_WORKFLOW_SERVER_PLATFORM_API", + "RetrieveRequest", + "RetrieveRequestTypedDict", + "RetrieveResponse", + "RetrieveResponseTypedDict", "RunWorkflowRequest", "RunWorkflowRequestTypedDict", "RunWorkflowResponse", "RunWorkflowResponseTypedDict", + "STORE_SECRET_SERVERS", + "STORE_SECRET_SERVER_PLATFORM_API", + "StoreSecretRequest", + "StoreSecretRequestTypedDict", + "StoreSecretResponse", + "StoreSecretResponseTypedDict", "UPDATE_DESTINATION_SERVERS", "UPDATE_DESTINATION_SERVER_PLATFORM_API", "UPDATE_SOURCE_SERVERS", @@ -445,6 +501,18 @@ "GetJobRequestTypedDict": ".get_job", "GetJobResponse": ".get_job", "GetJobResponseTypedDict": ".get_job", + "GET_JOB_DETAILS_SERVERS": ".get_job_details", + "GET_JOB_DETAILS_SERVER_PLATFORM_API": ".get_job_details", + "GetJobDetailsRequest": ".get_job_details", + "GetJobDetailsRequestTypedDict": ".get_job_details", + "GetJobDetailsResponse": ".get_job_details", + "GetJobDetailsResponseTypedDict": ".get_job_details", + "GET_JOB_FAILED_FILES_SERVERS": ".get_job_failed_files", + "GET_JOB_FAILED_FILES_SERVER_PLATFORM_API": ".get_job_failed_files", + "GetJobFailedFilesRequest": ".get_job_failed_files", + "GetJobFailedFilesRequestTypedDict": ".get_job_failed_files", + "GetJobFailedFilesResponse": ".get_job_failed_files", + "GetJobFailedFilesResponseTypedDict": ".get_job_failed_files", "GET_SOURCE_SERVERS": ".get_source", "GET_SOURCE_SERVER_PLATFORM_API": ".get_source", "GetSourceRequest": ".get_source", @@ -488,12 +556,24 @@ "PartitionRequestTypedDict": ".partition", "PartitionResponse": ".partition", "PartitionResponseTypedDict": ".partition", + "RETRIEVE_SERVERS": ".retrieve", + "RETRIEVE_SERVER_PLATFORM_API": ".retrieve", + "RetrieveRequest": ".retrieve", + "RetrieveRequestTypedDict": ".retrieve", + "RetrieveResponse": ".retrieve", + "RetrieveResponseTypedDict": ".retrieve", "RUN_WORKFLOW_SERVERS": ".run_workflow", "RUN_WORKFLOW_SERVER_PLATFORM_API": ".run_workflow", "RunWorkflowRequest": ".run_workflow", "RunWorkflowRequestTypedDict": ".run_workflow", "RunWorkflowResponse": ".run_workflow", "RunWorkflowResponseTypedDict": ".run_workflow", + "STORE_SECRET_SERVERS": ".store_secret", + "STORE_SECRET_SERVER_PLATFORM_API": ".store_secret", + "StoreSecretRequest": ".store_secret", + "StoreSecretRequestTypedDict": ".store_secret", + "StoreSecretResponse": ".store_secret", + "StoreSecretResponseTypedDict": ".store_secret", "UPDATE_DESTINATION_SERVERS": ".update_destination", "UPDATE_DESTINATION_SERVER_PLATFORM_API": ".update_destination", "UpdateDestinationRequest": ".update_destination", diff --git a/src/unstructured_client/models/operations/get_job_details.py b/src/unstructured_client/models/operations/get_job_details.py new file mode 100644 index 00000000..d19f1dd5 --- /dev/null +++ b/src/unstructured_client/models/operations/get_job_details.py @@ -0,0 +1,96 @@ +"""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 jobdetails as shared_jobdetails +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata + +GET_JOB_DETAILS_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +GET_JOB_DETAILS_SERVERS = { + GET_JOB_DETAILS_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class GetJobDetailsRequestTypedDict(TypedDict): + job_id: str + unstructured_api_key: NotRequired[Nullable[str]] + + +class GetJobDetailsRequest(BaseModel): + job_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 GetJobDetailsResponseTypedDict(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""" + job_details: NotRequired[shared_jobdetails.JobDetailsTypedDict] + r"""Successful Response""" + + +class GetJobDetailsResponse(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""" + + job_details: Optional[shared_jobdetails.JobDetails] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/get_job_failed_files.py b/src/unstructured_client/models/operations/get_job_failed_files.py new file mode 100644 index 00000000..798148d6 --- /dev/null +++ b/src/unstructured_client/models/operations/get_job_failed_files.py @@ -0,0 +1,96 @@ +"""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 jobfailedfiles as shared_jobfailedfiles +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, PathParamMetadata + +GET_JOB_FAILED_FILES_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +GET_JOB_FAILED_FILES_SERVERS = { + GET_JOB_FAILED_FILES_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class GetJobFailedFilesRequestTypedDict(TypedDict): + job_id: str + unstructured_api_key: NotRequired[Nullable[str]] + + +class GetJobFailedFilesRequest(BaseModel): + job_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 GetJobFailedFilesResponseTypedDict(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""" + job_failed_files: NotRequired[shared_jobfailedfiles.JobFailedFilesTypedDict] + r"""Successful Response""" + + +class GetJobFailedFilesResponse(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""" + + job_failed_files: Optional[shared_jobfailedfiles.JobFailedFiles] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/list_workflows.py b/src/unstructured_client/models/operations/list_workflows.py index 8c8975f3..8f08c85f 100644 --- a/src/unstructured_client/models/operations/list_workflows.py +++ b/src/unstructured_client/models/operations/list_workflows.py @@ -1,12 +1,14 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from datetime import datetime import httpx import pydantic from pydantic import model_serializer from typing import List, Optional from typing_extensions import Annotated, NotRequired, TypedDict from unstructured_client.models.shared import ( + sortdirection as shared_sortdirection, workflowinformation as shared_workflowinformation, workflowstate as shared_workflowstate, ) @@ -28,18 +30,78 @@ class ListWorkflowsRequestTypedDict(TypedDict): + created_before: NotRequired[Nullable[datetime]] + created_since: NotRequired[Nullable[datetime]] + dag_node_configuration_id: NotRequired[Nullable[str]] destination_id: NotRequired[Nullable[str]] + name: NotRequired[Nullable[str]] + page: NotRequired[Nullable[int]] + page_size: NotRequired[Nullable[int]] + show_only_soft_deleted: NotRequired[Nullable[bool]] + show_recommender_workflows: NotRequired[Nullable[bool]] + sort_by: NotRequired[str] + sort_direction: NotRequired[shared_sortdirection.SortDirection] source_id: NotRequired[Nullable[str]] status: NotRequired[Nullable[shared_workflowstate.WorkflowState]] unstructured_api_key: NotRequired[Nullable[str]] class ListWorkflowsRequest(BaseModel): + created_before: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + created_since: Annotated[ + OptionalNullable[datetime], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + dag_node_configuration_id: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + destination_id: Annotated[ OptionalNullable[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), ] = UNSET + name: Annotated[ + OptionalNullable[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + page: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + page_size: Annotated[ + OptionalNullable[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + show_only_soft_deleted: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + show_recommender_workflows: Annotated[ + OptionalNullable[bool], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = UNSET + + sort_by: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = "id" + + sort_direction: Annotated[ + Optional[shared_sortdirection.SortDirection], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + source_id: Annotated[ OptionalNullable[str], FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), @@ -59,13 +121,31 @@ class ListWorkflowsRequest(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ + "created_before", + "created_since", + "dag_node_configuration_id", "destination_id", + "name", + "page", + "page_size", + "show_only_soft_deleted", + "show_recommender_workflows", + "sort_by", + "sort_direction", "source_id", "status", "unstructured-api-key", ] nullable_fields = [ + "created_before", + "created_since", + "dag_node_configuration_id", "destination_id", + "name", + "page", + "page_size", + "show_only_soft_deleted", + "show_recommender_workflows", "source_id", "status", "unstructured-api-key", diff --git a/src/unstructured_client/models/operations/retrieve.py b/src/unstructured_client/models/operations/retrieve.py new file mode 100644 index 00000000..839e2afa --- /dev/null +++ b/src/unstructured_client/models/operations/retrieve.py @@ -0,0 +1,91 @@ +"""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 pemauthresponse as shared_pemauthresponse +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata + +RETRIEVE_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +RETRIEVE_SERVERS = { + RETRIEVE_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class RetrieveRequestTypedDict(TypedDict): + unstructured_api_key: NotRequired[Nullable[str]] + + +class RetrieveRequest(BaseModel): + 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 RetrieveResponseTypedDict(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""" + pem_auth_response: NotRequired[shared_pemauthresponse.PemAuthResponseTypedDict] + r"""Successful Response""" + + +class RetrieveResponse(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""" + + pem_auth_response: Optional[shared_pemauthresponse.PemAuthResponse] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/operations/store_secret.py b/src/unstructured_client/models/operations/store_secret.py new file mode 100644 index 00000000..c147a67e --- /dev/null +++ b/src/unstructured_client/models/operations/store_secret.py @@ -0,0 +1,100 @@ +"""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 ( + encryptedsecret as shared_encryptedsecret, + secretreference as shared_secretreference, +) +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from unstructured_client.utils import FieldMetadata, HeaderMetadata, RequestMetadata + +STORE_SECRET_SERVER_PLATFORM_API = "platform-api" +r"""Unstructured Platform API""" + +STORE_SECRET_SERVERS = { + STORE_SECRET_SERVER_PLATFORM_API: "https://platform.unstructuredapp.io/", +} + + +class StoreSecretRequestTypedDict(TypedDict): + encrypted_secret: shared_encryptedsecret.EncryptedSecretTypedDict + unstructured_api_key: NotRequired[Nullable[str]] + + +class StoreSecretRequest(BaseModel): + encrypted_secret: Annotated[ + shared_encryptedsecret.EncryptedSecret, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + 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 StoreSecretResponseTypedDict(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""" + secret_reference: NotRequired[shared_secretreference.SecretReferenceTypedDict] + r"""Successful Response""" + + +class StoreSecretResponse(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""" + + secret_reference: Optional[shared_secretreference.SecretReference] = None + r"""Successful Response""" diff --git a/src/unstructured_client/models/shared/__init__.py b/src/unstructured_client/models/shared/__init__.py index 500a6edf..4805dd8d 100644 --- a/src/unstructured_client/models/shared/__init__.py +++ b/src/unstructured_client/models/shared/__init__.py @@ -132,6 +132,9 @@ ElasticsearchConnectorConfigInput, ElasticsearchConnectorConfigInputTypedDict, ) + from .encryptedsecret import EncryptedSecret, EncryptedSecretTypedDict + from .encryptiontype import EncryptionType + from .failedfile import FailedFile, FailedFileTypedDict from .gcsdestinationconnectorconfig import ( GCSDestinationConnectorConfig, GCSDestinationConnectorConfigTypedDict, @@ -151,9 +154,13 @@ from .googledrivesourceconnectorconfig import ( GoogleDriveSourceConnectorConfig, GoogleDriveSourceConnectorConfigTypedDict, + ServiceAccountKey, + ServiceAccountKeyTypedDict, ) from .googledrivesourceconnectorconfiginput import ( GoogleDriveSourceConnectorConfigInput, + GoogleDriveSourceConnectorConfigInputServiceAccountKey, + GoogleDriveSourceConnectorConfigInputServiceAccountKeyTypedDict, GoogleDriveSourceConnectorConfigInputTypedDict, ) from .ibmwatsonxs3destinationconnectorconfig import ( @@ -172,7 +179,11 @@ JiraSourceConnectorConfigInput, JiraSourceConnectorConfigInputTypedDict, ) + from .jobdetails import JobDetails, JobDetailsTypedDict + from .jobfailedfiles import JobFailedFiles, JobFailedFilesTypedDict from .jobinformation import JobInformation, JobInformationTypedDict + from .jobnodedetails import JobNodeDetails, JobNodeDetailsTypedDict + from .jobprocessingstatus import JobProcessingStatus from .jobstatus import JobStatus from .kafkaclouddestinationconnectorconfig import ( KafkaCloudDestinationConnectorConfig, @@ -249,6 +260,7 @@ VLMModel, VLMModelProvider, ) + from .pemauthresponse import PemAuthResponse, PemAuthResponseTypedDict from .pineconedestinationconnectorconfig import ( PineconeDestinationConnectorConfig, PineconeDestinationConnectorConfigTypedDict, @@ -313,6 +325,7 @@ SalesforceSourceConnectorConfigInput, SalesforceSourceConnectorConfigInputTypedDict, ) + from .secretreference import SecretReference, SecretReferenceTypedDict from .security import Security, SecurityTypedDict from .sharepointsourceconnectorconfig import ( SharePointSourceConnectorConfig, @@ -338,6 +351,7 @@ SnowflakeSourceConnectorConfigInput, SnowflakeSourceConnectorConfigInputTypedDict, ) + from .sortdirection import SortDirection from .sourceconnectorinformation import ( SourceConnectorInformation, SourceConnectorInformationConfig, @@ -462,6 +476,11 @@ "ElasticsearchConnectorConfigInput", "ElasticsearchConnectorConfigInputTypedDict", "ElasticsearchConnectorConfigTypedDict", + "EncryptedSecret", + "EncryptedSecretTypedDict", + "EncryptionType", + "FailedFile", + "FailedFileTypedDict", "Files", "FilesTypedDict", "GCSDestinationConnectorConfig", @@ -474,6 +493,8 @@ "GCSSourceConnectorConfigTypedDict", "GoogleDriveSourceConnectorConfig", "GoogleDriveSourceConnectorConfigInput", + "GoogleDriveSourceConnectorConfigInputServiceAccountKey", + "GoogleDriveSourceConnectorConfigInputServiceAccountKeyTypedDict", "GoogleDriveSourceConnectorConfigInputTypedDict", "GoogleDriveSourceConnectorConfigTypedDict", "IBMWatsonxS3DestinationConnectorConfig", @@ -486,8 +507,15 @@ "JiraSourceConnectorConfigInput", "JiraSourceConnectorConfigInputTypedDict", "JiraSourceConnectorConfigTypedDict", + "JobDetails", + "JobDetailsTypedDict", + "JobFailedFiles", + "JobFailedFilesTypedDict", "JobInformation", "JobInformationTypedDict", + "JobNodeDetails", + "JobNodeDetailsTypedDict", + "JobProcessingStatus", "JobStatus", "KafkaCloudDestinationConnectorConfig", "KafkaCloudDestinationConnectorConfigInput", @@ -528,6 +556,8 @@ "OutputFormat", "PartitionParameters", "PartitionParametersTypedDict", + "PemAuthResponse", + "PemAuthResponseTypedDict", "PineconeDestinationConnectorConfig", "PineconeDestinationConnectorConfigInput", "PineconeDestinationConnectorConfigInputTypedDict", @@ -561,8 +591,12 @@ "SalesforceSourceConnectorConfigInputTypedDict", "SalesforceSourceConnectorConfigTypedDict", "Schedule", + "SecretReference", + "SecretReferenceTypedDict", "Security", "SecurityTypedDict", + "ServiceAccountKey", + "ServiceAccountKeyTypedDict", "SharePointSourceConnectorConfig", "SharePointSourceConnectorConfigInput", "SharePointSourceConnectorConfigInputTypedDict", @@ -575,6 +609,7 @@ "SnowflakeSourceConnectorConfigInput", "SnowflakeSourceConnectorConfigInputTypedDict", "SnowflakeSourceConnectorConfigTypedDict", + "SortDirection", "SourceConnectorInformation", "SourceConnectorInformationConfig", "SourceConnectorInformationConfigTypedDict", @@ -689,6 +724,11 @@ "ElasticsearchConnectorConfigTypedDict": ".elasticsearchconnectorconfig", "ElasticsearchConnectorConfigInput": ".elasticsearchconnectorconfiginput", "ElasticsearchConnectorConfigInputTypedDict": ".elasticsearchconnectorconfiginput", + "EncryptedSecret": ".encryptedsecret", + "EncryptedSecretTypedDict": ".encryptedsecret", + "EncryptionType": ".encryptiontype", + "FailedFile": ".failedfile", + "FailedFileTypedDict": ".failedfile", "GCSDestinationConnectorConfig": ".gcsdestinationconnectorconfig", "GCSDestinationConnectorConfigTypedDict": ".gcsdestinationconnectorconfig", "GCSDestinationConnectorConfigInput": ".gcsdestinationconnectorconfiginput", @@ -699,7 +739,11 @@ "GCSSourceConnectorConfigInputTypedDict": ".gcssourceconnectorconfiginput", "GoogleDriveSourceConnectorConfig": ".googledrivesourceconnectorconfig", "GoogleDriveSourceConnectorConfigTypedDict": ".googledrivesourceconnectorconfig", + "ServiceAccountKey": ".googledrivesourceconnectorconfig", + "ServiceAccountKeyTypedDict": ".googledrivesourceconnectorconfig", "GoogleDriveSourceConnectorConfigInput": ".googledrivesourceconnectorconfiginput", + "GoogleDriveSourceConnectorConfigInputServiceAccountKey": ".googledrivesourceconnectorconfiginput", + "GoogleDriveSourceConnectorConfigInputServiceAccountKeyTypedDict": ".googledrivesourceconnectorconfiginput", "GoogleDriveSourceConnectorConfigInputTypedDict": ".googledrivesourceconnectorconfiginput", "IBMWatsonxS3DestinationConnectorConfig": ".ibmwatsonxs3destinationconnectorconfig", "IBMWatsonxS3DestinationConnectorConfigTypedDict": ".ibmwatsonxs3destinationconnectorconfig", @@ -709,8 +753,15 @@ "JiraSourceConnectorConfigTypedDict": ".jirasourceconnectorconfig", "JiraSourceConnectorConfigInput": ".jirasourceconnectorconfiginput", "JiraSourceConnectorConfigInputTypedDict": ".jirasourceconnectorconfiginput", + "JobDetails": ".jobdetails", + "JobDetailsTypedDict": ".jobdetails", + "JobFailedFiles": ".jobfailedfiles", + "JobFailedFilesTypedDict": ".jobfailedfiles", "JobInformation": ".jobinformation", "JobInformationTypedDict": ".jobinformation", + "JobNodeDetails": ".jobnodedetails", + "JobNodeDetailsTypedDict": ".jobnodedetails", + "JobProcessingStatus": ".jobprocessingstatus", "JobStatus": ".jobstatus", "KafkaCloudDestinationConnectorConfig": ".kafkaclouddestinationconnectorconfig", "KafkaCloudDestinationConnectorConfigTypedDict": ".kafkaclouddestinationconnectorconfig", @@ -754,6 +805,8 @@ "Strategy": ".partition_parameters", "VLMModel": ".partition_parameters", "VLMModelProvider": ".partition_parameters", + "PemAuthResponse": ".pemauthresponse", + "PemAuthResponseTypedDict": ".pemauthresponse", "PineconeDestinationConnectorConfig": ".pineconedestinationconnectorconfig", "PineconeDestinationConnectorConfigTypedDict": ".pineconedestinationconnectorconfig", "PineconeDestinationConnectorConfigInput": ".pineconedestinationconnectorconfiginput", @@ -786,6 +839,8 @@ "SalesforceSourceConnectorConfigTypedDict": ".salesforcesourceconnectorconfig", "SalesforceSourceConnectorConfigInput": ".salesforcesourceconnectorconfiginput", "SalesforceSourceConnectorConfigInputTypedDict": ".salesforcesourceconnectorconfiginput", + "SecretReference": ".secretreference", + "SecretReferenceTypedDict": ".secretreference", "Security": ".security", "SecurityTypedDict": ".security", "SharePointSourceConnectorConfig": ".sharepointsourceconnectorconfig", @@ -800,6 +855,7 @@ "SnowflakeSourceConnectorConfigTypedDict": ".snowflakesourceconnectorconfig", "SnowflakeSourceConnectorConfigInput": ".snowflakesourceconnectorconfiginput", "SnowflakeSourceConnectorConfigInputTypedDict": ".snowflakesourceconnectorconfiginput", + "SortDirection": ".sortdirection", "SourceConnectorInformation": ".sourceconnectorinformation", "SourceConnectorInformationConfig": ".sourceconnectorinformation", "SourceConnectorInformationConfigTypedDict": ".sourceconnectorinformation", diff --git a/src/unstructured_client/models/shared/encryptedsecret.py b/src/unstructured_client/models/shared/encryptedsecret.py new file mode 100644 index 00000000..faee5bb0 --- /dev/null +++ b/src/unstructured_client/models/shared/encryptedsecret.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .encryptiontype import EncryptionType +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) + + +class EncryptedSecretTypedDict(TypedDict): + encrypted_value: str + aes_iv: NotRequired[Nullable[str]] + encrypted_aes_key: NotRequired[Nullable[str]] + type: NotRequired[EncryptionType] + + +class EncryptedSecret(BaseModel): + encrypted_value: str + + aes_iv: OptionalNullable[str] = UNSET + + encrypted_aes_key: OptionalNullable[str] = UNSET + + type: Optional[EncryptionType] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["aes_iv", "encrypted_aes_key", "type"] + nullable_fields = ["aes_iv", "encrypted_aes_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 diff --git a/src/unstructured_client/models/shared/encryptiontype.py b/src/unstructured_client/models/shared/encryptiontype.py new file mode 100644 index 00000000..a9c8d2e8 --- /dev/null +++ b/src/unstructured_client/models/shared/encryptiontype.py @@ -0,0 +1,9 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class EncryptionType(str, Enum): + RSA = "rsa" + RSA_AES = "rsa_aes" diff --git a/src/unstructured_client/models/shared/failedfile.py b/src/unstructured_client/models/shared/failedfile.py new file mode 100644 index 00000000..9dc8b43b --- /dev/null +++ b/src/unstructured_client/models/shared/failedfile.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from typing_extensions import TypedDict +from unstructured_client.types import BaseModel + + +class FailedFileTypedDict(TypedDict): + document: str + error: str + + +class FailedFile(BaseModel): + document: str + + error: str diff --git a/src/unstructured_client/models/shared/googledrivesourceconnectorconfig.py b/src/unstructured_client/models/shared/googledrivesourceconnectorconfig.py index b8ab1385..60837311 100644 --- a/src/unstructured_client/models/shared/googledrivesourceconnectorconfig.py +++ b/src/unstructured_client/models/shared/googledrivesourceconnectorconfig.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .secretreference import SecretReference, SecretReferenceTypedDict from pydantic import model_serializer -from typing import List -from typing_extensions import NotRequired, TypedDict +from typing import List, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict from unstructured_client.types import ( BaseModel, Nullable, @@ -13,10 +14,18 @@ ) +ServiceAccountKeyTypedDict = TypeAliasType( + "ServiceAccountKeyTypedDict", Union[SecretReferenceTypedDict, str] +) + + +ServiceAccountKey = TypeAliasType("ServiceAccountKey", Union[SecretReference, str]) + + class GoogleDriveSourceConnectorConfigTypedDict(TypedDict): drive_id: str recursive: bool - service_account_key: str + service_account_key: ServiceAccountKeyTypedDict extensions: NotRequired[Nullable[List[str]]] @@ -25,7 +34,7 @@ class GoogleDriveSourceConnectorConfig(BaseModel): recursive: bool - service_account_key: str + service_account_key: ServiceAccountKey extensions: OptionalNullable[List[str]] = UNSET diff --git a/src/unstructured_client/models/shared/googledrivesourceconnectorconfiginput.py b/src/unstructured_client/models/shared/googledrivesourceconnectorconfiginput.py index 3d5c27dd..b865eac2 100644 --- a/src/unstructured_client/models/shared/googledrivesourceconnectorconfiginput.py +++ b/src/unstructured_client/models/shared/googledrivesourceconnectorconfiginput.py @@ -1,9 +1,10 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .secretreference import SecretReference, SecretReferenceTypedDict from pydantic import model_serializer -from typing import List, Optional -from typing_extensions import NotRequired, TypedDict +from typing import List, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict from unstructured_client.types import ( BaseModel, Nullable, @@ -13,9 +14,21 @@ ) +GoogleDriveSourceConnectorConfigInputServiceAccountKeyTypedDict = TypeAliasType( + "GoogleDriveSourceConnectorConfigInputServiceAccountKeyTypedDict", + Union[SecretReferenceTypedDict, str], +) + + +GoogleDriveSourceConnectorConfigInputServiceAccountKey = TypeAliasType( + "GoogleDriveSourceConnectorConfigInputServiceAccountKey", + Union[SecretReference, str], +) + + class GoogleDriveSourceConnectorConfigInputTypedDict(TypedDict): drive_id: str - service_account_key: str + service_account_key: GoogleDriveSourceConnectorConfigInputServiceAccountKeyTypedDict extensions: NotRequired[Nullable[List[str]]] recursive: NotRequired[bool] @@ -23,7 +36,7 @@ class GoogleDriveSourceConnectorConfigInputTypedDict(TypedDict): class GoogleDriveSourceConnectorConfigInput(BaseModel): drive_id: str - service_account_key: str + service_account_key: GoogleDriveSourceConnectorConfigInputServiceAccountKey extensions: OptionalNullable[List[str]] = UNSET diff --git a/src/unstructured_client/models/shared/jobdetails.py b/src/unstructured_client/models/shared/jobdetails.py new file mode 100644 index 00000000..6997b12a --- /dev/null +++ b/src/unstructured_client/models/shared/jobdetails.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .jobnodedetails import JobNodeDetails, JobNodeDetailsTypedDict +from .jobprocessingstatus import JobProcessingStatus +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) + + +class JobDetailsTypedDict(TypedDict): + id: str + node_stats: List[JobNodeDetailsTypedDict] + processing_status: JobProcessingStatus + message: NotRequired[Nullable[str]] + + +class JobDetails(BaseModel): + id: str + + node_stats: List[JobNodeDetails] + + processing_status: JobProcessingStatus + + message: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["message"] + nullable_fields = ["message"] + 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/jobfailedfiles.py b/src/unstructured_client/models/shared/jobfailedfiles.py new file mode 100644 index 00000000..57e6f31c --- /dev/null +++ b/src/unstructured_client/models/shared/jobfailedfiles.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .failedfile import FailedFile, FailedFileTypedDict +from typing import List +from typing_extensions import TypedDict +from unstructured_client.types import BaseModel + + +class JobFailedFilesTypedDict(TypedDict): + failed_files: List[FailedFileTypedDict] + + +class JobFailedFiles(BaseModel): + failed_files: List[FailedFile] diff --git a/src/unstructured_client/models/shared/jobnodedetails.py b/src/unstructured_client/models/shared/jobnodedetails.py new file mode 100644 index 00000000..5a9231c5 --- /dev/null +++ b/src/unstructured_client/models/shared/jobnodedetails.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) + + +class JobNodeDetailsTypedDict(TypedDict): + failure: int + in_progress: int + ready: int + success: int + node_name: NotRequired[Nullable[str]] + node_subtype: NotRequired[Nullable[str]] + node_type: NotRequired[Nullable[str]] + + +class JobNodeDetails(BaseModel): + failure: int + + in_progress: int + + ready: int + + success: int + + node_name: OptionalNullable[str] = UNSET + + node_subtype: OptionalNullable[str] = UNSET + + node_type: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["node_name", "node_subtype", "node_type"] + nullable_fields = ["node_name", "node_subtype", "node_type"] + 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/jobprocessingstatus.py b/src/unstructured_client/models/shared/jobprocessingstatus.py new file mode 100644 index 00000000..5e68d14c --- /dev/null +++ b/src/unstructured_client/models/shared/jobprocessingstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class JobProcessingStatus(str, Enum): + SCHEDULED = "SCHEDULED" + IN_PROGRESS = "IN_PROGRESS" + SUCCESS = "SUCCESS" + COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" + STOPPED = "STOPPED" + FAILED = "FAILED" diff --git a/src/unstructured_client/models/shared/pemauthresponse.py b/src/unstructured_client/models/shared/pemauthresponse.py new file mode 100644 index 00000000..d2184f96 --- /dev/null +++ b/src/unstructured_client/models/shared/pemauthresponse.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) + + +class PemAuthResponseTypedDict(TypedDict): + r"""Response model for PEM key retrieval.""" + + pem_key: str + tenant_id: str + user_id: NotRequired[Nullable[str]] + + +class PemAuthResponse(BaseModel): + r"""Response model for PEM key retrieval.""" + + pem_key: str + + tenant_id: str + + user_id: OptionalNullable[str] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["user_id"] + nullable_fields = ["user_id"] + 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/secretreference.py b/src/unstructured_client/models/shared/secretreference.py new file mode 100644 index 00000000..9f19fdd0 --- /dev/null +++ b/src/unstructured_client/models/shared/secretreference.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .encryptiontype import EncryptionType +from typing import Optional +from typing_extensions import NotRequired, TypedDict +from unstructured_client.types import BaseModel + + +class SecretReferenceTypedDict(TypedDict): + id: str + type: NotRequired[EncryptionType] + + +class SecretReference(BaseModel): + id: str + + type: Optional[EncryptionType] = None diff --git a/src/unstructured_client/models/shared/sortdirection.py b/src/unstructured_client/models/shared/sortdirection.py new file mode 100644 index 00000000..646175f1 --- /dev/null +++ b/src/unstructured_client/models/shared/sortdirection.py @@ -0,0 +1,9 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SortDirection(str, Enum): + ASC = "asc" + DESC = "desc" diff --git a/src/unstructured_client/models/shared/sourceconnectortype.py b/src/unstructured_client/models/shared/sourceconnectortype.py index 4c074ed0..2824f9ce 100644 --- a/src/unstructured_client/models/shared/sourceconnectortype.py +++ b/src/unstructured_client/models/shared/sourceconnectortype.py @@ -22,6 +22,7 @@ class SourceConnectorType(str, Enum): S3 = "s3" SALESFORCE = "salesforce" SHAREPOINT = "sharepoint" + SLACK = "slack" SNOWFLAKE = "snowflake" JIRA = "jira" ZENDESK = "zendesk" diff --git a/src/unstructured_client/sdk.py b/src/unstructured_client/sdk.py index dc55648e..83e4f799 100644 --- a/src/unstructured_client/sdk.py +++ b/src/unstructured_client/sdk.py @@ -19,6 +19,7 @@ from unstructured_client.general import General from unstructured_client.jobs import Jobs from unstructured_client.sources import Sources + from unstructured_client.users import Users from unstructured_client.workflows import Workflows @@ -26,12 +27,14 @@ class UnstructuredClient(BaseSDK): destinations: "Destinations" jobs: "Jobs" sources: "Sources" + users: "Users" workflows: "Workflows" general: "General" _sub_sdk_map = { "destinations": ("unstructured_client.destinations", "Destinations"), "jobs": ("unstructured_client.jobs", "Jobs"), "sources": ("unstructured_client.sources", "Sources"), + "users": ("unstructured_client.users", "Users"), "workflows": ("unstructured_client.workflows", "Workflows"), "general": ("unstructured_client.general", "General"), } diff --git a/src/unstructured_client/users.py b/src/unstructured_client/users.py new file mode 100644 index 00000000..1a4c5ab3 --- /dev/null +++ b/src/unstructured_client/users.py @@ -0,0 +1,460 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from typing import Any, Mapping, Optional, Union, cast +from unstructured_client import utils +from unstructured_client._hooks import HookContext +from unstructured_client.models import errors, operations, shared +from unstructured_client.types import BaseModel, OptionalNullable, UNSET + + +class Users(BaseSDK): + def retrieve( + self, + *, + request: Union[operations.RetrieveRequest, operations.RetrieveRequestTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.RetrieveResponse: + r"""Retrieve PEM Key + + Given a UNSTRUCTURED_API_KEY in the post-payload, retrieve the associated PEM key + + :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.RETRIEVE_SERVERS[ + operations.RETRIEVE_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RetrieveRequest) + request = cast(operations.RetrieveRequest, request) + + req = self._build_request( + method="POST", + path="/api/v1/users/retrieve", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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="retrieve", + 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.RetrieveResponse( + pem_auth_response=utils.unmarshal_json( + http_res.text, Optional[shared.PemAuthResponse] + ), + 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 retrieve_async( + self, + *, + request: Union[operations.RetrieveRequest, operations.RetrieveRequestTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.RetrieveResponse: + r"""Retrieve PEM Key + + Given a UNSTRUCTURED_API_KEY in the post-payload, retrieve the associated PEM key + + :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.RETRIEVE_SERVERS[ + operations.RETRIEVE_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.RetrieveRequest) + request = cast(operations.RetrieveRequest, request) + + req = self._build_request_async( + method="POST", + path="/api/v1/users/retrieve", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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="retrieve", + 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.RetrieveResponse( + pem_auth_response=utils.unmarshal_json( + http_res.text, Optional[shared.PemAuthResponse] + ), + 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 store_secret( + self, + *, + request: Union[ + operations.StoreSecretRequest, operations.StoreSecretRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.StoreSecretResponse: + r"""Store an encrypted secret + + After encrypting a secret locally, store it and get back a reference id. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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.STORE_SECRET_SERVERS[ + operations.STORE_SECRET_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.StoreSecretRequest) + request = cast(operations.StoreSecretRequest, request) + + req = self._build_request( + method="POST", + path="/api/v1/users/secrets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.encrypted_secret, False, False, "json", shared.EncryptedSecret + ), + 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="store_secret", + 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.StoreSecretResponse( + secret_reference=utils.unmarshal_json( + http_res.text, Optional[shared.SecretReference] + ), + 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 store_secret_async( + self, + *, + request: Union[ + operations.StoreSecretRequest, operations.StoreSecretRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.StoreSecretResponse: + r"""Store an encrypted secret + + After encrypting a secret locally, store it and get back a reference id. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :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.STORE_SECRET_SERVERS[ + operations.STORE_SECRET_SERVER_PLATFORM_API + ] + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.StoreSecretRequest) + request = cast(operations.StoreSecretRequest, request) + + req = self._build_request_async( + method="POST", + path="/api/v1/users/secrets", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.encrypted_secret, False, False, "json", shared.EncryptedSecret + ), + 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="store_secret", + 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.StoreSecretResponse( + secret_reference=utils.unmarshal_json( + http_res.text, Optional[shared.SecretReference] + ), + 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, + )